Number of ways to form a password of length 8 9 and 10 with restrictions
$begingroup$
Consider creating a password, and Its length is between $8$ and $10$ characters. Each character is either lowercase letters without accents, uppercase letters without accents, digits from 0 to 9 or the special characters !?#&@%*~$_. The password contains at least one character of at least three of the four types mentioned. In how many ways can a password be chosen to meet all those requirements?
Here is my attempt: There are $10*26*26+ 10*26*26+26*10*10+26*10*10$ ways to pick 3 characters one from three of the four types. There are $binom{8}{3}+binom{9}{3}+binom{10}{3}$ to choose three positions for the length 8, 9 and 10 strings. So then:
$$(10*26*26+ 10*26*26+26*10*10+26*10*10)*binom{8}{3}*frac{72!}{(72-5)!}+ (10*26*26+ 10*26*26+26*10*10+26*10*10)*binom{9}{3}*frac{72!}{(72-6)!} +(10*26*26+ 10*26*26+26*10*10+26*10*10)*binom{10}{3}*frac{72!}{(72-7)!}$$
But this clearly has overlaps, so I overcounted. How can I solve this problem?
combinatorics
$endgroup$
add a comment |
$begingroup$
Consider creating a password, and Its length is between $8$ and $10$ characters. Each character is either lowercase letters without accents, uppercase letters without accents, digits from 0 to 9 or the special characters !?#&@%*~$_. The password contains at least one character of at least three of the four types mentioned. In how many ways can a password be chosen to meet all those requirements?
Here is my attempt: There are $10*26*26+ 10*26*26+26*10*10+26*10*10$ ways to pick 3 characters one from three of the four types. There are $binom{8}{3}+binom{9}{3}+binom{10}{3}$ to choose three positions for the length 8, 9 and 10 strings. So then:
$$(10*26*26+ 10*26*26+26*10*10+26*10*10)*binom{8}{3}*frac{72!}{(72-5)!}+ (10*26*26+ 10*26*26+26*10*10+26*10*10)*binom{9}{3}*frac{72!}{(72-6)!} +(10*26*26+ 10*26*26+26*10*10+26*10*10)*binom{10}{3}*frac{72!}{(72-7)!}$$
But this clearly has overlaps, so I overcounted. How can I solve this problem?
combinatorics
$endgroup$
add a comment |
$begingroup$
Consider creating a password, and Its length is between $8$ and $10$ characters. Each character is either lowercase letters without accents, uppercase letters without accents, digits from 0 to 9 or the special characters !?#&@%*~$_. The password contains at least one character of at least three of the four types mentioned. In how many ways can a password be chosen to meet all those requirements?
Here is my attempt: There are $10*26*26+ 10*26*26+26*10*10+26*10*10$ ways to pick 3 characters one from three of the four types. There are $binom{8}{3}+binom{9}{3}+binom{10}{3}$ to choose three positions for the length 8, 9 and 10 strings. So then:
$$(10*26*26+ 10*26*26+26*10*10+26*10*10)*binom{8}{3}*frac{72!}{(72-5)!}+ (10*26*26+ 10*26*26+26*10*10+26*10*10)*binom{9}{3}*frac{72!}{(72-6)!} +(10*26*26+ 10*26*26+26*10*10+26*10*10)*binom{10}{3}*frac{72!}{(72-7)!}$$
But this clearly has overlaps, so I overcounted. How can I solve this problem?
combinatorics
$endgroup$
Consider creating a password, and Its length is between $8$ and $10$ characters. Each character is either lowercase letters without accents, uppercase letters without accents, digits from 0 to 9 or the special characters !?#&@%*~$_. The password contains at least one character of at least three of the four types mentioned. In how many ways can a password be chosen to meet all those requirements?
Here is my attempt: There are $10*26*26+ 10*26*26+26*10*10+26*10*10$ ways to pick 3 characters one from three of the four types. There are $binom{8}{3}+binom{9}{3}+binom{10}{3}$ to choose three positions for the length 8, 9 and 10 strings. So then:
$$(10*26*26+ 10*26*26+26*10*10+26*10*10)*binom{8}{3}*frac{72!}{(72-5)!}+ (10*26*26+ 10*26*26+26*10*10+26*10*10)*binom{9}{3}*frac{72!}{(72-6)!} +(10*26*26+ 10*26*26+26*10*10+26*10*10)*binom{10}{3}*frac{72!}{(72-7)!}$$
But this clearly has overlaps, so I overcounted. How can I solve this problem?
combinatorics
combinatorics
edited Feb 1 at 7:03
jvdhooft
5,65961641
5,65961641
asked Feb 1 at 5:08
mathpadawanmathpadawan
1,940422
1,940422
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
We can use subtraction to solve this problem. If we would have one character for each group only, the number of possible combinations of length $n$ would be:
$$4^n - {4 choose 2} (2^n - 2) - {4 choose 1} 1^n$$
This comes down to considering all possible combinations with four groups of characters, subtracting all combinations with two groups or less. We can use a similar approach when multiple characters are allowed. For the number of combinations $f(n)$ of length $n$, we find:
$$f(n) = 72^n - [(52^n - 2 cdot 26^n) + 4 cdot (36^n - 26^n -10^n) + (20^n - 2 cdot 10^n)] - (2 cdot 26^n + 2 cdot 10^n)$$
The total number of valid passwords thus equals:
$$f(8) + f(9) + f(10) approx 3.635 cdot 10^{18}$$
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3095851%2fnumber-of-ways-to-form-a-password-of-length-8-9-and-10-with-restrictions%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
We can use subtraction to solve this problem. If we would have one character for each group only, the number of possible combinations of length $n$ would be:
$$4^n - {4 choose 2} (2^n - 2) - {4 choose 1} 1^n$$
This comes down to considering all possible combinations with four groups of characters, subtracting all combinations with two groups or less. We can use a similar approach when multiple characters are allowed. For the number of combinations $f(n)$ of length $n$, we find:
$$f(n) = 72^n - [(52^n - 2 cdot 26^n) + 4 cdot (36^n - 26^n -10^n) + (20^n - 2 cdot 10^n)] - (2 cdot 26^n + 2 cdot 10^n)$$
The total number of valid passwords thus equals:
$$f(8) + f(9) + f(10) approx 3.635 cdot 10^{18}$$
$endgroup$
add a comment |
$begingroup$
We can use subtraction to solve this problem. If we would have one character for each group only, the number of possible combinations of length $n$ would be:
$$4^n - {4 choose 2} (2^n - 2) - {4 choose 1} 1^n$$
This comes down to considering all possible combinations with four groups of characters, subtracting all combinations with two groups or less. We can use a similar approach when multiple characters are allowed. For the number of combinations $f(n)$ of length $n$, we find:
$$f(n) = 72^n - [(52^n - 2 cdot 26^n) + 4 cdot (36^n - 26^n -10^n) + (20^n - 2 cdot 10^n)] - (2 cdot 26^n + 2 cdot 10^n)$$
The total number of valid passwords thus equals:
$$f(8) + f(9) + f(10) approx 3.635 cdot 10^{18}$$
$endgroup$
add a comment |
$begingroup$
We can use subtraction to solve this problem. If we would have one character for each group only, the number of possible combinations of length $n$ would be:
$$4^n - {4 choose 2} (2^n - 2) - {4 choose 1} 1^n$$
This comes down to considering all possible combinations with four groups of characters, subtracting all combinations with two groups or less. We can use a similar approach when multiple characters are allowed. For the number of combinations $f(n)$ of length $n$, we find:
$$f(n) = 72^n - [(52^n - 2 cdot 26^n) + 4 cdot (36^n - 26^n -10^n) + (20^n - 2 cdot 10^n)] - (2 cdot 26^n + 2 cdot 10^n)$$
The total number of valid passwords thus equals:
$$f(8) + f(9) + f(10) approx 3.635 cdot 10^{18}$$
$endgroup$
We can use subtraction to solve this problem. If we would have one character for each group only, the number of possible combinations of length $n$ would be:
$$4^n - {4 choose 2} (2^n - 2) - {4 choose 1} 1^n$$
This comes down to considering all possible combinations with four groups of characters, subtracting all combinations with two groups or less. We can use a similar approach when multiple characters are allowed. For the number of combinations $f(n)$ of length $n$, we find:
$$f(n) = 72^n - [(52^n - 2 cdot 26^n) + 4 cdot (36^n - 26^n -10^n) + (20^n - 2 cdot 10^n)] - (2 cdot 26^n + 2 cdot 10^n)$$
The total number of valid passwords thus equals:
$$f(8) + f(9) + f(10) approx 3.635 cdot 10^{18}$$
edited Feb 1 at 7:29
answered Feb 1 at 7:01
jvdhooftjvdhooft
5,65961641
5,65961641
add a comment |
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3095851%2fnumber-of-ways-to-form-a-password-of-length-8-9-and-10-with-restrictions%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown