
The other day, I sat down to eat a 2 Kg block of chocolate - one of those ones that's divided into lots of little squares. I proceeded to recursively subdivide it into smaller and smaller blocks, and then eat the individual squares in depth-first order. It was only after getting through 16 of the things that I stopped to notice that the whole bar just happens to have an exact power of two squares on it. And it was some time after *that* when I thought to myself "...woah, maybe do too much Haskell?" o_O Seriously, who recursively subdivides their food? I think I have something wrong with me...

Maybe I haven't done enough haskell, but enough lisp to NOT eat _2_ Kg
of chocolate.
Did you really think you would get those 2 Kg's down?
/Gf
On Mon, Sep 29, 2008 at 9:43 PM, Andrew Coppin
The other day, I sat down to eat a 2 Kg block of chocolate - one of those ones that's divided into lots of little squares. I proceeded to recursively subdivide it into smaller and smaller blocks, and then eat the individual squares in depth-first order. It was only after getting through 16 of the things that I stopped to notice that the whole bar just happens to have an exact power of two squares on it.
And it was some time after *that* when I thought to myself "...woah, maybe do too much Haskell?" o_O
Seriously, who recursively subdivides their food? I think I have something wrong with me...
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Patience is the last resort for those unable to take action

Gianfranco Alongi wrote:
Maybe I haven't done enough haskell, but enough lisp to NOT eat _2_ Kg of chocolate. Did you really think you would get those 2 Kg's down?
Oh, no. The entire bar is 2 Kg, I wasn't actually planning to eat the whole thing! o_O My god, my pancreas would explode or something...

Oh, yeah, I thought you really meant that you would force that "baby" down. :)
Nice to hear that you wouldn't. Not even "lazy evaluation" would save
you there 7-8 hours later.
;)
/Gf
On Mon, Sep 29, 2008 at 10:00 PM, Andrew Coppin
Gianfranco Alongi wrote:
Maybe I haven't done enough haskell, but enough lisp to NOT eat _2_ Kg of chocolate. Did you really think you would get those 2 Kg's down?
Oh, no. The entire bar is 2 Kg, I wasn't actually planning to eat the whole thing! o_O My god, my pancreas would explode or something...
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Patience is the last resort for those unable to take action

On 9/29/08, Gianfranco Alongi
Oh, yeah, I thought you really meant that you would force that "baby" down. :) Nice to hear that you wouldn't. Not even "lazy evaluation" would save you there 7-8 hours later.
2kg of chocolate 'thunks' to 'force' really might 'blow your stack' later on. Harr Harr :D

Simon Brenner wrote:
2kg of chocolate 'thunks' to 'force' really might 'blow your stack' later on.
Oh my god, this one made me laugh so hard I almost choked on the piece of chocolate I was just eating. It should definitely make it into HWN Quotes of the Week... Cheers Ben

Andrew Coppin wrote:
Oh, no. The entire bar is 2 Kg, I wasn't actually planning to eat the whole thing! o_O My god, my pancreas would explode or something...
My Dad once ate two bars of dark cooking chocolate. He said he got some odd visual distortions; flickering auras around things, and size distortions where small things looked big and big things looked small. Paul.

Paul Johnson wrote:
Andrew Coppin wrote:
Oh, no. The entire bar is 2 Kg, I wasn't actually planning to eat the whole thing! o_O My god, my pancreas would explode or something...
My Dad once ate two bars of dark cooking chocolate. He said he got some odd visual distortions; flickering auras around things, and size distortions where small things looked big and big things looked small.
I understand that chocolate does contain chemicals which are actually moderately toxic. (It just doesn't contain very much of them - or at least, the normal *milk* chocolate doesn't. Dark chocolate would presumably contain more of these.) For what it's worth, 80% of my diet is cheese, and 10% is chocolate. Apparently that particular combination is supposed to have all sorts of dire effects (including severe headaches). I suffer no such symptoms that I'm aware of. Never have. (But then, people tell me they get a "lift" from caffine, and I find no such effect. Nor do I have severe withdrawal symptoms when I stop taking it.) Maybe I'm just weird? (Oh, wait... I use Haskell!) In other news... apparently chocolate is leathaly toxic to dogs. Random.

Hallo, Andrew Coppin wrote:
In other news... apparently chocolate is leathaly toxic to dogs. Random.
Chicolate is extremely toxic to cats. Cheers, -alex http://www.ventonegro.org/

On 2008 Oct 3, at 15:50, Andrew Coppin wrote:
Paul Johnson wrote:
Andrew Coppin wrote:
Oh, no. The entire bar is 2 Kg, I wasn't actually planning to eat the whole thing! o_O My god, my pancreas would explode or something...
My Dad once ate two bars of dark cooking chocolate. He said he got some odd visual distortions; flickering auras around things, and size distortions where small things looked big and big things looked small.
headaches). I suffer no such symptoms that I'm aware of. Never have. (But then, people tell me they get a "lift" from caffine, and I find no such effect. Nor do I have severe withdrawal symptoms when I stop taking it.)
I resemble that. In fact, I have to be careful with caffeine because I won't notice how much I've had until I start having heart palpitations, odd joint aches, and other signs of caffeine overdose.
In other news... apparently chocolate is leathaly toxic to dogs. Random.
And cats. Theobromine is fun stuff, as I said. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

What /is/ it with haskell-cafe lately? Do we need a haskell-blah mailing list? I would subscribe to that. Hell, I would post to it probably more than I post to haskell-cafe. But I'd also divert it to a separate mailbox for when I have too much free time. Maybe call it haskell-cafe-cafe? not-haskell? --Lane

On 2008 Oct 3, at 21:01, Christopher Lane Hinson wrote:
What /is/ it with haskell-cafe lately?
Do we need a haskell-blah mailing list? I would subscribe to that. Hell, I would post to it probably more than I post to haskell-cafe. But I'd also divert it to a separate mailbox for when I have too much free time.
Oddly enough, it seems to me that haskell-*cafe* identifies a list that isn't tightly focused, as compared to haskell@haskell.org. Perhaps we need to rethink names (although any changes will probably hurt). -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

On Fri, 3 Oct 2008, Brandon S. Allbery KF8NH wrote:
Oddly enough, it seems to me that haskell-*cafe* identifies a list that isn't tightly focused, as compared to haskell@haskell.org. Perhaps we need to rethink names (although any changes will probably hurt).
I thought this too. But, I think that haskell-cafe is high traffic, whereas people subscribe just to haskell@haskell.org when they just want announcements and HWN (which has been awesome lately, by the way). But I think a discussion e.g. about providing medical treatment to prisoners of war might benefit both haskell-cafe and the discussion itself to be on another list. Especially as the community is growing rapidly, it might benefit from having an outlet for all of this energy. I think just putting a little note beside the mailing list "high traffic" as opposed to "off topic" before you get to the subscribe step would suffice, without needing to change names. --Lane

Christopher Lane Hinson wrote:
What /is/ it with haskell-cafe lately?
Do we need a haskell-blah mailing list? I would subscribe to that. Hell, I would post to it probably more than I post to haskell-cafe. But I'd also divert it to a separate mailbox for when I have too much free time.
Maybe call it haskell-cafe-cafe? not-haskell?
I must admit, I have a bunch of abstract math questions I'd like answers to, and the people round here seem like the kind of folks who might know the answers. But this has nothing at all to do with Haskell, so Cafe doesn't seem like a good place to ask...

On Sun, 05 Oct 2008 13:54:08 +0100, Andrew Coppin
Christopher Lane Hinson wrote:
What /is/ it with haskell-cafe lately?
Do we need a haskell-blah mailing list? I would subscribe to that. Hell, I would post to it probably more than I post to haskell-cafe. But I'd also divert it to a separate mailbox for when I have too much free time.
Maybe call it haskell-cafe-cafe? not-haskell?
I must admit, I have a bunch of abstract math questions I'd like answers to, and the people round here seem like the kind of folks who might know the answers. But this has nothing at all to do with Haskell, so Cafe doesn't seem like a good place to ask...
In that case, how about creating a Haskell-Lounge mailing list, exclusively for topics tangential to Haskell? Either that, or just ensure that most off-topic/tangential topics are prefixed "[OT]?" -- Benjamin L. Russell

On Oct 3, 2008, at 15:38 , Paul Johnson wrote:
Andrew Coppin wrote:
Oh, no. The entire bar is 2 Kg, I wasn't actually planning to eat the whole thing! o_O My god, my pancreas would explode or something... My Dad once ate two bars of dark cooking chocolate. He said he got some odd visual distortions; flickering auras around things, and size distortions where small things looked big and big things looked small.
Theobromine is interesting stuff. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

