2

離散数学のコースを取っているのですが、質問があり、あなたの助けが必要です。これが適切な場所かどうかはわかりませんが:)

それは言います:

コンピュータ システムの各ユーザーには、6 ~ 8 文字の長さのパスワードがあり、各文字は大文字または数字です。各パスワードには、少なくとも 1 つの数字が含まれている必要があります。可能なパスワードはいくつありますか?

この本では、6 文字、7 文字、8 文字の長さのパスワードを持つ確率を追加することで、これを解決しています。しかし、彼が6文字の確率を解くとき、彼はこれを行います

P6 = 36 6 - 26 6

そしてする

P7 = 36 7 - 26 7

P8 = 36 8 - 26 8

そしてそれらをすべて追加します。

私は解決策を理解していますが、私の質問は、なぜ計算しないのですか? 数字は10、英数字は36?

また、誰かが本にあるもの以外の別の解決策を教えてくれたら.

どうもありがとうございました :)

4

3 に答える 3

3

数字がどの位置にあってもよいことを忘れています。

于 2010-05-18T00:07:55.723 に答える
1

If you do it like 36^5 * 10, that means "take the first five positions and put some random letters/digits there and fill the sixth (and only the sixth) position with a digit" - but your digit can be in each place.

Consider the following: If you set 5 places with letters/digits, then putting a digit in the sixth place yields 10 possibilities (the sixth position can then hold every number from 0 to 9), and if you put the digit in front of the letters, this would yield another 10 possibilities (then, the first place could contain every digit from 0 to 9), so by multipliing by 10 you forget some possibilities.

If you want to calculate it "the raw way", you could do the following (I do it with six places, you can adapt it to 7 or 8). Since a password must contain at least one digit, it can hold 1, 2, 3, 4, 5 or 6 digits, resp 5, 4, 3, 2, 1 or 0 letters.

If you have k digits in 6 places in total, there are 6 over k possibilities to choose these k places. Each of these k places can be filled with a digit, so you have 10^k possibilities for the digits and 26^(6-k) possibilities for letters.

So, for k digits, you have 10^k * 26^(6-k) possibilities. Thus, since you can distribute the k digits in 6 over k ways, you have

sum(k from 1 to 5: (6 over k) * 10^k * 26^(6-k)) = 36^6-26^6

possibilities in total.

于 2010-05-18T14:40:59.413 に答える
1

私は解決策を理解していますが、私の質問は、なぜ計算しないのですか? 数字は10、英数字は36?

10 を使用して数字があることを保証していますが
、他の位置 (36
の選択肢) に数字があることを止めるものは何もないため、数字があるすべての櫛を取得し、すべてを減算する必要があります。
P6 = 36^6 - 26^6 につながるないもの

別の解決策があると思う場合は、この投稿を再検討しますが、今のところ、提供された解決策に満足できない理由がわかりません。なぜあなたの解決策が機能しないのかを知っています

于 2010-05-18T14:23:05.590 に答える