Answer the question
In order to leave comments, you need to log in
How many non-repeating combinations of numbers 1,2,3,4,5,6,7,8 will be four digits in a combination?
For example,
1234
5678
1258
1358
1458
Answer the question
In order to leave comments, you need to log in
What about thinking?
The first digit can be chosen in 8 ways (from 1 to 8), the second in 7 ways (from 1 to 8, excluding the first digit, as there are no repetitions), the third in 6 ways, and the fourth in 5 ways. In total, we get 8 * 7 * 6 * 5.
>>> import itertools
>>> four_numbers_combinations = list(itertools.permutations(eight_numbers_list, 4))
>>> len(four_numbers_combinations)
1680
>>> four_numbers_combinations[:10]
[(1, 2, 3, 4), (1, 2, 3, 5), (1, 2, 3, 6), (1, 2, 3, 7), (1, 2, 3, 8), (1, 2, 4, 3), (1, 2, 4, 5), (1, 2, 4, 6), (1, 2, 4, 7), (1, 2, 4, 8)]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question