Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Aashish Chaubey 💥⚡️
Aashish Chaubey 💥⚡️

Posted on

     

Boy or Girl Paradox... What the heck is it??? 🤯🤷

Hi friends,

I am a machine learning and data science enthusiast. I love playing with numbers and finding insights. I know many of you are, at least to some level. Even if you are not but you have some level of interest in mathematics, there is a great chance you will find this post interesting.

Please let me know if you guys already knew this and if there are many more which I should check out, please let me know in the comments belows. I encourage all my fellow reader to read them too.


I like solving problems, sometimes I find it on renowned platforms like Kaggle and hackerearth. Randomly I came across this seemingly easy question but which blew my mind off [partly because I feel this problem is not articulated well!]

Hackerrank Problem

I thought I didn't have to think much about it. Because it is just so straight forward. I mean it is given that one child is a boy, only probability of the other child being a boy is1/2 [unless otherwise stated].

I selected the 1/2 answer from the answer, it was a wrong one. Okay, it needed a little more thinking. I wrote down all the possibilities at least one of the child is a boy [we are already given this information].

[BB, BG, GB]
Enter fullscreen modeExit fullscreen mode

Therefore, another answer which is also equally likely according to the question is1/3. And as it turns out, this indeed is a correct answer.

But how can we have two equally correct answers for this. In my view, both the answers, as per the problem statement is correct.

I took to Google for adjudication, and again, Google didn't disappoint. Look what I found:

TheBoy or Girl paradox surrounds a set of questions in probability theory, which are also known asThe Two Child Problem,Mr. Smith's Children and theMrs. Smith Problem. The initial formulation of the question dates back to at least 1959, when Martin Gardner featured it in his October 1959 "Mathematical Games column" inScientific American. He titled itThe Two Children Problem, and phrased the paradox as follows:

  • Mr. Jones has two children. The older child is a girl. What is the probability that both children are girls?
  • Mr. Smith has two children. At least one of them is a boy. What is the probability that both children are boys?

I think it is a good read. I suggest you all to go through it (if you already haven't).


Just wanted to share this information to this erudite community. Please feel free to reach out to me on:

Twitter:https://twitter.com/AashishLChaubey
LinkedIn:https://www.linkedin.com/in/chaubey-aashish

Please checkout myGithub

Top comments(8)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️
Blog: https://blog.but.gayMastodon: @darkwiiplayer@tech.lgbtPronouns: en.pronouns.page/@darkwiiplayer
  • Pronouns
    she/her;q=1, they/them;q=0.8, */*;q=0.2
  • Joined

Intuitively, I also wanted to say 1/2, because if one is a boy, there's only one 50/50 change, right?

But if you rephrase the question as "Of all families with 2 children, of which at least one is a boy; how many have two boys?" the answer becomes a bit easier: it's 1/3, because there's 3 possible combinations (boy girl, girl boy and boy boy), only one of which is the one we're looking for.

CollapseExpand
 
mr_eking profile image
Eric King
  • Location
    Scottsdale, Arizona, USA
  • Work
    Software Architect at local government
  • Joined

Counter argument: "boy girl" and "girl boy"are the same option, since there's no reason to distinguish by birth order (or any characteristic other than gender).

I think it would be correct to say that there are3 possible options: "both boys", "both girls", and "one of each". Since the "both girls" option is impossible, you are left with only two possible options: "both boys", or "one of each". Answer: 1/2

CollapseExpand
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️
Blog: https://blog.but.gayMastodon: @darkwiiplayer@tech.lgbtPronouns: en.pronouns.page/@darkwiiplayer
  • Pronouns
    she/her;q=1, they/them;q=0.8, */*;q=0.2
  • Joined

You'd think so, but no, you're still wrong. Think of it this way: Before even filtering out the option with two girls: you have four possible permutations: BB, BG, GB and GG; each of them has a chance of 1/4.

It's twice as likely to have a boy and a girl as to have either two boys or two girls. Put differently: there's a 50/50 chance that the genders match.

If you now remove one of the options (two girls), you're still left with a 2 in 3 chance that they're one boy and one girl.

You can even do an experiment: Write a simple program that does coin tosses, and repeatedly throw pairs of two coins. Then pick one side and filter out all the results where both coins landed on that side. You'll roughly end up with two thirds of the pairs being different sides.

CollapseExpand
 
aashish profile image
Aashish Chaubey 💥⚡️
Techie, machine learning enthusiast
  • Email
  • Location
    Delhi, IN
  • Education
    B. Tech. Computer Science
  • Work
    Data Scientist at IBM
  • Joined

You are correct, and that's what I mean, this question is left for open interpretation. You could literally interpret in multiple ways.

CollapseExpand
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️
Blog: https://blog.but.gayMastodon: @darkwiiplayer@tech.lgbtPronouns: en.pronouns.page/@darkwiiplayer
  • Pronouns
    she/her;q=1, they/them;q=0.8, */*;q=0.2
  • Joined

Here's the smartass answer: 0%. The question statesone of them is a boy, so the other is a girl. HA!

CollapseExpand
 
nicolus profile image
Nicolus
Hey, that's me !
  • Location
    Paris, France
  • Work
    Lead developer at Scutum Security First
  • Joined

If you don't know it already, check out the Monty Hall problem, you're in for a treat !

en.wikipedia.org/wiki/Monty_Hall_p...

CollapseExpand
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️
Blog: https://blog.but.gayMastodon: @darkwiiplayer@tech.lgbtPronouns: en.pronouns.page/@darkwiiplayer
  • Pronouns
    she/her;q=1, they/them;q=0.8, */*;q=0.2
  • Joined

One of my favourite problems, because it just seems sooooo counter-intuitive. However, as I found out, it seems much more obvious to me if you consider it with 100 doors:

Pick 1 door of a hundred. What are the chances you're right? very low.

Now 98 doors are opened, and you're given the chance to switch to the other one. Now it suddenly seems very clear that you should switch.

CollapseExpand
 
aashish profile image
Aashish Chaubey 💥⚡️
Techie, machine learning enthusiast
  • Email
  • Location
    Delhi, IN
  • Education
    B. Tech. Computer Science
  • Work
    Data Scientist at IBM
  • Joined

This is interestingl, Thanks Nicolas!

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Techie, machine learning enthusiast
  • Location
    Delhi, IN
  • Education
    B. Tech. Computer Science
  • Work
    Data Scientist at IBM
  • Joined

Trending onDEV CommunityHot

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp