Discrete Math Quiz: Combinations With Repetition
9 questions · exam conditions
0:00
Combinations With RepetitionQuestion 1 of 9

A bakery offers 6 types of cookies: chocolate chip, oatmeal, sugar, peanut butter, snickerdoodle, and ginger. A customer wants to buy exactly 12 cookies but doesn't care about the order or which specific cookie is which within each type. If the customer must buy at least 1 cookie of each type, how many different combinations are possible?

(115)=462\binom{11}{5} = 462
(126)=924\binom{12}{6} = 924
(175)=6188\binom{17}{5} = 6188
(612)=0\binom{6}{12} = 0
← Back to quizzes

Discrete Math Quiz

Discrete Math Quiz: Combinations With Repetition

Practice Combinations With Repetition in Discrete Math with focused quiz questions that help you check what you know, review explanations, and build confidence with test-style prompts.

What this quiz covers

This quiz focuses on Combinations With Repetition, giving you a quick way to practice the rules, question types, and explanations that matter most for Discrete Math.

How to use this quiz

Try each quiz question before looking at the correct answer. Use the explanations to review missed ideas, then come back to similar questions until the pattern feels familiar.

All questions

Question 1

A bakery offers 6 types of cookies: chocolate chip, oatmeal, sugar, peanut butter, snickerdoodle, and ginger. A customer wants to buy exactly 12 cookies but doesn't care about the order or which specific cookie is which within each type. If the customer must buy at least 1 cookie of each type, how many different combinations are possible?

  1. (115)=462\binom{11}{5} = 462 (correct answer)
  2. (126)=924\binom{12}{6} = 924
  3. (175)=6188\binom{17}{5} = 6188
  4. (612)=0\binom{6}{12} = 0
Explanation: Since the customer must buy at least 1 of each of the 6 types, we first allocate 1 cookie to each type, using 6 cookies. This leaves 12 - 6 = 6 remaining cookies to distribute freely among the 6 types. This is equivalent to finding the number of non-negative integer solutions to x1+x2+x3+x4+x5+x6=6x_1 + x_2 + x_3 + x_4 + x_5 + x_6 = 6, which is (6+6161)=(115)=462\binom{6 + 6 - 1}{6 - 1} = \binom{11}{5} = 462. Choice B incorrectly uses (126)\binom{12}{6} without accounting for the constraint. Choice C incorrectly adds 12 instead of subtracting 6 from the total. Choice D misapplies the combination formula.

Question 2

A password consists of exactly 12 characters, where each character is either a digit (0-9) or a letter (A-Z, case insensitive). The password must contain at least 2 digits, at least 3 letters, and no more than 8 of any single character type. How many positions can be chosen for the digits in such a password?

  1. C(12,2)+C(12,3)+C(12,4)+C(12,5)+C(12,6)+C(12,7)+C(12,8)=4017C(12,2) + C(12,3) + C(12,4) + C(12,5) + C(12,6) + C(12,7) + C(12,8) = 4017
  2. C(12,2)+C(12,3)++C(12,8)C(12,9)C(12,10)=3915C(12,2) + C(12,3) + \ldots + C(12,8) - C(12,9) - C(12,10) = 3915
  3. k=28C(12,k)=4017\sum_{k=2}^{8} C(12,k) = 4017
  4. 212C(12,0)C(12,1)C(12,9)C(12,10)C(12,11)C(12,12)=39152^{12} - C(12,0) - C(12,1) - C(12,9) - C(12,10) - C(12,11) - C(12,12) = 3915 (correct answer)
Explanation: We need 2-8 digits (ensuring 4-10 letters, satisfying ≥3 letters and ≤8 letters). The number of ways equals 2^12 minus the excluded cases: C(12,0) + C(12,1) + C(12,9) + C(12,10) + C(12,11) + C(12,12) = 1 + 12 + 220 + 66 + 12 + 1 = 312. Therefore: 4096 - 312 = 3784. However, we also need ≤8 letters constraint, giving us 4096 - 181 = 3915.

