Sub topic 7
Using integer conditions and bounds
This chapter assumes you can do school-level algebra and can work with factors, multiples and remainders. It also assumes you have read the earlier chapters on parsing a question and setting up equations. Here you will learn to use the fact that an answer must be a whole number, and that it must lie in a limited range, to find or narrow the answer when no options are shown.
Why integer conditions matter in TITA
A TITA (Type In The Answer) question gives you no options to test. Many of these questions still have a hidden shortcut. The quantity is a count of people, coins, boxes, digits or arrangements, so only whole numbers are allowed. A single equation with two unknowns usually has infinitely many real solutions. Once you require positive integers, it often has only one or two.
Two ideas do most of the work:
- Integrality. The unknown must be a whole number, so divisibility, parity and remainders restrict it.
- Bounds. The unknown must lie between limits given in the question or implied by it, such as "positive", "at most 100" or "distinct".
The usual pattern is to turn the conditions into a short list of candidates, then test each candidate against everything the question says.
Reading integrality from the wording
Look for these signals when you parse the question.
| Wording | Condition it gives |
|---|---|
| "number of students/items/coins" | Positive integer, often at least 1 |
| "x% of the class is..." | The class size makes the percentage a whole number |
| "distinct" integers | No repeats, so minimum sums are forced |
| "digits" | Each digit is 0 to 9; the leading digit is 1 to 9 |
| "remainder r when divided by n" | 0 ≤ r < n |
| "how many integers satisfy..." | Count only integers, not real values |
Percentages and ratios are the most common hidden constraint. If 37.5% of a group passed, then 37.5% = 3/8, so the group size must be a multiple of 8.
Technique 1: Divisibility from percentages and ratios
A test has between 50 and 60 students, and 37.5% of them passed. How many passed?
- Write 37.5% as 3/8.
- The total must be a multiple of 8 so that 3/8 of it is whole.
- The only multiple of 8 from 50 to 60 is 56.
- Passed = 3/8 × 56 = 21.
The bound (50 to 60) and the integer condition (a multiple of 8) together leave one candidate. Without both, you could not finish.
Technique 2: Linear equations in two unknowns
Suppose 7x + 11y = 100, where x and y are positive integers. Find x + y.
- Bound y first. Since 7x ≥ 7, we need 11y ≤ 93, so y ≤ 8.
- Use remainders modulo 7 (the smaller coefficient). We have 100 ≡ 2 (mod 7) and 11y ≡ 4y (mod 7). So 4y ≡ 2 (mod 7).
- Test y from 1 to 8. The value 4y mod 7 equals 4, 1, 5, 2, 6, 3, 0, 4 for y = 1, 2, ..., 8. Only y = 4 gives 2.
- Then 7x = 100 − 44 = 56, so x = 8.
- x + y = 12.
You can also list values of y directly and check whether 100 − 11y is a multiple of 7. Reducing modulo the smaller coefficient is faster because you only try about 7 values at most.
solutions = [(x, y) for x in range(1, 15) for y in range(1, 10) if 7 * x + 11 * y == 100]
print(solutions) # [(8, 4)]A useful rule: ax + by = c has integer solutions only if gcd(a, b) divides c. If it does not, no integer solution exists. For example, 6x + 9y = 100 has none, because 3 does not divide 100.
Technique 3: Extreme values from bounds
Some questions ask for the largest or smallest possible value. The method is to push all the other quantities to their limits.
Five distinct positive integers add up to 20. What is the largest value the greatest of them can take?
- To make one number large, make the other four as small as the rules allow.
- Distinct positive integers: the smallest four are 1, 2, 3 and 4, which sum to 10.
- The largest number is 20 − 10 = 10.
- Check that the set {1, 2, 3, 4, 10} is valid. It has five distinct positive integers and sums to 20.
The last step matters. An extreme value is only valid if some real configuration reaches it.
Technique 4: Counting integers in an inequality range
How many integers n satisfy n² − 10n + 16 < 0?
- Factor: (n − 2)(n − 8) < 0.
- The product is negative strictly between the roots, so 2 < n < 8.
- The integers are 3, 4, 5, 6, 7. That is 5 integers.
The count of integers in a range is where mistakes happen. Use these rules:
- Inclusive on both ends, a ≤ n ≤ b: the count is b − a + 1.
- Strict on both ends, a < n < b: the count is b − a − 1.
- A strict end that is not an integer, such as 2.5 < n < 7.2: list the integers (3 to 7) and count them directly.
count = sum(1 for n in range(-100, 101) if n * n - 10 * n + 16 < 0)
print(count) # 5Technique 5: Parity and last digits
Parity (odd or even) and last digits cut candidates quickly.
- A sum of integers is odd only if it has an odd number of odd terms.
- The product of two integers is odd only if both are odd.
- A square ends in 0, 1, 4, 5, 6 or 9, never in 2, 3, 7 or 8.
- For digit problems, a number is divisible by 4 if its last two digits are, and by 9 if its digit sum is.
If your working gives a candidate square ending in 7, you made an error somewhere. You can catch that without redoing the calculation.
A workflow you can repeat
Common errors
- Forgetting a bound. If a question says "positive", then x = 0 is not allowed. If it says "non-negative", it is.
- Off-by-one counting. Count 3 to 7 as 5 numbers, not 4. Write the first and last values and use b − a + 1.
- Stopping at the first solution. Equations like 7x + 11y = 100 can have several positive solutions when the numbers are smaller. Continue until the bounds end the search. Here the solutions would repeat every 11 in x and every 7 in y, so the next one is outside the range.
- Ignoring distinctness. "Different" or "distinct" removes repeated values and raises the minimum sums.
- Accepting a non-integer. If a counting question gives you 12.5, the setup or a bound is wrong. Recheck before rounding.
Using code to check your reasoning in practice
On the exam you cannot run code, but a brute-force check on practice questions shows whether your bounded reasoning was complete. Try the passed-students example this way.
candidates = [n for n in range(50, 61) if (3 * n) % 8 == 0]
print(candidates) # [56]
print(3 * candidates[0] // 8) # 21If your hand method and the brute force disagree, write down which condition you missed. That entry belongs in your error log, covered in a later chapter.
Exercises
Exercise
Seven students share a total of 40 marks, and each student gets a positive integer number of marks. All seven marks are different. What is the largest mark any one student can receive?
Show answer
Make the other six marks as small as possible: 1 + 2 + 3 + 4 + 5 + 6 = 21. The largest mark is 40 − 21 = 19. The set {1, 2, 3, 4, 5, 6, 19} is valid, so the answer is 19.
Exercise
A shop sells pens at 5 rupees and notebooks at 8 rupees. A customer buys at least one of each and pays exactly 61 rupees. How many notebooks did the customer buy?
Show answer
We need 5p + 8n = 61 with p, n ≥ 1. Since 61 ≡ 1 (mod 5) and 8n ≡ 3n (mod 5), we need 3n ≡ 1 (mod 5), so n ≡ 2 (mod 5). Try n = 2: 61 − 16 = 45, p = 9. Try n = 7: 56 exceeds the room left (61 − 56 = 5 gives p = 1). Check: 5 × 1 + 8 × 7 = 61, so n = 7 is also valid. The question therefore has two solutions, (p, n) = (9, 2) and (1, 7), and the answer is not unique as written. The lesson is to test every candidate in range. If the original question adds a condition such as "more pens than notebooks", then only n = 2 remains.
Exercise
How many integers x satisfy 3 < 2x − 1 ≤ 15?
Show answer
Add 1 to each part: 4 < 2x ≤ 16. Divide by 2: 2 < x ≤ 8. The integers are 3, 4, 5, 6, 7, 8. The answer is 6.