On Mon, Sep 29, 2008 at 12:43 PM, Andrew Coppin wrote: The other day, I sat down to eat a 2 Kg block of chocolate - one of those
ones that's divided into lots of little squares. I proceeded to recursively
subdivide it into smaller and smaller blocks, and then eat the individual
squares in depth-first order. It was only after getting through 16 of the
things that I stopped to notice that the whole bar just happens to have an
exact power of two squares on it. And it was some time after *that* when I thought to myself "...woah, maybe
do too much Haskell?" o_O Seriously, who recursively subdivides their food? I think I have something
wrong with me... You may have applied divide and conquer but I suspect your updates were
destructive. Are you sure it's too much Haskell that is the problem? :-)
Jason

Andrew Coppin wrote:
The other day, I sat down to eat a 2 Kg block of chocolate - one of those ones that's divided into lots of little squares. I proceeded to recursively subdivide it into smaller and smaller blocks, and then eat the individual squares in depth-first order. It was only after getting through 16 of the things that I stopped to notice that the whole bar just happens to have an exact power of two squares on it.
And it was some time after *that* when I thought to myself "...woah, maybe do too much Haskell?" o_O
Seriously, who recursively subdivides their food? I think I have something wrong with me...
You're not alone: http://xkcd.com/245/

Anton van Straaten wrote:
You're not alone:
Heh. Randel appears to have not heard of Haskell. He thinks _Lisp_ is the ultimate language. ;-)

Hallo, Andrew Coppin wrote:
Anton van Straaten wrote:
You're not alone:
Heh. Randel appears to have not heard of Haskell. He thinks _Lisp_ is the ultimate language. ;-)
Well, at least he's close, let's wait till he finds out about Scheme. :-) Cheers, -alex http://www.ventonegro.org/

Andrew Coppin wrote:
The other day, I sat down to eat a 2 Kg block of chocolate - one of those ones that's divided into lots of little squares. I proceeded to recursively subdivide it into smaller and smaller blocks, and then eat the individual squares in depth-first order. It was only after getting through 16 of the things that I stopped to notice that the whole bar just happens to have an exact power of two squares on it.
And it was some time after *that* when I thought to myself "...woah, maybe do too much Haskell?" o_O
Seriously, who recursively subdivides their food? I think I have something wrong with me...
A much more important question is: how many "break bar in two" operations did you perform? Can you do it with less? Regards, apfelmus

It seems like if your primitive operation is "break bar in two" you
need exactly n-1 breaks to get n squares, no matter what choice you
make for where to break along the chocolate grid. This is a simple
consequence of the fact that each break increases the number of pieces
by one.
If you're allowed to hold multiple pieces in your hand when you do the
break it's different. Then you need a model of how the hands hold the
chocolate. I think there is a problem when the breaks get
complicated, as if you have to hold the pieces for too long while
setting up the break, some of the chocolate will melt onto your
fingers.
-- ryan
On Tue, Sep 30, 2008 at 12:56 AM, apfelmus
Andrew Coppin wrote:
The other day, I sat down to eat a 2 Kg block of chocolate - one of those ones that's divided into lots of little squares. I proceeded to recursively subdivide it into smaller and smaller blocks, and then eat the individual squares in depth-first order. It was only after getting through 16 of the things that I stopped to notice that the whole bar just happens to have an exact power of two squares on it.
And it was some time after *that* when I thought to myself "...woah, maybe do too much Haskell?" o_O
Seriously, who recursively subdivides their food? I think I have something wrong with me...
A much more important question is: how many "break bar in two" operations did you perform? Can you do it with less?
Regards, apfelmus
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

I often wonder how many cuts you need to divide a steak in n pieces. You can obviously get n pieces with (sqrt n) cuts by cutting a grid. But I'm sure some smart mathematician thought of a (log n) way. Adrian Am 29.09.2008 um 21:43 schrieb Andrew Coppin:
The other day, I sat down to eat a 2 Kg block of chocolate - one of those ones that's divided into lots of little squares. I proceeded to recursively subdivide it into smaller and smaller blocks, and then eat the individual squares in depth-first order. It was only after getting through 16 of the things that I stopped to notice that the whole bar just happens to have an exact power of two squares on it.
And it was some time after *that* when I thought to myself "...woah, maybe do too much Haskell?" o_O
Seriously, who recursively subdivides their food? I think I have something wrong with me...
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Tue, 30 Sep 2008 19:54:17 +0200, Adrian Neumann
I often wonder how many cuts you need to divide a steak in n pieces. You can obviously get n pieces with (sqrt n) cuts by cutting a grid. But I'm sure some smart mathematician thought of a (log n) way.
Good thing that the chocolate slab was only 2 kg and of finite length. Had it been of infinite length, we would need Dedekind cuts to partition it.... ;) -- Benjamin L. Russell

