Students from Westridge School for Girls in the USA, Cedric from Australian International School Malaysia, Poppy and Gracie from Walton High School in England, students from Humanitree in Mexico, Florence from Walthamstow Hall Junior School in the UK, Eric and Lucia from Willowbank School in New Zealand, Abdullah from Poland, students from Frederick Irwin Anglican School in Australia, John from Poolesville ES in the USA, Bracha and Antoine from St Philip's CofE Primary School Cambridge in the UK, Park from Renaissance International School Sigon in Korea, Diya from the UK, Deniz from North Leamington School in the UK, Ira from Coldspring3 and Adi from the New Beacon in the UK all described how the computer works out your starting number.
Kristin from Westridge School for Girls sent this explanation:
All you have to do is do the problem backwards.
For example, if your number is 1 then you add 4, double that, subtract 7, and you will get 3.
All the computer has to do is do the problem backwards.
3$+$7 (opposite of $-$7) is 10.
10$\div$2 (opposite of $\times$2) is 5.
$-$4 (opposite of $+$4) is 1, which was my original number.
Luigi from Humanitree and Karrthic from Australian International School Malaysia found an algebraic expression for the final number. This is Karrthic's work:
The operation is
$(x +4) \times 2 -7= y$
$(5 + 4) = 9\\
9 \times2 = 18\\
When you reverse the operation, you find $x$
Furkan from TED Ankara Koleji in Turkey, Bernd and Qianwei from Humanitree and Shriya from International School Frankfurt in Germany showed what the computer does algebraically. This is Qianwei's work:
$(x+4) \times 2 - 7=y$
If we want to get $x$, we need to do the opposite of this equation.
Start with $y.$ In the equation $7$ [was subtracted], so we need to add $7$ to $y$
In the equation, $(x+4)$ was doubled, we need to divide it by two to get the opposite.
In the equation, $x$ was added [to] $4$, to get the opposite, we need to take away $4$ from $x.$
Finally the equation we used to find $x$ will be:
Furkan and Shriya simplified the equation before 'reversing' it. This is Furkan's work:
$(x+4) \times2 - 7$ is equal to $2x + 1,$ so we subtract $1$ from the result and divide by $2$ to get the starting number.
Alex from Humanitree and Fernando from Academia Britanica Cuscatleca in El Salvador noticed a different pattern in the numbers from the computer. This is Fernando's work:
When following the instructions given in the problem, if [you give the computer random integers as the result of your calculation], you will get random numbers.
However, when we start with 1 and try until five, you will notice the sequence:
|Number you tell the computer was your answer||Number the computer says you started from|
As you can see, the sequence is progressing by 0.5, thus is linear. It is adding 0.5 so, and we can see that when 0.5$\times n$ is done, you the sequence now looks like this:
|Number you tell the computer was your answer ($n$)||Number the computer says you started from||0.5$\times n$|
The answer to the subsitution is always 0.5 greater than the actual answer,
therefore, we need to always substract 0.5
Therefore, the instructions are directly 0.5$n-$0.5 !
Can you see how this result is related to Furkan's equation?
We received lots of sets of instructions for similar activities.
These instructions are from Tamara from Humanitree:
.Think of a number
.multiply it by 4
Your number was”¦
So if the final number was 19 first you would need to subtract 1. That would equal to 18. Then you would need to add 2, which would equal to 20. And [finally] you would need to divide it by 4. This equals to 5 so the first number would be 5.
Federico from Humanitree used algebra:
Divide by 4
If the number was $n$
You would do
$(n-5) \times4 +10 = $ end number ($x$)
Then the computer would do this operation to get the original value of $n:$
$(x-10)\div4 +5 =$ starting number
This operation would give you the original results.
Abdullah from Poland wrote a Python program to guess your number:
print("YOUR NUMBER WAS...")
print("Press [ENTER] after you made each move.")
input("Think of a number.")
input("Divide it by 4")
number = float(input("Now, type in number you finished with and then press enter."))
answer = (((number + 23) / 3) + 6) * 4 - 9
print("You chose the number %s" % answer)
Leila C and Scarlett K from Westridge School for Girls and KSc from Cheadle Academy sent in interesting sets of instructions which will always give the same result, like in the problem Your Number Is...
If you follow these instructions, will it ever be possible for the computer to work out what number you started from?
These are KSc's instructions: