Number of 6-character passwords with at least 1 digit












3












$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:




  1. Take all the combinations of 5 letter-or-digit characters

  2. Multiply that by the number of possible positions for the mandatory digit (6)

  3. Multiply that by the number of values the mandatory digit could have (10)


combinations = $36^5 cdot 6 cdot 10$ (approx 3.628 million)










share|cite|improve this question











$endgroup$

















    3












    $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:




    1. Take all the combinations of 5 letter-or-digit characters

    2. Multiply that by the number of possible positions for the mandatory digit (6)

    3. Multiply that by the number of values the mandatory digit could have (10)


    combinations = $36^5 cdot 6 cdot 10$ (approx 3.628 million)










    share|cite|improve this question











    $endgroup$















      3












      3








      3





      $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:




      1. Take all the combinations of 5 letter-or-digit characters

      2. Multiply that by the number of possible positions for the mandatory digit (6)

      3. Multiply that by the number of values the mandatory digit could have (10)


      combinations = $36^5 cdot 6 cdot 10$ (approx 3.628 million)










      share|cite|improve this question











      $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:




      1. Take all the combinations of 5 letter-or-digit characters

      2. Multiply that by the number of possible positions for the mandatory digit (6)

      3. 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






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Oct 30 '15 at 20:27







      user147263

















      asked Oct 30 '15 at 20:09









      KernelDeimosKernelDeimos

      18114




      18114






















          3 Answers
          3






          active

          oldest

          votes


















          5












          $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.






          share|cite|improve this answer









          $endgroup$





















            3












            $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.






            share|cite|improve this answer









            $endgroup$





















              -2












              $begingroup$

              You will use this password to access your account. Enter a combination of at least six numbers, letter and punctuation marks.






              share|cite|improve this answer









              $endgroup$













              • $begingroup$
                This does not answer to OP
                $endgroup$
                – Green.H
                Jun 18 '18 at 16:19











              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
              });


              }
              });














              draft saved

              draft discarded


















              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









              5












              $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.






              share|cite|improve this answer









              $endgroup$


















                5












                $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.






                share|cite|improve this answer









                $endgroup$
















                  5












                  5








                  5





                  $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.






                  share|cite|improve this answer









                  $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.







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Oct 30 '15 at 20:12









                  5xum5xum

                  91.5k394161




                  91.5k394161























                      3












                      $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.






                      share|cite|improve this answer









                      $endgroup$


















                        3












                        $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.






                        share|cite|improve this answer









                        $endgroup$
















                          3












                          3








                          3





                          $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.






                          share|cite|improve this answer









                          $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.







                          share|cite|improve this answer












                          share|cite|improve this answer



                          share|cite|improve this answer










                          answered Oct 30 '15 at 20:12









                          Brian M. ScottBrian M. Scott

                          459k38514916




                          459k38514916























                              -2












                              $begingroup$

                              You will use this password to access your account. Enter a combination of at least six numbers, letter and punctuation marks.






                              share|cite|improve this answer









                              $endgroup$













                              • $begingroup$
                                This does not answer to OP
                                $endgroup$
                                – Green.H
                                Jun 18 '18 at 16:19
















                              -2












                              $begingroup$

                              You will use this password to access your account. Enter a combination of at least six numbers, letter and punctuation marks.






                              share|cite|improve this answer









                              $endgroup$













                              • $begingroup$
                                This does not answer to OP
                                $endgroup$
                                – Green.H
                                Jun 18 '18 at 16:19














                              -2












                              -2








                              -2





                              $begingroup$

                              You will use this password to access your account. Enter a combination of at least six numbers, letter and punctuation marks.






                              share|cite|improve this answer









                              $endgroup$



                              You will use this password to access your account. Enter a combination of at least six numbers, letter and punctuation marks.







                              share|cite|improve this answer












                              share|cite|improve this answer



                              share|cite|improve this answer










                              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


















                              • $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


















                              draft saved

                              draft discarded




















































                              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.




                              draft saved


                              draft discarded














                              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





















































                              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







                              Popular posts from this blog

                              Wiesbaden

                              Marschland

                              Dieringhausen