Maximum count from measurement bounds
Maximum count from measurement bounds
Maximum count from measurement bounds · n
- 151 bytes
- COMP mode
Worked examples
Example 1
A canteen cooks 250 L of soup, correct to the nearest 10 L. All of the soup is served, with none left over, in n bowls, and each bowl holds 0.35 L, correct to the nearest 0.01 L. Find the greatest possible value of n.
Answer
Standard solution (without a calculator)
- Bounds in litres: the total volume T satisfies 245 ≤ T < 255, and each bowl’s volume m satisfies 0.345 ≤ m < 0.355.
- Strict upper bound: every bowl holds at least 0.345 L, so 0.345n ≤ T < 255, giving n < 255 ÷ 0.345 = 17000/23 = 739.13…, so n ≤ 739.
- Check it can happen: 739 bowls of 0.345 L make 254.955 L, which lies in [245, 255). For 740 bowls the least total is 740 × 0.345 = 255.3 L ≥ 255 L, which is impossible.
- Conclusion: the greatest possible value of n is 739.
Example 2
A reel of 3D-printer filament has a mass of 750 g, correct to the nearest 50 g. All of the filament is used, without waste, to print n keyrings, and each keyring has a mass of 6.4 g, correct to the nearest 0.2 g. Find the greatest possible value of n.
Answer
Standard solution (without a calculator)
- Bounds in grams: the total mass T satisfies 725 ≤ T < 775, and each keyring’s mass m satisfies 6.3 ≤ m < 6.5.
- Strict upper bound: every keyring is at least 6.3 g, so 6.3n ≤ T < 775, giving n < 775 ÷ 6.3 = 7750/63 = 123.01…, so n ≤ 123.
- Check it can happen: 123 keyrings of 6.3 g make 774.9 g, which lies in [725, 775). For 124 keyrings the least total is 124 × 6.3 = 781.2 g ≥ 775 g, which is impossible.
- Conclusion: the greatest possible value of n is 123.
Example 3
A piece of cord is 9 m long, correct to the nearest 1 m. All of the cord is cut, without waste, into n pieces, and each piece measures 1 m, correct to the nearest 1 m. Find the greatest possible value of n.
Answer
Standard solution (without a calculator)
- Bounds: the total length T satisfies 8.5 ≤ T < 9.5 m, and each piece length m satisfies 0.5 ≤ m < 1.5 m.
- Strict upper bound: every piece is at least 0.5 m, so 0.5n ≤ T < 9.5, giving n < 9.5 ÷ 0.5 = 19.
- Exact-integer ratio: n must be strictly less than 19, so n = 19 is not allowed: 19 pieces of 0.5 m already make 9.5 m, which is not less than 9.5 m. The greatest integer is 18.
- Check it can happen: 18 pieces of 0.5 m make 9 m, which lies in [8.5, 9.5).
- Conclusion: the greatest possible value of n is 18.
When to use it
A total measured to a given accuracy is cut or packed completely into n pieces, each measured to its own accuracy. With the total in [A − u/2, A + u/2) and each piece in [C − v/2, C + v/2), the greatest count is the largest integer n with n(C − v/2) < A + u/2, provided n(C + v/2) > A − u/2.
Enter the known values
- A: measured total; B: the unit u the total is rounded to; C: measured size of one piece; D: the unit v each piece is rounded to.
- Express all four values in one physical unit, for example all in g: “2.5 kg correct to the nearest 0.1 kg” becomes A = 2500 and u = 100. The two rounding units may differ. Type a number at every prompt.
Read the result
- The program shows one result: the greatest possible count n. A result of −1 means an invalid input, a value out of range or no possible split; it is not a count.
Question types
- Original practice for HKDSE Mathematics Compulsory Part, approximation and errors: a rounded length, mass or volume is cut or packed into rounded pieces, and the question asks for the greatest possible number of pieces.
Before you start
- Use COMP mode and an empty program area with at least 151 bytes (P1–P4 share 680 bytes). The examples use P1; if P1 already holds a program, back it up or use another empty area and press that number instead.
- Convert the total and the piece size to the same physical unit before entering them. The rounding units u and v may be different, but both must be positive.
- All material is assumed to be used with no loss. Both lower bounds, A − u/2 and C − v/2, must be greater than 0.
- The result is the greatest possible count and keeps the strict upper bound: if the bound ratio is exactly 19, n < 19 gives 18, not 19. It is not the count that is guaranteed when the total takes its least value.
- A/u and C/v must not exceed 10⁸, and the count must not exceed 10⁹. Use at most 10 significant digits in normal inputs.
- −1 means an input, range or feasibility check failed. A blank EXE keeps the variable's previous value, which is not the same as entering 0. At the result, AC leaves and EXE runs the program again.
- The program overwrites A, B, C, D, X and Y and leaves the display in Norm 2.
Checking access…