Sort by

recency

|

184 Discussions

|

  • + 0 comments
    import math
    from fractions import Fraction
    
    def reducto(num, den):
        pgcd = math.gcd(num, den)
        s_num = num // pgcd
        s_den = den // pgcd
        return s_num, s_den
    
    def prob_direct(nbr_possibilities, favorable_events):
        max_events = nbr_possibilities * nbr_possibilities
        return Fraction(*reducto(favorable_events, max_events))
    
    def prob_comp(frac):
        return 1 - frac
    
    def Bayne(a,b):
         return a/b
    
    A = prob_direct(2, 1)
    B = prob_comp(A) 
    C = Bayne(A,B)
    
    print("Bayne:",C)
    
  • + 0 comments

    I think I figured it out via naive reasoning. We know that they have two kids, so, marking a boy as 1 and a girl as 0, there are four options as to what they can be: 00, 01, 10 and 11. Now, we know that one is a boy, so it can't be 00. Thus, there are three options, of which only one, option 11, is what we are looking for. Thus the probability is 1/3.

  • + 1 comment

    Sex probability is an INDEPENDENT event. Thus every time the sex is 50/50.

    This is a bad example of conditional probability. How does the sex of the first child affect the probability of the sex of the second child? These are independent events.

  • + 2 comments

    I was so confused that I was calculating the probability that the gender of the second child is "male", instead of calculating the probability that both children are boys... 1/3

  • + 0 comments

    Bayes' theorem is a powerful tool for problems like this. Let's use it to solve the problem.

    Let ( B_1 ) be the event that the first child is a boy and ( B_2 ) be the event that the second child is a boy.

    We want to find the probability that both children are boys given that at least one of them is a boy. In terms of events, we want to find:

    [ P(B_1 \cap B_2 | B_1 \cup B_2) ]

    Using Bayes' theorem:

    [ P(B_1 \cap B_2 | B_1 \cup B_2) = \frac{P(B_1 \cup B_2 | B_1 \cap B_2) \times P(B_1 \cap B_2)}{P(B_1 \cup B_2)} ]

    Now, let's break down each of these probabilities:

    1. ( P(B_1 \cup B_2 | B_1 \cap B_2) ): If both children are boys, then the probability that at least one of them is a boy is 1. So, ( P(B_1 \cup B_2 | B_1 \cap B_2) = 1 ).

    2. ( P(B_1 \cap B_2) ): This is the probability that both children are boys. Since the children's genders are independent and each has a ( \frac{1}{2} ) chance of being a boy, ( P(B_1 \cap B_2) = \frac{1}{2} \times \frac{1}{2} = \frac{1}{4} ).

    3. ( P(B_1 \cup B_2) ): This is the probability that at least one child is a boy. From our initial list of combinations (BB, BG, GB, GG), three of them have at least one boy. So, ( P(B_1 \cup B_2) = \frac{3}{4} ).

    Plugging these values into Bayes' theorem:

    [ P(B_1 \cap B_2 | B_1 \cup B_2) = \frac{1 \times \frac{1}{4}}{\frac{3}{4}} = \frac{1}{3} ]

    So, using Bayes' theorem, we again find that the probability that both children are boys, given that at least one of them is a boy, is ( \frac{1}{3} ).