what | description |
---|---|
combination |
In mathematics, a combination is a selection of items
(from a set) where
the order in which the objects are selected does not matter.
For example, given three letters (A,B,C), there are three
combinations of two that can be drawn from this set:
(A,B), (A,C), and (B,C). (Note: A,B is the same as B,A) |
factorial |
In mathematics, the factorial of a non-negative integer
n,
denoted by n!, is the product of all positive integers
less than or equal to n. For example: 5! = 1*2*3*4*5 |
permutation |
In mathematics, a permutation is a selection of items
(from a set) where
the order in which the objects are selected does matter.
For example, there are six permutations (orderings) of the set {A,B,C}: written as tuples, they are (A,B,C), (A,C,B), (B,A,C), (B,C,A), (C,A,B), and (C,B,A). |
set | A set is a collection of distinct, well-defined objects. |
Check out
from itertools import permutations, combinations_with_replacement
Create an interactive program
Modify the program created in Project #1. Ask the user if they want to see the intermediate steps?
For example if factorial, display something like...
If the output is to big, display the first n (n < 10?) and maybe the last one.
Describe what "sampling with and without replacement" means. Which of the above definitions describe "with" and "without"?
Which of the above definitions describe dealing a set of random (shuffled) cards (52)? How many different hands are there when dealing 5 cards?
Combination (Wikipedia)
Permutation (Wikipedia)
Factorial (Wikipedia)