What is the probability of a password containing exactly 1 or 2 integers?

  • Context: MHB 
  • Thread starter Thread starter iamlorde
  • Start date Start date
  • Tags Tags
    Probability
Click For Summary

Discussion Overview

The discussion revolves around calculating the probability of a password containing exactly 1 or 2 integers within a total of eight characters, which can include lowercase letters, uppercase letters, and integers. Participants explore different approaches to the problem, including the use of combinatorial reasoning and probability formulas.

Discussion Character

  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant presents an initial calculation for the probability of passwords containing exactly 1 or 2 integers, yielding a result of 0.0561, but expresses confusion over the expected answer of 0.630.
  • Another participant questions the completeness of the problem statement and suggests that the events A and B are not utilized in the calculation.
  • A later reply acknowledges that the set of passwords with exactly 1 or 2 integers is distinct from the sets defined by events A and B, indicating a need for a different approach to the problem.
  • One participant suggests that the placement of integers in the password must be considered, proposing that the correct approach involves counting the positions of integers and multiplying by the number of ways to arrange the remaining characters.
  • Another participant elaborates on the counting method, indicating that the integers can appear in any position, not just the last, and provides a formula that leads to the result of 0.6302.

Areas of Agreement / Disagreement

Participants express differing views on the correct method to calculate the probability, with no consensus reached on the final answer. Some participants agree on the need to consider the positions of integers, while others remain uncertain about their calculations.

Contextual Notes

Participants have not fully resolved the mathematical steps involved in the calculations, and there are indications of missing assumptions regarding the placement of integers and the overall combinatorial approach.

iamlorde
Messages
6
Reaction score
0
Greetings! Can someone offer help?

A computer system uses passwords that contain exactly
eight characters, and each character is one of the 26 lowercase
letters (a–z) or 26 uppercase letters (A–Z) or 10 integers (0–9).
Assume all passwords are equally likely. Let A and B denote
the events that consist of passwords with only letters or only
integers, respectively. Determine the following probability:

P (Password contains exactly 1 or 2 integers)

I proceeded like so:

$$

\frac{{52}^{7}\cdot10}{{62}^{8}}\ + \frac{{52}^{6}\cdot{10}^{2}}{{62}^{8}}\ = 0.0561

$$

The answer is supposed to be: 0.630, but I have no idea how to reach it.
 
Physics news on Phys.org
Hi iamlorde,

Welcome to MHB! :)

Is this the whole problem? I ask because the events A and B are introduced but not used in the question you pose.

Assuming that you can reuse any character or letter if need be, which is consistent with how real passwords work, then I agree with your answer and your method.
 
Jameson, thank you for your reply. I hadn't given the rest because I had answered them already. Here is the entirety.

A computer system uses passwords that contain exactly
eight characters, and each character is one of the 26 lowercase
letters (a–z) or 26 uppercase letters (A–Z) or 10 integers (0–9).
Assume all passwords are equally likely. Let A and B denote
the events that consist of passwords with only letters or only
integers, respectively. Determine the following probabilities:
(a) P(A∪ B) (b) P(A′∪ B)
(c) P (Password contains exactly 1 or 2 integers)

(a) $$
P(A \cup B) =

\frac{{52}^{8}}{{62}^{8}}\ + \frac{{10}^{8}}{{62}^{8}}\ = 0.2448
$$

(b) $$
P(A' \cup B) = \frac{{62}^{8} - {52}^{8}}{{62}^{8}}\ = 0.7552
$$
 
The following is my visualization of the problem (c).

8tII6IU.gif


At this point I'm acknowledging that set (Password contains exactly 1 or 2 integers) is exclusive from set A & B.

Yet I do not know how to quantitatively approach this problem.

Thank you.
 
Hi,

I think you are missing the position where the integers appear, count it and then the result is 0.6302
 
Fallen Angel said:
Hi,

I think you are missing the position where the integers appear, count it and then the result is 0.6302

I'm sorry but I still can't get the answer.
My logic is as follow:

P[(passwords with exactly 1 integer) OR (passwords with exactly 2 integer)]

Therefore:

[A-Za-z]*[A-Za-z]*[A-Za-z]*[A-Za-z]*[A-Za-z]*[A-Za-z]*[A-Za-z]*[0-9]
or
[52]*[52]*[52]*[52]*[52]*[52]*[52]*[10] so: 52^7 * 10 over 62^8

then:

[A-Za-z]*[A-Za-z]*[A-Za-z]*[A-Za-z]*[A-Za-z]*[A-Za-z]*[0-9]*[0-9]
or
[52]*[52]*[52]*[52]*[52]*[52]*[10]*[10] so: 52^6 * 10^2 over 62^8Then adding both results, would theoretically give the answer. But my logic is flawed and I can't seem to understand why.
 
Hi,

The point of my previous answer is that the integer doesn't need to be in last position.You got that there are $\dfrac{52^7\times 10}{62^8}$ passwords with the last character being an integer, so in order to count passwords with exactly one integer we have to multiply it by $8$.

Now for counting passwords with exactly two integers we got $\dfrac{52^7\times 10^2}{62^8}$ where integers are in positions one and two. Now multyplying by $\dfrac{8\times 7}{2}$ we got all possible possitions for the two integers, adding it we reach that $P(...)=0.6302$.

Note:There is a two in the denominator because having integers in position one and two is the same as having integers in positions two and one.
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 9 ·
Replies
9
Views
13K
  • · Replies 4 ·
Replies
4
Views
11K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
Replies
1
Views
3K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K