Sub topic 10
Counting and Probability: Order, Repeats, and "At Least"
This chapter assumes you know factorials, the basic counting rule (multiply the choices at each step), and the probability formula favorable ÷ total. Counting and probability questions on the GRE Quant section punish small misreadings. A correct formula applied to the wrong situation gives a clean-looking wrong answer, and that answer is usually one of the choices.
Each trap here comes from one of three questions you skipped: does order matter, can items repeat or be identical, and is it easier to count the opposite?
Trap 1: Order matters, or it does not
Choosing a committee is a combination, because the group {Ana, Ben} is the same as {Ben, Ana}. Choosing a president and a treasurer is a permutation, because the two roles make the order count.
- Permutations of r items from n: n! / (n − r)!
- Combinations of r items from n: n! / (r! (n − r)!)
A permutation count is always r! times the matching combination count.
import math
# Choose 2 people from 5
print(math.comb(5, 2)) # 10 (committee, order ignored)
print(math.perm(5, 2)) # 20 (president and treasurer, order counts)
print(math.perm(5, 2) == math.comb(5, 2) * math.factorial(2)) # TrueTo decide which one applies, swap two chosen items in your head. If the result is a different outcome, order matters. If the question gives the chosen items different jobs, such as "first, second, third place" or "captain and co-captain," order matters.
Trap 2: Repeats and identical items
Two different things get called "repeats," and they need different fixes.
Identical items in an arrangement. If some letters are the same, swapping them does not create a new word. Divide by the factorial of each repeated count. The word BOOK has 4 letters with O appearing twice, so the count is 4! / 2! = 12, not 24.
from itertools import permutations
import math
word = "BOOK"
distinct = set(permutations(word))
print(len(distinct)) # 12
print(math.factorial(4) // math.factorial(2)) # 12For MISSISSIPPI (11 letters: I four times, S four times, P twice, M once), the count is 11! / (4! · 4! · 2!) = 34,650.
Repeated choices. If a code has 3 digits and each digit may be any of 0–9, there are 10 × 10 × 10 = 1,000 codes. If digits may not repeat, there are 10 × 9 × 8 = 720. Look for "distinct," "different," "without repetition," or "with replacement" to tell which case you have.
| Situation | Count |
|---|---|
| 3-digit code, repeats allowed | 10³ = 1,000 |
| 3-digit code, all digits different | 10 × 9 × 8 = 720 |
| 3-digit number, first digit not 0, repeats allowed | 9 × 10 × 10 = 900 |
| Arrangements of BOOK | 4! / 2! = 12 |
The third row shows a related trap. A restriction on one position should be handled first, because it changes the number of choices for that slot.
Trap 3: "At least" means use the complement
"At least one" covers every outcome except "none." Adding up the cases "exactly 1," "exactly 2," and so on is slow and error-prone. Subtract the "none" case from 1 instead.
Example: a fair die is rolled 4 times. What is the probability of at least one 6?
- P(no 6 on one roll) = 5/6
- P(no 6 in four rolls) = (5/6)⁴, since rolls are independent
- P(at least one 6) = 1 − (5/6)⁴ ≈ 0.518
from itertools import product
from fractions import Fraction
# Exact check by listing all 6**4 outcomes
outcomes = list(product(range(1, 7), repeat=4))
hits = sum(1 for o in outcomes if 6 in o)
print(Fraction(hits, len(outcomes))) # 671/1296
print(1 - Fraction(5, 6) ** 4) # 671/1296
print(round(671 / 1296, 3)) # 0.518The same idea works for counting. The number of 3-person committees from 8 people (5 men, 3 women) with at least one woman is C(8,3) − C(5,3) = 56 − 10 = 46.
Trap 4: Probability errors
Replacement changes the denominator
Drawing two marbles from a bag of 5 red and 3 blue changes the answer depending on whether the first marble goes back.
from fractions import Fraction
# Both red
without = Fraction(5, 8) * Fraction(4, 7)
with_repl = Fraction(5, 8) * Fraction(5, 8)
print(without, float(without)) # 5/14 0.357...
print(with_repl, float(with_repl)) # 25/64 0.390...Without replacement, both the numerator and denominator drop by 1 for the second draw. If the stem does not say "replaced" or "returned," assume it is not.
"Or" needs the overlap removed
For a fair die, what is the probability of rolling an even number or a number greater than 3? Adding 3/6 + 3/6 = 1 is wrong, because 4 and 6 were counted twice.
from fractions import Fraction
faces = range(1, 7)
event = [f for f in faces if f % 2 == 0 or f > 3]
print(event) # [2, 4, 5, 6]
print(Fraction(len(event), 6)) # 2/3The rule is P(A or B) = P(A) + P(B) − P(A and B). Add directly only when the events cannot happen together, such as rolling a 1 or a 2.
"And" multiplies only for independent events
Multiply for "and" when the first outcome does not change the second. Draws without replacement are dependent, so use the updated numbers for the second event, as in the marble example.
Ordered versus unordered outcomes
Two coin flips with exactly one head can happen as HT or TH, so the probability is 2/4, not 1/3. Do not treat "one head, one tail" as a single outcome unless you count it as a combination of equally likely arrangements. When in doubt, list the equally likely ordered outcomes.
A decision path
Quick check routine for these questions
- Underline the words that set order, repeats, replacement, and "at least."
- Write the type of question (arrangement, selection, or probability) in your scratch work before any numbers.
- Test the method on a tiny version of the problem, such as 3 items instead of 10, and count by listing.
- Check that a probability is between 0 and 1 and that a count is a whole number.
- Confirm that your answer is for the quantity asked, not its complement.
The tiny-case test is the most useful. If your formula gives 6 for a case where you can list 3 outcomes, you have double-counted order or identical items.
Common errors summarized
| Mistake | Why it happens | Fix |
|---|---|---|
| Using n! / (n − r)! for a committee | Order was ignored in the stem | Divide by r! |
| Counting BOOK as 24 arrangements | Identical letters treated as different | Divide by 2! |
| Adding "exactly" cases for "at least" | Many cases, easy to miss one | Use 1 − P(none) |
| P(A) + P(B) for "or" | Overlap counted twice | Subtract P(A and B) |
| Same denominator for the second draw | Missed "without replacement" | Reduce the total by 1 |
| Stopping at P(none) | Forgot to subtract from 1 | Reread what the question asks for |
Exercise
A club has 6 members. In how many ways can it (a) pick a president and a treasurer, and (b) pick a 2-person planning committee?
Show answer
(a) Order matters because the roles differ: 6 × 5 = 30. (b) Order does not matter: 30 / 2! = C(6,2) = 15.
Exercise
A family has 3 children, and each child is equally likely to be a boy or a girl. What is the probability that at least one is a girl?
Show answer
Use the complement. P(all boys) = (1/2)³ = 1/8, so P(at least one girl) = 1 − 1/8 = 7/8.
Exercise
A bag has 4 red and 6 blue marbles. Two are drawn without replacement. What is the probability that the two marbles are different colors?
Show answer
Two ordered cases are possible. Red then blue: (4/10)(6/9) = 24/90. Blue then red: (6/10)(4/9) = 24/90. The total is 48/90 = 8/15.