Difference between revisions of "Casework"
(less ambiguous phrasing) |
m (→Example 3) |
||
(23 intermediate revisions by 10 users not shown) | |||
Line 1: | Line 1: | ||
− | ''' | + | In [[combinatorics]], '''casework''' is a [[counting]] method that involves splitting a problem into several parts, counting these parts individually, then adding together the totals of each part. Casework is a very general problem-solving approach, and as such has wide applicability. |
== Examples == | == Examples == | ||
+ | Here are some examples that demonstrate casework in action. Unlike the selections in this article, most problems cannot be completely solved through casework. However, it is crucial as an intermediate step across all of mathematics, not just in competitions. | ||
− | + | While there are problems where casework produces the most elegant solution, in those where a shorter answer exists, casework may be considered [[brute force]]. This is especially true if that alternative solution uses [[complementary counting]]. | |
− | |||
− | |||
− | |||
− | === | + | === Example 1 === |
+ | ''How many words are less than four letters long and contain only the letters A, B, C, D, and E? Here, 'word' refers to any string of letters.'' | ||
− | * [[Combinatorics]] | + | '''Solution''': We divide the problem into cases, based on how long the word is. |
− | + | ||
+ | '''Case 1''': The word is one letter long. Clearly, there are <math>5</math> of these words. | ||
+ | |||
+ | '''Case 2''': The word is two letters long. [[Constructive counting | Constructing]] the set of these words, there are <math>5</math> options for the first letter and <math>5</math> options for the second letter, so there are <math>5^2 = 25</math> of these words. | ||
+ | |||
+ | '''Case 3''': The word is three letters long. By similar logic as above, we have <math>5</math> options for the first letter, <math>5</math> options for the second, and <math>5</math> options for the third. Then there are <math>5^3 = 125</math> of these letters. | ||
+ | |||
+ | Adding all our cases up, there are <math>5 + 25 + 125 = 155</math> words that are less than four letters long and contain only the letters A, B, C, D, and E. <math>\square</math> | ||
+ | |||
+ | === Example 2 === | ||
+ | ''How many positive integers satisfy the equation <math>x^4 + y < 70</math>?'' | ||
+ | |||
+ | '''Solution''': We use casework, based on the value of x. | ||
+ | |||
+ | '''Case 1''': <math>x=1</math>. Then this problem becomes <math>y<69</math>, so there are <math>68</math> possible values for <math>y</math>, and thus <math>68</math> solutions when <math>x</math> is one. | ||
+ | |||
+ | '''Case 2''': <math>x=2</math>. Then this problem becomes <math>y<54</math>, so there are <math>53</math> possible values for <math>y</math>, and thus <math>53</math> solutions when <math>x</math> is two. | ||
+ | |||
+ | If <math>x=3</math>, the problem becomes <math>y<-11</math>. But the question mandates that <math>y</math> is positive, so there are no solutions when <math>x \geq 3</math>. Thus, there are <math>68+53=121</math> positive integer solutions to the equation. <math>\square</math> | ||
+ | |||
+ | === Example 3 === | ||
+ | ''[[2004 AIME II Problems/Problem 4 | 2004 AIME II Problem 4]]: How many positive integers less than 10,000 have at most two different digits?'' | ||
+ | |||
+ | '''Solution''': Let <math>A</math> and <math>B</math> be the two digits of the number. Use casework, based on how many digits the number has. | ||
+ | |||
+ | '''Case 1''': The number is one digit. All numbers in this category satisfy the given condition, so there are <math>9</math> of these. | ||
+ | |||
+ | '''Case 2''': The number is two-digit. Again, all numbers in this category have two different digits, so there are <math>90</math> of these. | ||
+ | |||
+ | '''Case 3''': The number is three-digit. The possible cases in this category are <math>AAA, AAB, ABA,</math> and <math>BAA.</math> Using a constructive approach, there are <math>9</math> digits for what the first number can be, zero excluded to keep the number three-digit. The second digit can be <math>9</math> digits, with zero included and the first digit's number removed. Then there are <math>9 + 3 \cdot 81 = 252</math> of these numbers. | ||
+ | |||
+ | '''Case 4''': The number is four-digit. The possible cases in this category are <math>AAAA, AAAB, AABA, ABAA, BAAA, AABB, ABAB,</math> and <math>ABBA.</math> Using the same logic as before, the first digit has <math>9</math> options, as does the second. Then there are <math>9 + 7 \cdot 81 = 576</math> of these numbers. | ||
+ | |||
+ | Thus, there are <math>9 + 90 + 252 + 576 = 927</math> integers less than <math>10,000</math> that have at most two different digits. <math>\square</math> | ||
+ | |||
+ | === More examples === | ||
+ | * [https://artofproblemsolving.com/wiki/index.php/2005_AIME_I_Problems/Problem_5 2000 AIME 1 Problem 5] | ||
+ | |||
+ | == Resources == | ||
+ | * [https://artofproblemsolving.com/videos/counting/chapter2/186 AoPS Casework Counting Part 1] | ||
+ | * [https://artofproblemsolving.com/videos/counting/chapter2/187 AoPS Casework Counting Part 2] | ||
+ | |||
+ | == See also == | ||
+ | * [[Complementary counting]] | ||
+ | * [[Constructive counting]] | ||
+ | * [[Overcounting]] | ||
+ | |||
+ | [[Category:Combinatorics]] | ||
+ | [[Category:Definition]] |
Latest revision as of 16:40, 24 September 2024
In combinatorics, casework is a counting method that involves splitting a problem into several parts, counting these parts individually, then adding together the totals of each part. Casework is a very general problem-solving approach, and as such has wide applicability.
Contents
Examples
Here are some examples that demonstrate casework in action. Unlike the selections in this article, most problems cannot be completely solved through casework. However, it is crucial as an intermediate step across all of mathematics, not just in competitions.
While there are problems where casework produces the most elegant solution, in those where a shorter answer exists, casework may be considered brute force. This is especially true if that alternative solution uses complementary counting.
Example 1
How many words are less than four letters long and contain only the letters A, B, C, D, and E? Here, 'word' refers to any string of letters.
Solution: We divide the problem into cases, based on how long the word is.
Case 1: The word is one letter long. Clearly, there are of these words.
Case 2: The word is two letters long. Constructing the set of these words, there are options for the first letter and options for the second letter, so there are of these words.
Case 3: The word is three letters long. By similar logic as above, we have options for the first letter, options for the second, and options for the third. Then there are of these letters.
Adding all our cases up, there are words that are less than four letters long and contain only the letters A, B, C, D, and E.
Example 2
How many positive integers satisfy the equation ?
Solution: We use casework, based on the value of x.
Case 1: . Then this problem becomes , so there are possible values for , and thus solutions when is one.
Case 2: . Then this problem becomes , so there are possible values for , and thus solutions when is two.
If , the problem becomes . But the question mandates that is positive, so there are no solutions when . Thus, there are positive integer solutions to the equation.
Example 3
2004 AIME II Problem 4: How many positive integers less than 10,000 have at most two different digits?
Solution: Let and be the two digits of the number. Use casework, based on how many digits the number has.
Case 1: The number is one digit. All numbers in this category satisfy the given condition, so there are of these.
Case 2: The number is two-digit. Again, all numbers in this category have two different digits, so there are of these.
Case 3: The number is three-digit. The possible cases in this category are and Using a constructive approach, there are digits for what the first number can be, zero excluded to keep the number three-digit. The second digit can be digits, with zero included and the first digit's number removed. Then there are of these numbers.
Case 4: The number is four-digit. The possible cases in this category are and Using the same logic as before, the first digit has options, as does the second. Then there are of these numbers.
Thus, there are integers less than that have at most two different digits.