Benjamin L.Russell wrote:
On Tue, 30 Sep 2008 19:54:17 +0200, Adrian Neumann
wrote: I often wonder how many cuts you need to divide a steak in n pieces. You can obviously get n pieces with (sqrt n) cuts by cutting a grid. But I'm sure some smart mathematician thought of a (log n) way.
Good thing that the chocolate slab was only 2 kg and of finite length. Had it been of infinite length, we would need Dedekind cuts to partition it.... ;)
You know, it's interesting... I posted this in another forum, and people just said "dude, why would you try to eat a whole 2 Kg of chocolate? That's really unhealthy." I post the same thing here and now people are arguing about Dedekind cuts... da HELL?! o_O An interesting dichotomy of perspectives, don't you think?

On 2008 Oct 1, at 15:56, Andrew Coppin wrote:
Benjamin L.Russell wrote:
On Tue, 30 Sep 2008 19:54:17 +0200, Adrian Neumann
wrote: I often wonder how many cuts you need to divide a steak in n pieces. You can obviously get n pieces with (sqrt n) cuts by cutting a grid. But I'm sure some smart mathematician thought of a (log n) way.
Good thing that the chocolate slab was only 2 kg and of finite length. Had it been of infinite length, we would need Dedekind cuts to partition it.... ;)
You know, it's interesting... I posted this in another forum, and people just said "dude, why would you try to eat a whole 2 Kg of chocolate? That's really unhealthy." I post the same thing here and now people are arguing about Dedekind cuts... da HELL?! o_O
An interesting dichotomy of perspectives, don't you think?
And if you'd posted on the LOPSA (http://lopsa.org) list it would probably be a discussion of which OS is which kind of chocolate. So? :) -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

On Wed, 2008-10-01 at 20:56 +0100, Andrew Coppin wrote: . . .
You know, it's interesting... I posted this in another forum, and people just said "dude, why would you try to eat a whole 2 Kg of chocolate? That's really unhealthy." I post the same thing here and now people are arguing about Dedekind cuts... da HELL?! o_O
An interesting dichotomy of perspectives, don't you think?
Maybe the dichotomy is in the distribution of free-wheeling imagination. I'm reminded of the (apocryphal?) story about Hilbert's assessment of poetry and mathematics. -- Bill Wood

Jon Fairbairn
Adrian Neumann
writes: I often wonder how many cuts you need to divide a steak in n pieces. You can obviously get n pieces with (sqrt n) cuts by cutting a grid. But I'm sure some smart mathematician thought of a (log n) way.
Are you allowed to move the pieces between cuts?
Later you're also going to demand to bend it in N dimensions, aren't you? -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or quoting of this signature prohibited.

Are we assuming the bars to have an even distribution of mass along
the whole body?
On Wed, Oct 1, 2008 at 2:10 PM, Achim Schneider
Jon Fairbairn
wrote: Adrian Neumann
writes: I often wonder how many cuts you need to divide a steak in n pieces. You can obviously get n pieces with (sqrt n) cuts by cutting a grid. But I'm sure some smart mathematician thought of a (log n) way.
Are you allowed to move the pieces between cuts?
Later you're also going to demand to bend it in N dimensions, aren't you?
-- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or quoting of this signature prohibited.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Patience is the last resort for those unable to take action

Achim Schneider wrote:
Jon Fairbairn
wrote: Adrian Neumann
writes: I often wonder how many cuts you need to divide a steak in n pieces. You can obviously get n pieces with (sqrt n) cuts by cutting a grid. But I'm sure some smart mathematician thought of a (log n) way. Are you allowed to move the pieces between cuts?
Later you're also going to demand to bend it in N dimensions, aren't you?
If extra dimensions are needed, perhaps the LHC could be pressed into service. Any Haskell programmers working there? I'm sure we could settle many of these questions by injecting some chocolate particles into the accelerator. Who among us hasn't wondered what chocolate looks like when traveling at relativistic speeds? Best case, we produce an infinitely dense micro-black hole made of chocolate, which pretty much takes care of the whole recursive subdividing problem. Plus, when popped into your mouth, it would evaporate via the tastiest Hawking radiation imaginable. Anton

