How many ways can we arrange a set of numbers ?
Say take two numbers, we have two ways. 12 and 21.
Say take three numbers, we have six ways. 123, 132, 231,213,321,312.
Say take four numbers, we have twenty four ways.
1234,1243, 1324, 1342, 1423,1432
2134, 2143, 2314, 2341, 2431, 2413
3124, 3142, 3214, 3241, 3412, 3421
4123, 4132, 4213, 4231, 4312, 4321
So formula for writing a given set in all possible arrangements is n! where n is the number of elements in the set.
I will write pseudo code this all together.
6 thoughts on “66: Arrangements”
I love that you have started on permutations!!! Can you explain what n! means?
n!=n*n-1*n-2*n-3…..*2*1.
4!=4*3*2*1=24
Sigma is decrementing and adding upto 1.
This is really cool. What if n=0?
0! =1 because every thing will have at least one way of arrangement. Am I right ?
Yes!!
I didn’t teach my students permutations until 7th grade. So happy to see you have a crack at it already. Keep it up.