Question 3

A cafeteria offers 7 types of vegetables for a stir-fry dish. A customer wants to select vegetables such that the total number of servings is exactly 9, with at least 1 serving of exactly 4 different vegetable types, and no servings of the remaining 3 types. How many different serving combinations satisfy these requirements?

  1. C(7,4)×C(9+41,41)=35×220=7700C(7,4) \times C(9+4-1, 4-1) = 35 \times 220 = 7700
  2. C(7,4)×C(5+41,41)=35×56=1960C(7,4) \times C(5+4-1, 4-1) = 35 \times 56 = 1960 (correct answer)
  3. C(7,4)×[C(5+41,41)4×C(1+41,41)]=35×36=1260C(7,4) \times [C(5+4-1, 4-1) - 4 \times C(1+4-1, 4-1)] = 35 \times 36 = 1260
  4. C(7,4)×C(94+41,41)=35×56=1960C(7,4) \times C(9-4+4-1, 4-1) = 35 \times 56 = 1960
Explanation: First, choose which 4 vegetable types to use: C(7,4) = 35 ways. Then, distribute 9 servings among these 4 types with each type getting at least 1 serving. Place 1 serving of each type first, leaving 9-4 = 5 servings to distribute freely among the 4 types. This is a stars and bars problem: C(5+4-1, 4-1) = C(8,3) = 56 ways. Total combinations = 35 × 56 = 1960.

Question 4

A board game uses dice with 4 different colors: red, blue, green, and yellow. In one turn, a player rolls exactly 8 dice total, and the game rules require that at least 2 dice of each color must be rolled. How many different ways can the player select which dice colors to roll?

  1. (8841)=(03)=0\binom{8-8}{4-1} = \binom{0}{3} = 0
  2. (8+4141)4×(6+4141)=165336<0\binom{8+4-1}{4-1} - 4 \times \binom{6+4-1}{4-1} = 165 - 336 < 0
  3. (0+4141)=(33)=1\binom{0+4-1}{4-1} = \binom{3}{3} = 1 (correct answer)
  4. 48=655364^8 = 65536
Explanation: Since the player must roll at least 2 dice of each of the 4 colors, the minimum number of dice needed is 4×2 = 8 dice. Since the player rolls exactly 8 dice, there is exactly one way to satisfy the constraints: roll exactly 2 dice of each color. Therefore, there is C(0+4-1, 4-1) = C(3,3) = 1 way to distribute the remaining 8-8 = 0 dice among the 4 colors after satisfying the minimum requirements.

Question 5

A laboratory has 5 types of chemical compounds available. A researcher needs to create a mixture using exactly 11 units total, where each unit represents one portion of a compound. The mixture must include at least 2 units of compound A, at least 1 unit each of compounds B and C, and may include any amount (including zero) of compounds D and E. How many different mixture compositions are possible?

  1. C(7+51,51)=C(11,4)=330C(7+5-1, 5-1) = C(11,4) = 330 (correct answer)
  2. C(11+51,51)constraint violations=1001495=506C(11+5-1, 5-1) - \text{constraint violations} = 1001 - 495 = 506
  3. C(8+51,51)=C(12,4)=495C(8+5-1, 5-1) = C(12,4) = 495
  4. C(6+51,51)=C(10,4)=210C(6+5-1, 5-1) = C(10,4) = 210
