Gokul43201 said:
I think the friend is handing out the conditions piecemeal.
Yeah, the friend is inaccurate to declare the answer as wrong. Note that "He said you have to use squares" in the 2nd problem, and yet there isn't even a number 2 in the 2nd drawing. So raising something to the 2nd power is using a non-existent number already. You could admittedly GET a 2 if you do a 7-5, but then you've used up a 7 and 5, and can't get a 20 using only 2 and 6. And if you allow using numbers
multiple times, then you could say that my earlier answer was correct by rewriting it:
.
I wrote a program a while back to solve things like these that goes through all the permutations of multiplication, addition, subtraction, division, powers, and modulus-- maybe I can tweak it to show all the possible solutions... Hmmm...
[edit]
Ok, my original program worked for 4 input numbers, so I could verify that using addition, subtraction, multiplication, division, powers, logs, and modulus, and using each "outlying number" only once, that these are the available solutions for the 1st problem (assuming upper-left is A, lower-left is B, upper-right is C, lower-right is D):
(((B-A)%C)+D)
(D-((A-B)%C))
(D+((B-A)%C))
(((D%C)+B)-A)
(((D%C)+B)%A)
((B+(D%C))-A)
((B+(D%C))%A)
(((D%C)-A)+B)
(B+((D%C)-A))
(B%((D%C)-A))
(B-(A-(D%C)))
(B%(A-(D%C)))
(((A+B)+D)%C)
(((B+A)+D)%C)
(((B-A)+D)%C)
((D+(A+B))%C)
((D-(A-B))%C)
((D+(B+A))%C)
((D+(B-A))%C)
(((A+D)+B)%C)
(((D+A)+B)%C)
(((D-A)+B)%C)
((B+(A+D))%C)
((B-(A-D))%C)
((B%(A-D))%C)
((B+(D+A))%C)
((B+(D-A))%C)
((B%(D-A))%C)
(((B+D)+A)%C)
(((B+D)-A)%C)
(((B+D)%A)%C)
(((D+B)+A)%C)
(((D+B)-A)%C)
(((D+B)%A)%C)
((A+(B+D))%C)
((A+(D+B))%C)
Obviously that doesn't include absolute value, trig functions, factorials, "square", "square root", "cube", "cube root", up-arrow notation, Choose, etc. So that's examining 32,928 possible formulas. If you included a "reasonable" amount of the other functions, it'd be on the order of 5 octillion possible formulas (really infinite), so I decided to skip that.
[/edit]
DaveE