Blood type

Back to Topic List

aszaloki     2024-10-14 09:15:39

Hi Kevin!

I am a little bit confused about the results (either in the example and real test). In the example the first and second case results differ from mine but the two last results are the same. In latter cases (John's AB, grandchild 0 and vice versa) they are indepedend events as if John is AB then he does not have "i" allele, so in order to get "O" blood type for the grandchild it only depends on the alleles of the other branch (the two other granparents). But the first two cases the blood type of John and the grandhild are not independent so conditional probabality should be calculated. Based on that I get 0.289623864168618 and 0.377378665644172 for first and second case. Could you please help me what I may misundertand?

Thank you in advance!

admin (Kevin)     2024-10-14 15:01:17
User avatar

Hi Adam!

Looks like an error on my part. For example if John had type B then his allele composition was being oversimplified as 75% IB and 25% i, not taking into consideration the allele distribution in the population! This won't generate an error when John has type AB or O as those allele compositions are fully-defined.

After correcting the error the examples now match your numbers, so without actually looking at your code it appears that you may already have the correct method!

Thanks!

aszaloki     2024-10-14 15:38:42

Hi Kevin,

ok I feel relieved... :) Till now, after running the test again I have a few answer with differences yet :( Briefly what I do: Play every possible inheritance (also every possibility for John). In every inheritance I save John's actual blood type. In the end I calculate a conditional probability.

Sorry for asking you to check your part again (or my part if you feel so). Tomorrow if I have time, I can send you some exact inputs and results if it is necessary.

Thanks!

aszaloki     2024-10-25 09:20:51

Hi Kevin,

I have just started gathering my results to send them to you, so I've run my code and tried to submit to observe the differences. And much to my astonishment they have been accepted!

So after your last fix maybe I did not use the working version of my code or I don't know what happened. In order to exclude luck I have tried three different set of inputs (by refreshing the problem page), it worked.

So I think both of us have the right method know :)

Please login and solve 5 problems to be able to post at forum