Smart questions
Smart people
 Find A ForumFind An Expert
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Remember Me

Are you a
Computer / IT professional?
Join Tek-Tips now!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Just copy and paste the

#### Feedback

"...I just wanted to say THANKS for the forum. The knowledge I gain from your site is invaluable..."

#### Geography

Where in the world do Tek-Tips members come from?

# Cutting A Gold Bar(3)

 Forum Search FAQs Links Jobs Whitepapers MVPs
 bam720 (TechnicalUser) 5 Aug 07 9:53
 If I have 1 gold bar, equally divided into 7 pieces as such:|=|=|=|=|=|=|=|I need to pay an employee each day for one week.  His wages are 1 piece of the gold bar per day.  How can I cut the bar to allow for fair payment using only 2 cuts.  You can not fold the bar because it is gold.
 (2)  mmerlinn (Programmer) 6 Aug 07 0:06
 I would imagine a binary cut would be appropriate here.End result would be:|=||=|=||=|=|=|=| mmerlinn"Political correctness is the BADGE of a COWARD!"
 traingamer (Programmer) 6 Aug 07 15:22
 So how will you use that to pay me on Tuesday after I spent the 1 unit piece you gave me on Monday? Greg"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 VRoscioli (Programmer) 6 Aug 07 15:33
 He gives you the two gold piece and you give him the one gold piece back. -V
 Skie (Programmer) 6 Aug 07 20:17
 I can see how that's likely the solution, but doesn't that present a problem if he spends the gold piece?  Seems much more efficient to pay him weekly.  Then I only need to cut the bar one time if he doesnt work a 7 day week.
 cjelec (Programmer) 7 Aug 07 8:38
Going by a normal working week is 5 days, I'll go with:

#### Quote:

