Fog Creek Software
Discussion Board




gold chain  aha:!!!

Here is the link to the gold chain puzzle.

http://www.techinterview.org/Puzzles/fog0000000041.html

is the answer to this is 6, which is the max no of cuts he can do anyway.

Everyday after the laborer completes work, a link is broken and given to him, at the end of the 6th day, he is given the 6th link.

Now only one link remains, which is given to the laborer at the end of the 7th day.

???? - or am i missing something?

Prakash S
Saturday, January 12, 2002

I believe the answer is 2, cutting the chain into 1-, 2-, and 4-link segments.  This assumes the employee does not spend his links until the entire job is complete (which he shouldn't because if he can't complete the work, he owes you a refund).

Day 1: Give 1-link to employee.
Day 2: Take 1-link from employee and give 2-link.
Day 3: Give 1-link to employee.
Day 4: Take 1-link and 2-link from employee, give 4-link.
Day 5: Give 1-link to employee.
Day 6: Take 1-link from employee and give 2-link.
Day 7: Give 1-link to employee.

It's like counting in Base 2, if you prefer to think of it that way.

Chad Hulbert
Saturday, January 12, 2002

thanks chad.

Prakash S
Saturday, January 12, 2002

It's one cut, not two.  Cut the third link from the end, and you end up with a 2-link, a 4-link, and the cut single link.

Paul Brinkley
Monday, January 14, 2002

Its a 1 link, 2 link, 4 link combination.

First day, give him 1 link.
Second day, get the single link back and give him the 2 link.
Third day, give him the 1 link.
Fourth day, get the 1 link and 2 link back from him and give him the 4 link.
Fifth day, give him the 1 link.
Sixth day, get the 1 link back from him and give him the 2 link.
Seventh day, give him the 1 link.
Yipeeeeeeeeeeeeeeee!

hollie welcher
Monday, January 28, 2002

You all suck!!!

Fogcreek Hacker
Saturday, February 09, 2002

to Fogcreek Hacker: Are you saying that all of the above solutions are wrong? Is that why we suck?

More specifically, is Paul Brinkley's solution of "one cut" incorrect? Is his logic wrong or do you have some novel way of doing it with no cuts?

Winky Chin
Monday, February 11, 2002

*  Recent Topics

*  Fog Creek Home