Friday 11 July 2014

Shlemiel, the painter

A friend sent me this delightful joke which also doubles up as a puzzle, after I complained that the more I study, the longer my to-do list gets.

 (Go on, solve it, you know you want to.)

Personally, I think this was the best comment:

"You do realize, we're trying to sum up Stupidity as a Mathematical Equation."

But I also like the big collection of possible approaches --- those solutions have everything!

My solution is here, hidden as blue text on blue background:

Shlemiel can walk M meters per day, and his effort can be modelled as an Arithmetic series S_n  with the points S_x, S_y and S_z, therein, so we're looking for M = S_x,  2M = S_y and 3M = S_z and the values of x, y and z which give us the total distance reached on each day.

Rearranging S_n = n/2 (2p + d(n+1)) we get 2 S_n = dn^2 + dn +2pn = [(2S_n - 2pn) / d ] - n = n^2. 

(where p is the initial length and d is the distance) 

There is no closed form for finding n, but because n^2 is the biggest term, we can simply ignore the others and extract our values for x, y and z thus: 

x = floor(sqrt(M)), y = floor(sqrt(2M)) and finally, z = floor(sqrt(3M)).

On day one he paints a = x meters, the next day he manages b = (y - a) meters, and finally, c = (z - b) meters on the third. 

Update: there is of course always at least one error in every solution... and the above is no exception :) 

So...

x = floor(sqrt(2 M/d)), y = floor(sqrt(2*2M/d)) and finally, z = floor(sqrt(2*3M/d)).

Moral of the story: beware of working with convenient values.