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
SUMMARY

The probability of a password containing exactly 1 or 2 integers, given a password structure of eight characters composed of 26 lowercase letters, 26 uppercase letters, and 10 integers, is calculated as P(Password contains exactly 1 or 2 integers) = 0.6302. The initial calculations provided by the user were incorrect due to neglecting the positions of the integers within the password. The correct approach involves multiplying the number of valid configurations by the number of possible positions for the integers, leading to the final probability result.

PREREQUISITES
  • Understanding of combinatorial mathematics
  • Familiarity with probability theory
  • Knowledge of password structure and character sets
  • Ability to manipulate and simplify algebraic expressions
NEXT STEPS
  • Study combinatorial counting techniques in probability
  • Learn about permutations and combinations in relation to password generation
  • Explore the concept of conditional probability
  • Review examples of calculating probabilities in discrete uniform distributions
USEFUL FOR

Mathematicians, computer scientists, cybersecurity professionals, and anyone interested in understanding password security and probability calculations.

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