Everything2
Near Matches
Ignore Exact
Full Text
Everything2

NxM chocolate bar solution

created by jliszka

(idea) by jliszka (2.2 y) (print)   ?   (I like it!) Fri Mar 09 2001 at 3:54:47

This is the solution to problem 6 on the hard interview questions node. If you have not read the question, the following will make no sense to you:

There is a simple, one line solution: since every break creates exactly one new piece, n*m-1 breaks are both necessary and sufficient to create n*m total pieces.

There's also a very long and annoying inductive solution, which I won't bother reproducing here.


(idea) by asqui (1.5 y) (print)   ?   (I like it!) Sat Sep 06 2003 at 12:41:05

Here is one way to show that (nm - 1) breaks are sufficient. (It does not, however, demonstrate that (nm - 1) breaks are necessary.)

The block of chocolate has (n-1) and (m-1) 'score lines' on each side, along which it can be broken. By making (n-1) breaks we can produce n long and thin pieces, of size 1 x m. We then need to make (m-1) breaks on each of these long and thin pieces to get them down to 1 x 1 size. ie, n(m-1) more breaks.

This gives us a total of (n-1) + n(m-1) breaks.

(n-1) + n(m-1)
= n - 1 + nm - n
= -1 + nm
= nm - 1
QED


printable version
chaos

hard interview questions I have a most elegant proof of that, but this node is too small to contain it The Eye vs. The Look! Life Saving Information Contained Within! Ghost in the Shell: Stand Alone Complex
beige necessary Ahes QED
Math for Fun and Profit Array duplicates solution Editor Log: March 2008 Imaginary Dances with Marsupial Wolves
cabin fever sufficient Inductive cardinality
standard deviation Boobies Strike Again - Ninjagirls Cleavage Calendar 2008 Q.E.D. Footprints
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Nodes your grandpa would have liked:
The Complete Works of Lewis Carroll
Gargouille
Everything Quests: Games and Distractions
Winemaking
How to tenderize an octopus
bow
Choosing to be gay
Danzayémon, Chief of the Etas
William Walker
Breastfeeding
Pict
Alcoholism
Heroes of Destiny
New Writeups
XWiz
Are you hoping for a miracle?(review)
santo
The Host(review)
LostPsion
"Shut the Fuck Up" Theaters(idea)
Vanish
The line between normal and not(place)
Vanish
insanity(thing)
beatrice
You've been slowly taking me over for nearly a year, do you know that?(idea)
Berek
YouTube(thing)
shaogo
How to Pretend to Have a Job(idea)
hapax
Les Provinciales(review)
zoeb
The Scene(review)
aneurin
Telephone Numbers for drama purposes(idea)
Alnilamski
Cosmicopolis(fiction)
eien_meru
measure(idea)
Dreamvirus
pussy willow(thing)
czeano
Three "T"s(idea)
Everything 2 is brought to you by the letter C and The Everything Development Company