Combination
A combination is a selection of elements in which the order of selection does not matter.
Statistics Every Programmer Needs
A combination is a selection of items in which order does not matter.
- How it is used
- Uses order-independent selection to structure counting and probability calculations.
- How deep it goes
- Explains order, replacement conditions, formulas, Pascal’s triangle, and Python implementations through worked small examples.
- Examples
- Uses a basketball lineup, Pascal’s triangle, and Python calculations with n = 5 and r = 3.
- What you can do after
- Apply it via Python’s math module to count order-independent selections with or without replacement.
Read how Statistics Every Programmer Needs explains combination →
Fabulous Adventures in Data Structures and Algorithms
A combination is a subsequence or subset selected from a sequence without changing the original element order.
- How it is used
- Uses combinations to generate cases where sequence items are skipped and to select items from arbitrary lists through their indices.
- How deep it goes
- Develops mutable and recursive enumeration, counting identities, an iterative Choose implementation, and direct retrieval by position.
- Examples
- Works through ABCDE with k = 3, selecting foods by index, and advancing the four-index combination 1245 to 0345.
- What you can do after
- Build it from scratch: enumerate combinations, count them with Choose, or retrieve one directly by its position.
Read how Fabulous Adventures in Data Structures and Algorithms explains combination →
Statistics Slam Dunk
A combination is a selection of objects or values in which the order of the selected elements does not matter.
- How it is used
- Frames combinations as a classification step before counting possibilities or analyzing NBA scheduling data.
- How deep it goes
- Defines order-independent selection and contrasts it with permutations, but does not develop a combination-counting formula.
- Examples
- Uses a Warriors starting lineup, locker numbers, division standings, and NBA teams’ prior days off.
- What you can do after
- Evaluate whether a counting problem requires combinations or permutations before computing it in R.
Related concepts
- permutationcontrasts with · A permutation is a bijective rearrangement of the elements of a finite set, equivalently an ordering in which each element appears exactly once.
- binary stringalternative to · A binary string is a finite, ordered sequence of binary digits, each having the value zero or one.
- binomial coefficientequivalent to · A binomial coefficient is the number of ways to select a specified number of elements from a finite set, without regard to order.
- combination with replacementincludes · A combination with replacement is a selection in which order does not matter and selected items may be selected again.
- combination without replacementincludes · A combination without replacement is a selection in which order does not matter and selected items cannot be selected again.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