Achim Schneider
Jon Fairbairn
wrote: Adrian Neumann
writes: I often wonder how many cuts you need to divide a steak in n pieces. You can obviously get n pieces with (sqrt n) cuts by cutting a grid. But I'm sure some smart mathematician thought of a (log n) way.
Are you allowed to move the pieces between cuts?
Later you're also going to demand to bend it in N dimensions, aren't you?
I don't know about you, but I demand that my steaks have at
least four dimensions (in particular they should be much
larger in the fourth than an éclair), but as to bending, no,
to get to log n you wouldn't need that. If you allow it to
be arbitrarily bendable, you can do it in one cut, except
that I imagine there's an unstated requirement that
all (map ((

Adrian Neumann
I often wonder how many cuts you need to divide a steak in n pieces. You can obviously get n pieces with (sqrt n) cuts by cutting a grid. But I'm sure some smart mathematician thought of a (log n) way.
You might try the ham sandwich theorem http://en.wikipedia.org/wiki/Ham_sandwich_theorem as an hors d'oeuvre.

Throw the "no free lunch"-theorem on top of that.
http://en.wikipedia.org/wiki/No_free_lunch_theorem
On Wed, Oct 1, 2008 at 3:33 PM, Dominic Steinitz
Adrian Neumann
writes: I often wonder how many cuts you need to divide a steak in n pieces. You can obviously get n pieces with (sqrt n) cuts by cutting a grid. But I'm sure some smart mathematician thought of a (log n) way.
You might try the ham sandwich theorem http://en.wikipedia.org/wiki/Ham_sandwich_theorem as an hors d'oeuvre.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Patience is the last resort for those unable to take action

The Wikipedia says:
"For a finite set of points in the plane, each colored "red" or "blue", there is a line that simultaneously bisects the red points and bisects the blue points, that is, the number of red points on either side of the line is equal and the number of blue points on either side of the line is equal."
Does this work with more than two colours? i.e. can I recursively subdivide the halves into quarters with another cut?
Am 01.10.2008 um 15:33 schrieb Dominic Steinitz:
Adrian Neumann
writes: I often wonder how many cuts you need to divide a steak in n pieces. You can obviously get n pieces with (sqrt n) cuts by cutting a grid. But I'm sure some smart mathematician thought of a (log n) way.
You might try the ham sandwich theorem http://en.wikipedia.org/wiki/Ham_sandwich_theorem as an hors d'oeuvre.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Adrian Neumann
Does this work with more than two colours? i.e. can I recursively subdivide the halves into quarters with another cut?
I don't think so. In order to divide a group, a line needs to pass through somewhere "in the middle", or more precisely, it must intersect the convex hull of the group. Now group each category together so that their convex hulls don't overlap. A solution with two lines and four categories would require the two lines would need to have four disjoint points of intersection. Which is too many. :-) -k -- If I haven't seen further, it is by standing in the footprints of giants

G'day all.
Quoting Adrian Neumann
I often wonder how many cuts you need to divide a steak in n pieces.
One, if the cut is allowed to be curved and self-intersecting. I think that the spirit of the problem, though is encapsulated in this question: Given a circle, what is the maximum number of pieces that you can divide it into by performing n straight cuts? This is a great problem to set undergraduates, because if you work out some small values of n on paper, you get: n #pieces 0 1 1 2 2 4 3 7 Most undergrads will stall at this point trying to work out how to place the third line to get 8 pieces, and probably come up with an incorrect justification for why it should be 2^n. The details are here: http://www.research.att.com/~njas/sequences/A000124 Cheers, Andrew Bromage
participants (23)
-
Achim Schneider
-
Adrian Neumann
-
ajb@spamcop.net
-
Albert Y. C. Lai
-
Alex Sandro Queiroz e Silva
-
Andrew Coppin
-
Anton van Straaten
-
apfelmus
-
Ben Franksen
-
Benjamin L.Russell
-
Bill
-
Brandon S. Allbery KF8NH
-
brian
-
Christopher Lane Hinson
-
Dominic Steinitz
-
Gianfranco Alongi
-
Jason Dagit
-
Jon Fairbairn
-
Ketil Malde
-
Miguel Mitrofanov
-
Paul Johnson
-
Ryan Ingram
-
Simon Brenner