Two curve lines:
___________
| \      ____      /|
|   \  /          \   / |
|   X            X   |
|  /   \ ____ /  \  |
| /__________\|

 GwydionM (Programmer) 11 Aug 07 11:21
 I assume binary cuts are meant to be the right answer.  But as traingamer says, this depends on the employee keeping their wages and having the bars ready to give as change.  So why not just cut once and give them five bars at the end of the week? ------------------------------An old man who lives in the UK
 mmerlinn (Programmer) 12 Aug 07 6:31
 GwydionMReasonable assumption, but what happens when there is a holiday some time during the week?  Depending on the job, this could be a major obstacle since there tends to be here about 1 week per month that is short or split because of days off, sometimes paid, sometimes not. mmerlinn"Political correctness is the BADGE of a COWARD!"
 AlexCuse (Programmer) 12 Aug 07 11:45
 Maybe back in the good old days, when people were paid with gold bars, they didn't need to worry about such things ----signature below----I don't do any programming whatsoeverIgnorance of certain subjects is a great part of wisdom
 jwenting (Programmer) 15 Aug 07 4:06
 indeed, they'd just hire someone to make more cuts as needed...Or they made sure they ordered gold bars from the gold bar maker that were the right size for paying exactly the amount needed.
 ESquared (Programmer) 16 Aug 07 19:47
 Give the employee all seven pieces on the first day. My alarm clock causes time travel. When I hit snooze, no apparent time passes before the alarm sounds again, but the universe has in fact moved forward through time by ten minutes!
 AlexCuse (Programmer) 16 Aug 07 22:01
 But, if you can cut it only twice, would it not be 3 pieces? ----signature below----I don't do any programming whatsoeverIgnorance of certain subjects is a great part of wisdom
 jwenting (Programmer) 17 Aug 07 3:26
 4 pieces max. Cut in half, put pieces on top of each other, cut the stack.But that might be bending the rules a bit :)
 RickBerem (Programmer) 23 Aug 07 16:36
 I was wondering...I get paid only once a week!Maybe this guy gets paid only once a week also...then 0 cuts would be needed!:) SG
 SamBones (Programmer) 7 Sep 07 12:58
 Just cut two small pieces off the bar. One goes to the employee as severance pay. One goes to some offshore country that you've outsourced his job to. You keep the rest.At least I think that's how it works.Or, you tell him he's paid once a week and give him the whole bar at the end of the week (after cutting a third of it off for taxes and health insurance and so forth).
 SiriusBlackOp (Programmer) 7 Sep 07 15:14
 My Thought... If it's already divided into 7 pieces, then why cut it at all?  Just give him one piece per day.  LOL! Senior Software Developerhttp://www.scoutsft.com
 BobRodes (Instructor) 10 Sep 07 17:44
 Sorry, I can only figure out how to do it with one.
 BobRodes (Instructor) 10 Sep 07 17:50
 Well, come to think of it, that means I can do it with two as well.  So:Ignore the "equal division into 7 cuts" as this suggests that no cuts need to be made to distribute properly.  Now, make one cut in the shape of a sine wave, such that there are 3.5 waves in the gold bar.  This will break the bar into 8 pieces; the two end pieces will be the same size taken together as any of the inner pieces.  Make sure, of course, that the apex of each wave is the exact tangent of the edge of the bar, so that the fact of a single cut will be preserved while still breaking the bar into pieces.To make a second cut, make a random cut in the bar that doesn't alter the pieces in any way.Done.
 comtechau (TechnicalUser) 22 Sep 07 22:15
 I know I am not allowed 3 cuts but... 1st cut |=|=|=|=|X|=|=|=|giving you |=|=|=|=|   |=|=|=|Then stack the block of 3 on TOP of the block of 42nd cut |=|=|X|=|=| through 2 layersgiving you |=|=| |=|=| |=|=| |=|Then stack the 3 blocks of 2 on TOP of each other3rd cut |=|X|=| through 3 layersgiving you |=| |=| |=| |=| |=| |=| |=|DONE! (I am stumped as to how it could ever be done in 2cuts!) http://commtechau.bravehost.com
 comtechau (TechnicalUser) 22 Sep 07 22:22
 cjelec (Programmer) 23 Sep 07 7:00
 BobRodes,So something like my suggestion, but with another curve?
 acent (TechnicalUser) 27 Sep 07 17:10
 I'm going to be the prick and add more details.  Since I have been involved with payroll duties at a prior job, I know we are forgetting that overtime must be paid. The problem states that for one week of work, the bar was cut into 7 even pieces, and the wages for 1 day was one piece. So the worker was working all 7 days of the week, and most companies allot for overtime after 5 or 6 consecutive days of work.  Therefore, for days of overtime, the worker earns 1.5 pieces.  Therefore, we need at least 1 bar, and 1/2 piece to pay the worker for the work on the day(s) that s/he should have been paid overtime.Just a thought. "If it's stupid but works, it isn't stupid."  -Murphy's Military Laws
 IknowMe (Programmer) 27 Sep 07 17:33
 One cut (although this method would require outsourcing and eliminates the overtime calculations)|=|  |=|=|=|=|=|=|   Wow, I'm having amnesia and deja vu at the same time.                         I think I've forgotten this before.
 IknowMe (Programmer) 27 Sep 07 17:35
 Drat the OP states "fair payment" which I believe excludes outsourcing.   Wow, I'm having amnesia and deja vu at the same time.                         I think I've forgotten this before.
 SkipVought (Programmer) 27 Sep 07 19:47
 I checked the National Institute of Standards, Weights and Measures Division and the National Conference on Weights and Measures, looking for piece as a linear (such as board foot), two dimensional, cubic, or even as a unit of weight, and, frankly, I came up short.I am reminded of the fellow who, when ordering a pizza, when asked, "Want me to cu'cher pie into sixteen pieces?" replied, after a short pause, "Naauu. Can't eat that many."And my Dad, who suddenly got smarter, the moment I left home, who told Mom, the instant after the first piece of cake went to little sister, "There's only one piece of cake left.  Guess I'll finish it off!"So with that, here's my stab.|=|                                           |=|=|                                         |=|=|=|=|              Day one he gets piece 1Day 2 he gives back piece 1 & gets piece 2Day 3 he gets piece 1 along with piece 2 he laready hasDay 4 he gives back piece all the pieces and gets piece 3Day 5 he gets piece 1 along with piece 3 that he already has Skip, When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...Tooth Company Freeze a Crowd!  andMany are Cold, but Few are Frozen!
 traingamer (Programmer) 28 Sep 07 11:22
 I can't believe this thread is still going since the first poster answered the question.(And I made a joke about spending the money). Greg"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 SkipVought (Programmer) 28 Sep 07 11:55
 Greg,Puzzlers, read the challenge, go off and work on a solution, come back back and post......and THEN read the other posts.It has a life of its own!   Skip, When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...Tooth Company Freeze a Crowd!  andMany are Cold, but Few are Frozen!
 IknowMe (Programmer) 28 Sep 07 12:21
 Or they read the posts, realize they're to late to be the first with the correct answer and then try to find other unorthadox/humorous attempts to solve the problem.  :)  Either way it's all in the name of fun.   Wow, I'm having amnesia and deja vu at the same time.                         I think I've forgotten this before.
 traingamer (Programmer) 28 Sep 07 13:16
 I quite understand. I've rarely met a rhetorical question that I didn't like. Greg"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 SkipVought (Programmer) 28 Sep 07 13:51
 Well, if you wind up, just spinning your wheels in your driveway.....its your own asphalt! Skip, When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...Tooth Company Freeze a Crowd!  andMany are Cold, but Few are Frozen!
 BobRodes (Instructor) 28 Sep 07 15:13

 BobRodes (Instructor) 28 Sep 07 15:22

 halusmc (Programmer) 4 Oct 07 16:27
 BobRhodes is getting there.Make one cut that is roughly the shape of a standard bell curve.  Keeping the two peices together make another bell curve cut that is inverted. This will yeild 7 peices.  Someone would have to do some math to figure the correct shape of the curve so each peice would be equal.
 SamBones (Programmer) 8 Oct 07 13:53
 Just thinking outside the box a little here. The original post says you can't fold the bar. It says nothing about folding the saw. What if you bent the saw into an "S" shape. Something like this when viewed from above...    _   / \ |   | | |   | | |   H \_/   H   H...with the "H"s being the handle. It's spaced so the first "cut" takes three pieces off one side, and the second "cut" takes three off the other side, leaving a seventh middle piece from the center. If planned out correctlt, that would give you seven equal pieces.(BTW, I think the first reply by mmerlinn was the correct one.)
 kaht (Programmer) 8 Oct 07 16:35
 In that case, why not just bend the saw 6 times to cut all 7 pieces in one cut?   -kahtLisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 BobRodes (Instructor) 8 Oct 07 17:42

 Diancecht (Programmer) 9 Oct 07 14:23
 You can also punch the bar until it breaks without any cut ...Cheers,Dian
 AlexCuse (Programmer) 9 Oct 07 16:16

#### Quote:

In that case, why not just bend the saw 6 times to cut all 7 pieces in one cut?

What if you only have scissors?

----signature below----
I can't compete with you physically, and you're no match for my brains.
You're that smart?
Let me put it this way. Have you ever heard of Plato, Aristotle, Socrates?
Yes.
Morons!

 skyline666 (Programmer) 22 Oct 07 9:46
 bobrhodes, u kept going on bout ur sine wave, but if u think about it, when cut the bar so there is 3.5 waves, as soon as cut and the first small piece falls off, thats 1 cut cos u stopped cutting (why, theres nothing more to cut, need to start cutting the other way), so not bein to harsh (like u kept quoting others) but ur way wudnt work for 2 cuts
 BobRodes (Instructor) 8 Jan 08 14:30
 Well, I did think about it sky, and I came to an alternative conclusion.  Maybe you could think about it some more.My position (which if you had read my post a little more carefully, you would have already seen) is that if one cuts a line tangential to the edge one preserves the fact of a single cut, while simultaneously breaking into two pieces.  Contemplate this: the cut touches the edge at a single point, which has no dimensions.  So, does the cut end when it continues past a point with no dimensions, which point also serves to divide some medium into two pieces?  I feel quite comfortable saying it does.  I also feel quite comfortable being disagreed with on the matter.  However, if you wish to suggest that you are capable of categorically refuting my point of view with less mental effort than it takes to spell my name correctly, I'm afraid that I'll have to disagree with you there.Bob
 Skie (Programmer) 8 Jan 08 20:42
 Alternate 2 cut solution:Provided the top and bottom of the prior cut leaves 1/7th of the bar on the top and 1/7th of the bar on the bottom.  Do this wave cut:|     ||/\/\/||     |Place the two pieces on top of each other and cut the 1/7th pieces off like so:|_____||/\/\/|Giving you 6 pieces that are 1/7th pieces and 2 pieces that are 1/14th.
 mmerlinn (Programmer) 8 Jan 08 21:36

#### Quote (traingamer):

I can't believe this thread is still going since the first poster answered the question.

I can't either.  LOL.

#### Quote (SamBones):

(BTW, I think the first reply by mmerlinn was the correct one.)

I won't claim my answer is the correct one, but I do think that it is the answer bam720 was looking for.  Would be nice if he would comment on all of these comments.

I also notice that SkipVought has the same answer I had, just spelled out a bit more.

mmerlinn

"Political correctness is the BADGE of a COWARD!"

 BobRodes (Instructor) 9 Jan 08 14:38
 Well, I stated the position that providing a gold piece that one isn't able to spend doesn't constitute payment, and if one has to give it back one can't spend it.  So it may be the answer bam720 was looking for, but MY answer was an improvement.
 skyline666 (Programmer) 25 Jan 08 7:35
 Well my fiances surname is spelt rhodes, theres is an island called rhodes, and as im not interested in the exact spelling of ur name and just merely glanced at what ur name was i spelt it that way.I also dont no whether to agree or disagree with the cutting.  As I said previously, if you are cutting and you get to the edge, that first small piece will break off.  If you are then still cutting (counting this as one cut), then you must be shaving some of the gold off to have it counting as a single cut must you not, and if this is then true, there wont be equal cuts at all as there will be bits of gold shavings on whatever your cutting the gold bar on.  Unless what you are stating is that picture the sine wave, with a tangent at its amplitude.  When you are cutting and you get to the tangent, you are infact not cutting the first small piece off, but leaving a hairline piece of gold on, which connects it to the rest of the gold bar.  This will count as a single cut.
 akalinowski (IS/IT--Management) 25 Jan 08 13:56
 option 1: assuming the gold bar is divided into 7 pieces like a chocolate bar, break gold bits off like Hershey's, mmmmm... chocolate... cut it once for shitsif that's not the case... option 2: cut the gold twice longways to expose more surface area, melt the gold, poor into 7 molds each able to hold 1/7th the volume of the original bar, let cool, remove from mold and use for payment. akalinowskiwww.nofear.comMCSE 2000, A+, N+, LCP, CNE
 BobRodes (Instructor) 29 Jan 08 15:26

 bam720 (TechnicalUser) 12 Feb 08 16:27
 My apologies for not responding.  It has in fact been so long that I do not recall looking for a specific answer.  If I recall correctly, I heard the puzzle and felt like sharing.  I admit I do not read the forums as often as I should (I drop in unannounced time to time), I never responded because the multiple solutions continued to intrigue me.  Without saying a "correct" solution has been found I like reading other "alternate and equally valid"  solutions :)mmerlinn I think that your answer solves the problem at hand in the most direct and straight forward manner.  I really like the sine wave solution as well, BobRodes
 BobRodes (Instructor) 13 Feb 08 17:26

 mmerlinn (Programmer) 13 Feb 08 17:58

BobRodes:

#### Quote:

I really like the sine wave solution as well, BobRodes

Glad I didn't need to twist my brain to come up with your solution.

mmerlinn

http://mmerlinn.com

"Political correctness is the BADGE of a COWARD!"

 BobRodes (Instructor) 15 Feb 08 15:51

 COBOLScott (Programmer) 17 Mar 08 21:02
 Hi all, I have pondered this for about 5 years. I was asked this once by a student who was stuck on this word problem in some class or another, and I have come up with more than one solution, and although he didn't like any of them, it was a good way to kill a couple of beers. I found this board and thought I would share, and probably stick around as there is a lot of info here. BobRodes, I originally envisioned the solution you proposed, but I had to discard it, simply because it creates too many pieces. I'm pretty sure that the original question was designed to elicit a similar answer regarding sine wave measurement though. You could stretch the semantics to say you would melt the two ends together, because that is not specifically prohibited in the problem, but then you could melt it into 7 smaller ingots and not make any cuts, so I'm going to push the "fail" buzzer on that one too. I guess I should start by making an assumption on the wording of the problem. "Equal Pieces" has to be quantifiable. I'm going to assume that volume, or mass, or for our purposes weight, is keeping within the guidelines. This is very important. We'll assume the bar is 1 ounce for reference below.Solution 1, we can modify your solution slightly, by cutting it in a sine wave, but in the middle, limiting the frequency to 1.5 wavelengths. That gives us 3 equal pieces of 1/7 oz and two ends of 2/7 oz each, if we've dome it correctly. Then we can stack the two ends and make one cut through them to divide them into 4 pieces of 1/7 oz each. 7 * 1/7 oz = 1 oz.That was discarded because the stack-and-cut could be considered two cuts by itself depending on how you read it. No problem.Solution 2, we don't cut all the way through, but more like we etch through the ingot or bar almost all the way. We still use our sine wave pattern, but this time 3 wavelengths so that we have 6 full "sine-pieces" with extra on the end. Now here is the tricky part, we turn the ingot in its edge, and slice down only in the middle, freeing the 6 pieces from the ingot, 1/7 oz each, and leaving a flat sheet with two partial pieces attached. If we calculated our cut depth and our sine frequency correctly by making it slightly longer, the two ends will be connected by a flattish sheet of leftover gold, still technically one piece, and weighing 1/7 oz total. I liked that better but couldn't come up with enough math to convince my bud to use it, so I came up with yet another way. Solution 3, the gold is in a cylindrical bar shape. Shape is critical here as I'll get to in a moment. We take our magic gold knife and start a cut only halfway through the bar to the centerline, and rotate the bar as we cut so that we get a spiral cut. The bar will still be in one piece at this point. Then we cut lengthwise, again halfway through to centerline, which causes the pieces to separate. It is not too different from cutting a spring across the coils; you end up with a bunch of rings at the end. I said shape was critical here, but it can be done. I spent awhile later on playing with modeling clay and a sharp knife. Try it.Solution 4 came from solution 3, and assumes we start with a spring, or a thickish wire we can coil into a spring. Simply cut down the edge, one cut does it. Those are what I came up with at the spur of the moment in June of 2000. It has haunted me ever since, LOL!
 COBOLScott (Programmer) 17 Mar 08 21:05
 Sorry I meant 2003 above. But if it compiles it goes, pre-editing is not a requirement for programmers, right?
 Moissenjeff (Programmer) 18 Mar 08 16:45
 I think I have the solution:you first cut the bar into 2 piece slice + 5 piece slice|=|=| + |=|=|=|=|=|Then you put them on top of each other like so:|=|=||=|=|=|=|=|Then you cut your second cut between first & second and third and fourth, wich gives you:|=| + |=| + |=| + |=|=|=|=|day 1 |=| day 2 |=| + |=|day 3 |=| + |=| + |=|day 4 |=|=|=|=| - 3 *(|=|)day 5 |=|=|=|=| + |=|day 6 |=|=|=|=| + |=| + |=|day 7 |=|=|=|=| + |=| + |=| + |=|It is solved
 Skie (Programmer) 19 Mar 08 20:12

#### Quote:

Solution 3, the gold is in a cylindrical bar shape. Shape is critical here as I'll get to in a moment. We take our magic gold knife and start a cut only halfway through the bar to the centerline, and rotate the bar as we cut so that we get a spiral cut. The bar will still be in one piece at this point. Then we cut lengthwise, again halfway through to centerline, which causes the pieces to separate. It is not too different from cutting a spring across the coils; you end up with a bunch of rings at the end. I said shape was critical here, but it can be done. I spent awhile later on playing with modeling clay and a sharp knife. Try it.

Why does it have to be cylinder?  Provided it's a rectangular prism, this same method should work.  It may work for other shapes, but I'd hate to figure the math to confirm it.

For ease, we'll imagine the bar has 24 sections to make cutting easier.  Starting from the bottom right of the second section, cut diagonally from there to the top left of the same section.  Turn, and cut from the bottom right of section 3 to the top left of section 3.  So on, until the last cut going to the top left of section 22 (ending at the bottom right of 23) where you stop.

Then cutting from top to bottom, start in the corner you started from (should be same you ended in) and cut to the middle of the cube slicing through the entire bar.

If the size of the bar is 1" x 1" x 24", then you need only cut the middle sections in half to see you can make a cube with a volume of 3 cubic inches (1/7 total volume).  With the ends you can do similar (you just cut it at 2/3s) to make a cube with a volume of 3 cubic inches (1/7 total volume).

I also did the actual math (incase my cube visualizations were incorrect) for volume (which was a pain considering all the triangles), but it does equal out into 7 equal pieces.
 BobRodes (Instructor) 8 May 08 17:32
<it creates too many pieces

#### Quote:

How can I cut the bar to allow for fair payment using only 2 cuts.
I don't believe my solution fails to accomplish this, given that two halves have the same amount of gold as one whole and would therefore constitute fair payment.
However, if you wish to change the requirements document after seeing the solution (which never really happens, of course, but we're just having fun here), amending it to say "divide into 7 equally sized pieces" I concede that my solution fails, unless as some have said the two ends of the initial ingot are joined into a cylinder.  I do NOT concede that my solution fails to solve the problem as stated above.
 strongm (MIS) 9 May 08 6:58
The way I have heard this problem expressed (and it helps clarify the origins of the original post's comment about "equally divided into 7 pieces", which in the version in the post doesn't make a lot of sense or add information to the problem) is:

#### Quote:

Microsoft Interview Question
You've got someone working for you for seven days and a gold bar to pay them. The gold bar is segmented into seven connected pieces. You must give them a piece of gold at the end of every day. If you are only allowed to make two breaks in the gold bar, how do you pay your worker?

In this version it is pretty clear that the only way you can divide the bar is by physically breaking the connections between the segments. At which point the binary cut solution becomes the only viable one (ignoring the real world issue, rasied by several, that this would prevent the worker spending any of his money until the end of the week)
 traingamer (Programmer) 9 May 08 11:35

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!