Maths Olympiad Prep

Track / Stage 1 / 132 of 240 #132 of 2444

Problem 132

Algebra Difficulty 1.4 Find the answer CEMC Cayley · Canada · 2014

Consider the following flowchart:

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Next problem →

Official solution

Solution 1

We start from the OUTPUT and work back to the INPUT.


Since the OUTPUT 32 is obtained from adding 16 to the previous number, the previous number is 3216=1632-16=16.

[[IMAGE0]]

Since 16 is obtained by dividing the previous number by 2, then the previous number is 2×162 \times 16 or 3232.

[[IMAGE1]]

Since 32 is obtained by subtracting 8 from the INPUT, then the INPUT must have been 32+8=4032+8=40.

[[IMAGE2]]

Solution 2

Suppose that the INPUT is xx.

Subtracting 8 gives x8x-8.

Dividing this result by 2 gives 12(x8)\frac{1}{2}(x-8) or 12x4\frac{1}{2}x-4.

Adding 16 to this result gives (12x4)+16=12x+12(\frac{1}{2}x-4)+16=\frac{1}{2}x+12, which is the OUTPUT.

[[IMAGE3]]

If the OUTPUT is 32, then 12x+12=32\frac{1}{2}x+12=32 or 12x=20\frac{1}{2}x=20 and so x=40x=40.

Therefore, the INPUT must have been 40.

Source: CEMC, University of Waterloo, licensed CC-BY-NC-4.0. Statement reproduced verbatim; metadata (topic, difficulty, ordering) added by this project.