Where Did I Go Wrong in Calculating the Probability?

  • Context: High School 
  • Thread starter Thread starter little neutrino
  • Start date Start date
  • Tags Tags
    Probabilities
Click For Summary

Discussion Overview

The discussion revolves around calculating the probability of generating a code consisting of 3 letters followed by 2 digits, specifically focusing on the condition that the code has exactly 2 letters the same or 2 digits the same, but not both. Participants explore various approaches to the problem, including combinatorial reasoning and probability calculations.

Discussion Character

  • Mathematical reasoning
  • Debate/contested
  • Technical explanation

Main Points Raised

  • One participant calculates the probabilities for having exactly 2 digits the same and exactly 2 letters the same, but arrives at a total probability of 0.210, which they believe is incorrect.
  • Another participant suggests that the initial calculation for the letters includes the probability of at least 2 letters being the same, indicating a need to adjust for the case where all 3 letters are the same.
  • A question is raised about the number of ways to have 2 items the same in a set of 3, prompting further exploration of combinatorial arrangements.
  • Further clarification is sought on why the probability of at least 2 letters being the same was calculated instead of exactly 2.
  • One participant proposes an alternative method of calculating the probability by counting the number of arrangements directly, suggesting that this approach yields the expected answer.
  • Another participant points out a misunderstanding regarding the use of the probability formula for exclusive or (xor), indicating that the original calculation did not align with the problem's requirements.

Areas of Agreement / Disagreement

Participants express differing views on the correct approach to calculating the probabilities, with some suggesting adjustments to the initial calculations and others proposing alternative methods. The discussion remains unresolved as participants explore various interpretations and calculations.

Contextual Notes

There are limitations in the initial calculations regarding the definitions of "exactly 2 letters the same" versus "at least 2 letters the same," as well as the application of probability formulas for exclusive or scenarios. These aspects contribute to the ongoing debate without a clear resolution.

little neutrino
Messages
40
Reaction score
1
A code is generated consisting of 3 letters followed by 2 digits. Each of the 3 letters generated is equally likely to be any of the 26 letters of the alphabet. Each of the 2 digits generated is equally likely to be any of the nine digits 1-9. Find the probability that a randomly chosen code has exactly 2 letters the same or 2 digits the same, but not both.

Attempted solution:

P(exactly 2 digits same) = (263*9)/(263*92) = 1/9
P(exactly 2 letters same) = (26*25*3*92)/(263*92) = 75/676
P(2 digits same AND 2 letters same) = (26*25*3*9)/(263*92) = 25/2028
Required probability = 1/9 + 75/676 - 25/2028 = 0.210

But the correct answer is 0.197. Can I ask where did I go wrong? I can't figure it out...
Thanks!
 
Physics news on Phys.org
little neutrino said:
A code is generated consisting of 3 letters followed by 2 digits. Each of the 3 letters generated is equally likely to be any of the 26 letters of the alphabet. Each of the 2 digits generated is equally likely to be any of the nine digits 1-9. Find the probability that a randomly chosen code has exactly 2 letters the same or 2 digits the same, but not both.

Attempted solution:

P(exactly 2 digits same) = (263*9)/(263*92) = 1/9
P(exactly 2 letters same) = (26*25*3*92)/(263*92) = 75/676
P(2 digits same AND 2 letters same) = (26*25*3*9)/(263*92) = 25/2028
Required probability = 1/9 + 75/676 - 25/2028 = 0.210

But the correct answer is 0.197. Can I ask where did I go wrong? I can't figure it out...
Thanks!

Your calculation for 2 letters is the probability that at LEAST 2 letters is the same. You have to subtract off the probability that all 3 letters are the same to get the probability that exactly 2 letters are the same.
 
One other possible mistake. Exactly how many ways are there to have 2 items the same in a set of 3?
 
stevendaryl said:
Your calculation for 2 letters is the probability that at LEAST 2 letters is the same. You have to subtract off the probability that all 3 letters are the same to get the probability that exactly 2 letters are the same.

But why is that so?
__ __ __ __ __
For two letters to be the same == 26 choices
For the last letter, since it can't be the same as the two letters that are the same == 26 - 1 = 25 choices
No. of ways to arrange 3 letters, when 2 are the same == 3!/2! = 3
Thus no. of ways == 26 * 25 * 3 * 92

Why did I calculate the probability that at least 2 letters are the same? Could you elaborate? Sorry kind of confused.
 
little neutrino said:
No. of ways to arrange 3 letters, when 2 are the same == 3!/2! = 3
Yup I'm dumb sorry :D
 
Hmm. My criticism was mistaken, but here's a suggestion: Instead of computing probabilities for the various possibilities, try just computing

N_L = the number of ways to have exactly 2 letters the same, and both digits different.
N_D = the number of ways to have 3 or 0 letters the same, and both digits the same.

Then the probability is \frac{N_L + N_D}{26^3 \cdot 9^3}

When I did it that way, I got the expected answer.
 
Okay, I figured out what you did wrong:

You used P(A \vee B) = P(A) + P(B) - P(A \wedge B) where A = "exactly 2 letters the same" and B = "both digits the same". But they aren't asking for A \vee B, they're asking for A\ xor\ B (xor = exclusive or). The formula for that is:

P(A\ xor\ B) = P(A) + P(B) - 2P(A \wedge B)
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 7 ·
Replies
7
Views
1K
Replies
6
Views
10K
  • · Replies 12 ·
Replies
12
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
Replies
147
Views
10K
Replies
33
Views
3K