Number of 6-character passwords with at least 1 digit
$begingroup$
I have two methods for calculating the answer to a problem, and I'm unable to figure out where one of them goes wrong (they yield different values).
My question is, why is this the case? Am I doing something wrong in my calculation, or my logic?
In my class today the professor discussed how to calculate the number of password combinations under the following conditions:
- The password is 6 characters long
- The password contains only upper-case letters and digits
- The must be at least 1 digit in the password
His solution was to take the total combinations of 6 letters and digits, and subtract the number of cases where there are only letters in the password:
combinations = $36^6 - 26^6$ (approx 1.868 million)
I tried solving the same problem with the following approach, getting a different value:
- Take all the combinations of 5 letter-or-digit characters
- Multiply that by the number of possible positions for the mandatory digit (6)
- Multiply that by the number of values the mandatory digit could have (10)
combinations = $36^5 cdot 6 cdot 10$ (approx 3.628 million)
combinatorics
$endgroup$
add a comment |
$begingroup$
I have two methods for calculating the answer to a problem, and I'm unable to figure out where one of them goes wrong (they yield different values).
My question is, why is this the case? Am I doing something wrong in my calculation, or my logic?
In my class today the professor discussed how to calculate the number of password combinations under the following conditions:
- The password is 6 characters long
- The password contains only upper-case letters and digits
- The must be at least 1 digit in the password
His solution was to take the total combinations of 6 letters and digits, and subtract the number of cases where there are only letters in the password:
combinations = $36^6 - 26^6$ (approx 1.868 million)
I tried solving the same problem with the following approach, getting a different value:
- Take all the combinations of 5 letter-or-digit characters
- Multiply that by the number of possible positions for the mandatory digit (6)
- Multiply that by the number of values the mandatory digit could have (10)
combinations = $36^5 cdot 6 cdot 10$ (approx 3.628 million)
combinatorics
$endgroup$
add a comment |
$begingroup$
I have two methods for calculating the answer to a problem, and I'm unable to figure out where one of them goes wrong (they yield different values).
My question is, why is this the case? Am I doing something wrong in my calculation, or my logic?
In my class today the professor discussed how to calculate the number of password combinations under the following conditions:
- The password is 6 characters long
- The password contains only upper-case letters and digits
- The must be at least 1 digit in the password
His solution was to take the total combinations of 6 letters and digits, and subtract the number of cases where there are only letters in the password:
combinations = $36^6 - 26^6$ (approx 1.868 million)
I tried solving the same problem with the following approach, getting a different value:
- Take all the combinations of 5 letter-or-digit characters
- Multiply that by the number of possible positions for the mandatory digit (6)
- Multiply that by the number of values the mandatory digit could have (10)
combinations = $36^5 cdot 6 cdot 10$ (approx 3.628 million)
combinatorics
$endgroup$
I have two methods for calculating the answer to a problem, and I'm unable to figure out where one of them goes wrong (they yield different values).
My question is, why is this the case? Am I doing something wrong in my calculation, or my logic?
In my class today the professor discussed how to calculate the number of password combinations under the following conditions:
- The password is 6 characters long
- The password contains only upper-case letters and digits
- The must be at least 1 digit in the password
His solution was to take the total combinations of 6 letters and digits, and subtract the number of cases where there are only letters in the password:
combinations = $36^6 - 26^6$ (approx 1.868 million)
I tried solving the same problem with the following approach, getting a different value:
- Take all the combinations of 5 letter-or-digit characters
- Multiply that by the number of possible positions for the mandatory digit (6)
- Multiply that by the number of values the mandatory digit could have (10)
combinations = $36^5 cdot 6 cdot 10$ (approx 3.628 million)
combinatorics
combinatorics
edited Oct 30 '15 at 20:27
user147263
asked Oct 30 '15 at 20:09
KernelDeimosKernelDeimos
18114
18114
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
$begingroup$
You counted several things twice in your example. For example, take a look at the password AAAA11
.
You counted that password as the password you get when you put the mandatory digit on the sixth place, and write AAAA1
on the other places, and also as the password you get when you put the mandatory digit on the fifth place, and write AAAA1
on the other places.
$endgroup$
add a comment |
$begingroup$
The problem is that you’re counting some passwords more than once. For instance, the password AB1CD2 gets counted once for having a digit in the third position and a second time for having a digit in the last position. The password 123456 gets counted six times in your calculation, once for each of the digits.
$endgroup$
add a comment |
$begingroup$
You will use this password to access your account. Enter a combination of at least six numbers, letter and punctuation marks.
$endgroup$
$begingroup$
This does not answer to OP
$endgroup$
– Green.H
Jun 18 '18 at 16:19
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%2f1505527%2fnumber-of-6-character-passwords-with-at-least-1-digit%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You counted several things twice in your example. For example, take a look at the password AAAA11
.
You counted that password as the password you get when you put the mandatory digit on the sixth place, and write AAAA1
on the other places, and also as the password you get when you put the mandatory digit on the fifth place, and write AAAA1
on the other places.
$endgroup$
add a comment |
$begingroup$
You counted several things twice in your example. For example, take a look at the password AAAA11
.
You counted that password as the password you get when you put the mandatory digit on the sixth place, and write AAAA1
on the other places, and also as the password you get when you put the mandatory digit on the fifth place, and write AAAA1
on the other places.
$endgroup$
add a comment |
$begingroup$
You counted several things twice in your example. For example, take a look at the password AAAA11
.
You counted that password as the password you get when you put the mandatory digit on the sixth place, and write AAAA1
on the other places, and also as the password you get when you put the mandatory digit on the fifth place, and write AAAA1
on the other places.
$endgroup$
You counted several things twice in your example. For example, take a look at the password AAAA11
.
You counted that password as the password you get when you put the mandatory digit on the sixth place, and write AAAA1
on the other places, and also as the password you get when you put the mandatory digit on the fifth place, and write AAAA1
on the other places.
answered Oct 30 '15 at 20:12
5xum5xum
91.5k394161
91.5k394161
add a comment |
add a comment |
$begingroup$
The problem is that you’re counting some passwords more than once. For instance, the password AB1CD2 gets counted once for having a digit in the third position and a second time for having a digit in the last position. The password 123456 gets counted six times in your calculation, once for each of the digits.
$endgroup$
add a comment |
$begingroup$
The problem is that you’re counting some passwords more than once. For instance, the password AB1CD2 gets counted once for having a digit in the third position and a second time for having a digit in the last position. The password 123456 gets counted six times in your calculation, once for each of the digits.
$endgroup$
add a comment |
$begingroup$
The problem is that you’re counting some passwords more than once. For instance, the password AB1CD2 gets counted once for having a digit in the third position and a second time for having a digit in the last position. The password 123456 gets counted six times in your calculation, once for each of the digits.
$endgroup$
The problem is that you’re counting some passwords more than once. For instance, the password AB1CD2 gets counted once for having a digit in the third position and a second time for having a digit in the last position. The password 123456 gets counted six times in your calculation, once for each of the digits.
answered Oct 30 '15 at 20:12
Brian M. ScottBrian M. Scott
459k38514916
459k38514916
add a comment |
add a comment |
$begingroup$
You will use this password to access your account. Enter a combination of at least six numbers, letter and punctuation marks.
$endgroup$
$begingroup$
This does not answer to OP
$endgroup$
– Green.H
Jun 18 '18 at 16:19
add a comment |
$begingroup$
You will use this password to access your account. Enter a combination of at least six numbers, letter and punctuation marks.
$endgroup$
$begingroup$
This does not answer to OP
$endgroup$
– Green.H
Jun 18 '18 at 16:19
add a comment |
$begingroup$
You will use this password to access your account. Enter a combination of at least six numbers, letter and punctuation marks.
$endgroup$
You will use this password to access your account. Enter a combination of at least six numbers, letter and punctuation marks.
answered Jun 18 '18 at 16:13
Er Raj sharmaEr Raj sharma
1
1
$begingroup$
This does not answer to OP
$endgroup$
– Green.H
Jun 18 '18 at 16:19
add a comment |
$begingroup$
This does not answer to OP
$endgroup$
– Green.H
Jun 18 '18 at 16:19
$begingroup$
This does not answer to OP
$endgroup$
– Green.H
Jun 18 '18 at 16:19
$begingroup$
This does not answer to OP
$endgroup$
– Green.H
Jun 18 '18 at 16:19
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%2f1505527%2fnumber-of-6-character-passwords-with-at-least-1-digit%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