Counting using recursion (intro) - Discrete Math
- The Catalan numbers satisfy and for . These count the number of ways to parenthesize a product of factors. What is ? Answer: 5 Catalan numbers appear frequently in combinatorics problems involving recursive structures like parenthesizations, binary trees, and path counting. When you see the recurrence relation , think about how it breaks down a problem into smaller subproblems. To find , you need to work systematically from the base case. Given , let's calculate step by step: For : For : For : You can verify this by listing all parenthesizations of four factors : , , , , and — exactly 5 ways. Choice A (3) likely comes from miscounting or confusing with . Choice B (4) might result from forgetting one term in the sum or confusing this with the number of factors minus one. Choice C (6) could come from incorrectly applying factorial thinking or overcounting parenthesizations. When working with Catalan numbers, always build up from smaller values systematically. The recurrence relation captures how each parenthesization splits the expression at different points, making each term represent splitting after the -th factor.
- Let be the number of binary strings of length that contain no three consecutive 1's. If , , and , what is ? Answer: 44 A valid string of length can end in 0 (giving possibilities), end in 01 (giving possibilities), or end in 011 (giving possibilities). This yields . Computing: , , . Choice B miscounts by including some invalid strings. Choice C uses an incorrect recurrence. Choice D counts all binary strings without the restriction.
- Let denote the number of ways to partition a set of elements into exactly non-empty subsets (Stirling numbers of the second kind). The recursion is . Given , what is ? Answer: 7 When you encounter Stirling numbers of the second kind, you're dealing with partitions of sets into non-empty subsets. The recursion captures two ways to place the nth element: either add it to one of the existing k partitions, or create a new partition containing just that element. To find , apply the recursion: . You're given that . For , there's only one way to put all 3 elements into 1 subset, so . Therefore: . Looking at the wrong answers: Choice A (8) likely comes from incorrectly calculating , misremembering the recursion formula. Choice B (6) results from forgetting the term entirely and computing . Choice D (9) might arise from incorrectly using , perhaps confusing this with a different combinatorial formula. The correct answer is C (7). Study tip: Always write out the recursion formula explicitly and identify all needed base cases before substituting values. Stirling number problems often involve multiple recursive steps, so organize your work clearly to avoid arithmetic errors and ensure you're applying the correct formula.
- A sequence counts the number of binary strings of length that do not contain two consecutive 1's. Given that , , and , what is ? Answer: 13 The recursion is for . A valid string of length either ends in 0 (any valid string of length followed by 0) or ends in 01 (any valid string of length followed by 01). Computing: , , . Choice A (11) incorrectly uses , choice C (16) doubles , and choice D (21) is .
- Let count the number of ways to arrange distinct books on a shelf such that no book is in its original position (derangements). Given the recursion and , , what is ? Answer: 9 When you encounter a recursion problem about derangements, you're working with a fundamental counting principle where each term depends on previous terms. The key is to apply the given formula systematically, using the provided base cases. Given the recursion with and , you need to build up to step by step. First, find : Then calculate : Therefore, , which is answer choice D. Looking at the wrong answers: Choice A (6) likely comes from incorrectly computing and then getting , but making an arithmetic error to reach 6. Choice B (8) might result from forgetting the factor of and calculating with some assumed value. Choice C (11) could come from misapplying the recursion formula, perhaps adding the factor incorrectly as . When solving recursion problems, always work methodically from the base cases upward, double-check your arithmetic at each step, and make sure you're applying the exact formula given—don't try to shortcut or modify the recursion relation.
- A sequence counts the number of subsets of that contain no two consecutive integers. Given and , and the recursion for , what is ? Answer: 8 When you encounter problems about counting subsets with restrictions, think about how each new element affects your existing valid subsets. This is a classic application of recurrence relations in combinatorics. To find , you need to understand why the recursion works. When building valid subsets of , you have two cases: either include element or don't. If you don't include , you can use any valid subset of , giving you possibilities. If you do include , you cannot include (no consecutive integers), so you can only use valid subsets of , giving you possibilities. Now calculate step by step: - (just the empty set) - (empty set and ) - - - The answer is C) 8. Option A) 7 might come from miscounting or making an arithmetic error. Option B) 13 could result from incorrectly applying the recursion or confusing this with a different counting problem. Option D) 5 is actually , suggesting you stopped one step too early. Study tip: With recurrence relations, always write out several terms carefully. The Fibonacci-like pattern here appears frequently in combinatorics problems involving restrictions.
- The Tribonacci sequence satisfies , , , and for . A modified version counts only those sequences where is even. Let if is even, 0 otherwise. What is ? Answer: 2 First compute the Tribonacci sequence: (odd), (odd), (even), (even), (odd), (odd). So , , , , , . Therefore . Choice A miscounts parity, choice C counts all positive terms, choice D only counts one even term.
- Let be the number of ways to tile a rectangle using dominoes (which can be placed horizontally or vertically). Given that and , what is ? Answer: 13 To tile a rectangle, we can either place a vertical domino in the last column (leaving a rectangle) or place two horizontal dominoes in the last two columns (leaving a rectangle). This gives us the recurrence . Starting with and , we get , , , and . Choice A gives . Choice C is . Choice D is .
- Let represent the number of ways to tile a rectangle using dominoes. If and , what is the value of ? Answer: 13 The recursive relation is for . To tile a rectangle, we can either place a vertical domino at the end (leaving a rectangle) or place two horizontal dominoes at the end (leaving a rectangle). Computing: , , , . Choice B (21) is , choice C (8) is , and choice D (34) is .
- Let count the number of ways to write as an ordered sum of positive integers where each term is either 1 or a prime number. For example, since . What is ? Answer: 20 We use the recurrence . Computing step by step: , , , , , . Then (using primes 2, 3, 5). Choice A undercounts by missing some compositions. Choice B uses an incorrect set of allowed terms. Choice D overcounts by including composite numbers.
- Consider sequences of length using the symbols A, B, C where no two consecutive symbols are the same, and the sequence cannot start with C. Let denote the number of such sequences. If and , what is ? Answer: 36 Let be sequences ending in A, ending in B, ending in C. Then , , , with . Computing: , , . Choice A ignores the restriction on starting with C. Choice C uses an incorrect recurrence relation. Choice D counts sequences that can start with any symbol.
- Let be the number of ways to climb stairs if you can take 1, 2, or 3 steps at a time. If , , and , what is ? Answer: 24 The recursion is for . To reach stair , you can come from stair (1 step), (2 steps), or (3 steps). Computing: , , . Choice B (13) is , choice C (7) is , and choice D (44) is .