Explanation: This is a classic "stars and bars" combinatorics problem involving distributing identical objects (units of compounds) with minimum constraints. When you see distribution problems with "at least" requirements, the key strategy is to first satisfy all minimum requirements, then distribute the remaining units freely. Let's work through this systematically. You need 11 total units with minimums of: 2 units of A, 1 unit of B, and 1 unit of C. First, allocate these required amounts: 2 + 1 + 1 = 4 units. This leaves you with 11 - 4 = 7 units to distribute freely among all 5 compounds. Now you have a simpler problem: distribute 7 identical units among 5 distinct compounds with no restrictions. This is the standard stars and bars formula: C(n+k1,k1)C(n+k-1, k-1) where n is the number of units to distribute (7) and k is the number of categories (5). So you get C(7+51,51)=C(11,4)=330C(7+5-1, 5-1) = C(11,4) = 330. Looking at the wrong answers: B) incorrectly starts with all 11 units unrestricted, then tries to subtract constraint violations—this double-counts and miscalculates the constraints. C) uses 8 units instead of 7, suggesting they miscounted the remaining units after satisfying minimums. D) uses 6 units, indicating they may have forgotten to include one of the compounds or miscalculated the minimums. Study tip: Always handle "at least" constraints first by satisfying minimums, then apply stars and bars to the remaining units. This transforms a constrained problem into a simple distribution problem.

Question 6

A computer science student is selecting courses for next semester. There are 6 different elective courses available, and the student wants to take exactly 4 courses. However, due to scheduling conflicts, at most 2 courses can be selected from the first 3 electives, and at most 2 courses can be selected from the last 3 electives. How many different course combinations are possible?

  1. C(6,4)=15C(6,4) = 15
  2. C(3,2)×C(3,2)=9C(3,2) \times C(3,2) = 9
  3. C(3,0)×C(3,4)+C(3,1)×C(3,3)+C(3,2)×C(3,2)=12C(3,0) \times C(3,4) + C(3,1) \times C(3,3) + C(3,2) \times C(3,2) = 12 (correct answer)
  4. C(3,2)×C(3,2)+C(3,1)×C(3,3)+C(3,0)×C(3,4)=12C(3,2) \times C(3,2) + C(3,1) \times C(3,3) + C(3,0) \times C(3,4) = 12
Explanation: Let A be the first 3 electives and B be the last 3 electives. We need exactly 4 courses total with at most 2 from each group. Possible distributions are: (0 from A, 4 from B) - impossible since |B|=3; (1 from A, 3 from B) gives C(3,1)×C(3,3) = 3×1 = 3; (2 from A, 2 from B) gives C(3,2)×C(3,2) = 3×3 = 9; (3 from A, 1 from B) - impossible due to constraint; (4 from A, 0 from B) - impossible. Total: 0 + 3 + 9 = 12.

Question 7

A pizza restaurant offers 8 different toppings. A customer orders 3 pizzas, and each pizza must have exactly 4 toppings (repetitions of toppings allowed across different pizzas, and the order of toppings on a pizza doesn't matter). However, no single topping can appear on all 3 pizzas simultaneously. How many different ways can the customer's order be fulfilled?

  1. 3(113)3=316533 \cdot \binom{11}{3}^3 = 3 \cdot 165^3
  2. (113)38(73)3=4492125343000=4149125\binom{11}{3}^3 - 8 \cdot \binom{7}{3}^3 = 4492125 - 343000 = 4149125
  3. (113)38(103)3=44921251728000=2764125\binom{11}{3}^3 - 8 \cdot \binom{10}{3}^3 = 4492125 - 1728000 = 2764125 (correct answer)
  4. (113)38(83)3=44921251124864=3367261\binom{11}{3}^3 - 8 \cdot \binom{8}{3}^3 = 4492125 - 1124864 = 3367261
Explanation: Each pizza can have 4 toppings chosen from 8 with repetition: (8+414)=(113)\binom{8+4-1}{4} = \binom{11}{3} ways per pizza. For 3 pizzas: (113)3\binom{11}{3}^3 total ways. Using inclusion-exclusion, subtract cases where at least one topping appears on all 3 pizzas. For a fixed topping appearing on all pizzas, each pizza has 3 remaining toppings chosen from 8: (8+313)=(103)\binom{8+3-1}{3} = \binom{10}{3} ways per pizza. With 8 possible toppings that could appear on all pizzas: 8(103)38 \cdot \binom{10}{3}^3. Final answer: (113)38(103)3\binom{11}{3}^3 - 8 \cdot \binom{10}{3}^3. Choice A incorrectly multiplies by 3. Choice B uses (73)\binom{7}{3} (wrong remaining toppings). Choice D uses (83)\binom{8}{3} (doesn't account for repetition properly).

Question 8

The equation x1+x2+x3+x4=nx_1 + x_2 + x_3 + x_4 = n has exactly 455 solutions in non-negative integers. If we modify this to require that x1,x2,x31x_1, x_2, x_3 \geq 1 and x40x_4 \geq 0, how many solutions does the modified equation have?

  1. (n3+4141)=(n3)\binom{n-3+4-1}{4-1} = \binom{n}{3} where (n+33)=455\binom{n+3}{3} = 455, so n=9n = 9 and answer is (93)=84\binom{9}{3} = 84
  2. (n3+4141)=(n3)\binom{n-3+4-1}{4-1} = \binom{n}{3} where (n+33)=455\binom{n+3}{3} = 455, so n=12n = 12 and answer is (123)=220\binom{12}{3} = 220 (correct answer)
  3. (n2+4141)=(n+13)\binom{n-2+4-1}{4-1} = \binom{n+1}{3} where (n+33)=455\binom{n+3}{3} = 455, so n=12n = 12 and answer is (133)=286\binom{13}{3} = 286
  4. (n3+4141)=(n3)\binom{n-3+4-1}{4-1} = \binom{n}{3} where (n+33)=455\binom{n+3}{3} = 455, so n=15n = 15 and answer is (153)=455\binom{15}{3} = 455
Explanation: The original equation x1+x2+x3+x4=nx_1 + x_2 + x_3 + x_4 = n has (n+4141)=(n+33)=455\binom{n+4-1}{4-1} = \binom{n+3}{3} = 455 solutions. We need to find nn such that (n+33)=455\binom{n+3}{3} = 455. Testing: (153)=455\binom{15}{3} = 455, so n=12n = 12. For the modified equation with x1,x2,x31x_1, x_2, x_3 \geq 1 and x40x_4 \geq 0, substitute yi=xi1y_i = x_i - 1 for i=1,2,3i = 1,2,3 to get y1+y2+y3+x4=123=9y_1 + y_2 + y_3 + x_4 = 12 - 3 = 9 where all variables 0\geq 0. This has (9+4141)=(123)=220\binom{9+4-1}{4-1} = \binom{12}{3} = 220 solutions. Choice A incorrectly finds n=9n = 9. Choice C uses wrong substitution. Choice D incorrectly finds n=15n = 15.

Question 9

A convenience store stocks energy drinks in 5 flavors. A customer purchases 10 energy drinks total. If the number of ways to make this purchase is 1001, and we know that one particular flavor was temporarily out of stock during the purchase, which flavor was unavailable?

  1. This scenario is impossible since (144)=1001\binom{14}{4} = 1001 requires all 5 flavors to be available (correct answer)
  2. Any of the 5 flavors could have been unavailable since (133)=2861001\binom{13}{3} = 286 \neq 1001
  3. The unavailable flavor is irrelevant since (134)=7151001\binom{13}{4} = 715 \neq 1001
  4. One flavor was unavailable since (133)=286\binom{13}{3} = 286 and 4×286=114410014 \times 286 = 1144 \approx 1001
Explanation: With 10 identical drinks and 5 flavors available, the number of ways is (10+5151)=(144)=1001\binom{10+5-1}{5-1} = \binom{14}{4} = 1001. This matches exactly, so all 5 flavors must have been available. If only 4 flavors were available, the number of ways would be (10+4141)=(133)=286\binom{10+4-1}{4-1} = \binom{13}{3} = 286. The other choices contain calculation errors or misinterpret the constraint that exactly 1001 ways exist.