Math Challage #3

Specialist

Banned
Oct 7, 2000
454
0
0
You have a broken calculator. Given any two numbers x and y, you are only able to compute x+y, x-y, x+1 and 1/x (if x isn't 0). You can also save all the numbers you get and reuse them in any order. Show how to compute the square of any number in six computations or fewer. Show how to multiply any two numbers in 20 computations or fewer.

Note that 1/x - 1/(x+1) = 1/(x*(x+1)) and the reciprocal of THAT is x more than x2. This suggests that you can compute the square in six steps:

compute x+1

compute 1/x

compute the reciprocal of the result of step 1

compute the difference of the results of steps 2 and 3

compute the reciprocal of the result of step 4

take the difference of the result of step 5 and x

From here, to multiply two numbers, consider that (x+y)2 - (x-y)2 = 4xy, so given the first two steps to compute x+y and x-y, then take six steps each to form their squares and one more step to take the difference of these squares. We've used 15 steps so far and we have 4xy. How can we divide a number by 4 in 5 steps or fewer?

Edit: You can solve it with less than 10 steps (clue)
 

GammaRayX

Senior member
Oct 11, 1999
282
0
0
Divide by 4

Step 1) take 1/x
Step 2) add step 1 result by itself
Step 3) add step 2 result by itself
Step 4) take reciprocal of step 3 result

Step 4 result = X/4