Professional Documents
Culture Documents
permutation?
Combination:
Is the selection of a group of items/objects where order does NOT matter:
Permutation:
Is the selection of a group of items/objects where order DOES matter.
The following example show two permutations (all contain letters A to E, but in
different order):
A, B, C, D, E
E, D, C, B, A
Questions
Is a “combination lock” a permutation or combination?
The name “combination” is incorrect for this object because it actually
implements permutation!
- Lock-A has a “combination” of: 10 25 55
- Lock-B has a “combination” of: 25 10 55
The reason these are different from one another is because ORDER matters, so
this applies permutation logic!
If you are indifferent between these two paths are these routes an example of a
permutation or a combination?
Are the characters in a password a combination or a permutation?
Sol’n: permutation because it matters which order you enter the characters in.]
[These are important because they lead to many states, and in order to get to the right one you have to
program many different conditions]
“Selection”
i.e., apply logic based on one or more conditions.
When combinations and permutations drive the application logic, it will usually
contribute and/or mandate an intensive number of unavoidable selection
routines