A bank when you sign in asks for a Userid and a Password and when accepted asks for 3 characters from a previously registered memorable word. The numbers of the characters are always in ascending order. Example 1,4,7 or 5,6,7 but never 1,7,4 or 5,7,6. Research has found the normal formula P(N,k) = N!/(N-k)! but this does not cater for the ordering of the resulting sequence of numbers. My question is how can this catered for? I have iterated the list for 3 from 8, 3 from 9, 3 from 10 and 3 from 11 and get the answers 56, 84, 120, 162.
Asked
Active
Viewed 26 times
0
-
1You want combinations, not permutations. Look for $C(n,k)$ instead of $P(n,k)$. – saulspatz Jul 04 '18 at 15:22
-
2You should specify that the numbers must be distinct (the values you give make it clear that you are requiring that). – lulu Jul 04 '18 at 15:23
-
1You just want a selection of $3$ characters in which there is only one arrangement that's ascending, But $P(N, k)$ also arranges characters – ab123 Jul 04 '18 at 15:25
-
1As an aside, $\binom{8}{3}=56,\binom{9}{3}=84,\binom{10}{3}=120,\binom{11}{3}=16\color{red}{5}$ (not 162). See more uses of the binomial coefficient at wikipedia. – JMoravitz Jul 04 '18 at 15:34
1 Answers
0
You are looking for combinations instead of permutations. $$ C(n,k) = \frac{n!}{k!(n-k)!} $$
Tim Dikland
- 504
-
@JMoravitz Thanks that explains I could not get the formula to work . My error. – MacNala Jul 04 '18 at 17:26