How to figure out number of combinations given a sequence length and number of possible values per item

165 Views Asked by At

If you have 100 keys on a keyboard, and you are typing 5-letter long sequences, the question is how many unique sequences you can enter.

More generally, if you have n atomic values, and m-item long sequences, wondering how many m-item long sequences you can have.

Also, if you have 5-letter-long max sequences, and yet take into account the 1-, 2-, 3-, and 4-letter sequences as well, how many there are.

1

There are 1 best solutions below

1
On BEST ANSWER

You need the rule of product or multiplication principle. If you have $a$ choices for the first event and for each of them $b$ choices for the second, you have $ab$ choices for the two events. In your case you have $100$ choices for each event, so for two letter strings you would have $100^2$ choices.