420
submitted 1 year ago by Toes@ani.social to c/196@lemmy.blahaj.zone
you are viewing a single comment's thread
view the rest of the comments
[-] calcopiritus@lemmy.world 5 points 1 year ago

You assume that the probability of TH = HT = HH

When In fact, the probabilities are as follows:

P(HT)+P(TH) = 50% P(HH) = 50%

For all the probabilities being equal, you'd have to consider 4 cases:

HT, TH, HH (1) and HH (2).

The difference between HH (1) and HH (2) is which one you were told that was heads.

Then P(HH) = P(HH (1)) + P(HH (2)) = 2/4 = 50%

[-] starman2112@sh.itjust.works 2 points 1 year ago

The issue is that you weren't told a particular one was heads, only that at least one was heads. If I flipped a nickel and a dime, then the four possibilities are NtDt, NtDh, NhDt, and NhDh. If I say that at least one of them is heads but don't tell you which one, then there are three possibilities: I flipped NhDt, NtDh, or NhDh. It's only when I tell you that the nickel landed on heads that it collapses to NhDt and NhDh.

Sorry if the acronyms are hard to read, they're much faster than typing something like "Heads (nickel) tails (dime)"

[-] calcopiritus@lemmy.world 1 points 1 year ago

Again, you are assuming that every occurrence has the same chance. When in fact, they have not. There are 3 random events happening here:

  1. Flip of one coin (50% chance each)
  2. Flip of the other coin (50% chance each)
  3. The coin that you told me (let's say it's 50% nickel 50% dime for simplicity's sake)

Also, I am assuming that these 3 events are completely unrelated. That is, the result of a coin flip won't determine whether you tell me the nickel or dime. A complete list of events is as follows:

T T N

T T D

H T N

H T D

T H N

T H D

H H N

H H D

After telling me that one of them is heads, the list is as follows:

H T D

T H N

H H D

H H N

H H is 50% chance, and the sum of HT + TH is the other 50%

[-] starman2112@sh.itjust.works 1 points 11 months ago* (last edited 11 months ago)

This is very easily simulated. I use Tasker, you can use Python or something. Assume 1 is heads and 2 is tails

  1. Randomize variable %dime to 1 or 2

  2. Randomize variable %nickel to 1 or 2

This flips two coins. At this point there's a 25% chance of each TT, TH, HT, and HH occurring.

  1. Goto 1 IF %dime != 1 AND %nickel != 1

This is the point where I tell you that at least one of them is heads, but not which. It flips the coins again only if they landed TT, which means there are three possible sets of coins now: TH, HT, or HH.

  1. Add 1 to variable %HeadsTails IF %dime = 2 OR %nickel = 2

  2. Add 1 to variable %HeadsHeads IF %dime = 1 AND %nickel = 1

This keeps track of what sets made it past line 3. If either is tails, it adds one to %HeadsTails. If neither is tails, then it adds one to %HeadsHeads

  1. Add 1 to variable %Counter

  2. Goto 1 IF %Counter <1000

You can set your counter as high as you like. Python would probably handle 10,000 flips faster than Tasker can handle 1,000, but I'm on my phone and also python illiterate.

Press play, and I get 357 sets with two heads, and 643 sets that have a tails. The longer it runs, the closer to a ratio of 1:2 it'll get.

[-] calcopiritus@lemmy.world 1 points 11 months ago

If you simulate it like that, it leads to a contradiction.

According to the problem, 2 coins are flipped, and we all agree that it leads to an event pool of {TT,TH,HT,HH}, where all 4 events are equally as likely.

In the simulation, however, you just ignore the "TT" situation, which leads to a total event pool of {HT,TH,HH}. Where all events are equally likely.

The way the problem was phrased was "2 coin flips happen, and I have a machine that tells me either if both are Tails or not, this time it turns out that there is at least 1 heads". But the way you simulated it is "I will make coinflips until I have at least 1 heads".

[-] starman2112@sh.itjust.works 1 points 11 months ago

The way the problem was phrased was "2 coin flips happen, and I have a machine that tells me either if both are Tails or not, this time it turns out that there is at least 1 heads".

That is exactly what my program simulates. We're only interested in the times when this time, it turns out that there is at least one heads. If they both land tails, then we don't record anything about the flip, because the question is "if they aren't both tails, what is the probability that they are both heads?"

Think of it this way: generate n pairs of flipped coins, and put them in Bucket 0. Take every pair of coins that has at least one heads, and put it in Bucket 1. You'll be leaving 25% of the pairs in Bucket 0–specifically, the TT pairs. The TH, HT, and HH pairs are all in Bucket1. Now, 33% of the pairs in Bucket 1 are HH.

When I tell you that I've flipped a pair of coins, there's a 25% chance that they landed HH. But when I tell you that at least one is heads, it's like pulling a random pair out of Bucket 1. We don't know whether that pair was in Bucket 1 because of the nickel, dime, or both.

[-] calcopiritus@lemmy.world 2 points 11 months ago

I tried to answer but idk why Lemmy failed to post it, so I'll make a tldr instead.

TLDR:

Instead of reasoning I used actual statistics equations and you are correct: the chance in the coins case is 1/3.

However, I was misguided assuming that both the "girl and boy" problem and "coins" problem are the same, when in fact they are not.

In the "coins" case, the statement "at least one of them is heads" has a probability of 3/4. In the "girl and boy" case, the statement "the child that opened the door was a boy" has a probability of 1/2.

this post was submitted on 03 Dec 2023
420 points (100.0% liked)

196

16593 readers
2209 users here now

Be sure to follow the rule before you head out.

Rule: You must post before you leave.

^other^ ^rules^

founded 1 year ago
MODERATORS