BrainDen.com - Brain Teasers
• 0

# Slicing a Pizza Randomly

## Question

Hey, kids.

Here's a pizza. I'm going to make N random straight cuts. Enjoy!

How many pieces do you expect?

## Recommended Posts

• 0

1+n+n(n-1)/6.

Ok so assuming the random cuts are made by selecting two random numbers in the range 0-2pi and cutting a line between these two points on the circumferential of the pizza.

First note that the probability of having 3 cuts intersect at the same point is 0, so we assume all intersections are between just two cuts.

Also note that all the pieces that result from the cuts are convex.

With these two things in mind, if there were n cuts and c intersections then the number of slices would be 1+n+c, you can convince yourself of that by looking at what happens when you slowly start making a new cut.

So what is c? well for two cuts what is the probability that they intersect? if the first cut was A-B and the second was C-D, then they'd intersect if and only if the values of A B C D were ordered in one of the following forms:

And not the following forms:

ABCD ABDC BACD BADC CDAB CDBA DCAB DCBA

Or another way you can think of it is you choose 4 points on a circle and assign them labels ABCD with equal probability, what is the probability that AB are not neighbors?

So the probability for intersection is 1/3.

Let xi,j be a random variable that gets value 1 if cuts i and j inttersect and 0 otherwise, it's obvious that E[xi,j]=1/3.

It's obvious that c=sum_over_i_and_j(xi,j), we can't calculate the probability for c because xi,j's are not independant, but we can calculate it's mean because the mean is linear doesn't matter if the variables are independant or not, so:

E[c] = E[sum(xi,j)] = sum(E[xi,j]) = n(n-1)/2*E[x1,2] = n(n-1)/2*1/3 = n(n-1)/6

So on average you will get 1+n+n(n-1)/6 slices

Edited by Anza Power
##### Share on other sites

• 0

2*n. As we are conditioned to cut a pizza through the centre, each cut will double the number of pieces. As the cuts are random, the pieces will not be of same size.

Edited by harey
##### Share on other sites

• 0

2*n. As we are conditioned to cut a pizza through the centre, each cut will double the number of pieces. As the cuts are random, the pieces will not be of same size.

Nice try, harey! But you should not think it is so simple! The cuts are not necessarily through the center.

##### Share on other sites

• 0

This is a good question. With every step that I take, it gets more and more complex

I am probably not using the right technique!

##### Share on other sites

• 0

Each time you make a random cut, you'll intersect all of the previous cuts. Some of the pieces may be very small, but there will still be a piece, as the probability of intersecting at a previous intersection is 0.

The number of pieces, therefore, is one more than the sum of 1, 2, 3, 4, ..., N (since zero cuts gives you one piece), which comes out to N (N+1) / 2 + 1

##### Share on other sites

• 0

Each time you make a random cut, you'll intersect all of the previous cuts. Some of the pieces may be very small, but there will still be a piece, as the probability of intersecting at a previous intersection is 0.

The number of pieces, therefore, is one more than the sum of 1, 2, 3, 4, ..., N (since zero cuts gives you one piece), which comes out to N (N+1) / 2 + 1

The cuts are random, not necessarily maximizing number of slices. Otherwise you'd be correct.

##### Share on other sites

• 0

Each time you make a random cut, you'll intersect all of the previous cuts. Some of the pieces may be very small, but there will still be a piece, as the probability of intersecting at a previous intersection is 0.

The number of pieces, therefore, is one more than the sum of 1, 2, 3, 4, ..., N (since zero cuts gives you one piece), which comes out to N (N+1) / 2 + 1

The cuts are random, not necessarily maximizing number of slices. Otherwise you'd be correct.

Oh damn, good point.

##### Share on other sites

• 0

Well, if the maximum number of slices is N(N+1)/2+1 and the minimum is N+1, would the expected just be the average of these two?

(N(N+1)/2+1+N+1)/2

or

(1/4)(n2+3n+4)

##### Share on other sites

• 0

Hi.

Can you please define random cuts? you are stepping into the problem in Bertrand's Paradox.

##### Share on other sites

• 0

Hi.

Can you please define random cuts? you are stepping into the problem in Bertrand's Paradox.

I had random endpoints in mind, but I suppose either of the other methods might make interesting problems too.

##### Share on other sites

• 0

Hi.

Can you please define random cuts? you are stepping into the problem in Bertrand's Paradox.

I had random endpoints in mind, but I suppose either of the other methods might make interesting problems too.

Disclaimer: since this is an original problem, I am not quite sure of my own solution.

I just tried solving the problem with the "random midpoint" and "random radius" methods. I think they may be easier (if I'm not wrong).

I encourage all of you to try solving the problem using all three methods outlined in Anza Power's link.

Whoever finds all three solutions wins a free compliment.

##### Share on other sites

• 0

Whatever the solution is, I'm sure there are more pieces than I can eat.

##### Share on other sites

• 0

Whatever the solution is, I'm sure there are more pieces than I can eat.

Well, the pizza is always the same size, regardless of how many pieces you cut it into.

##### Share on other sites

• 0

I think the answer will be the same as the maximum.

IIIRC you get the maximum value by making cuts that don't go trough the centre and aren't the same as previous ones. The probability of this happening is 0 if you make random cuts.

##### Share on other sites

• 0

1+n+n(n-1)/6.

Ok so assuming the random cuts are made by selecting two random numbers in the range 0-2pi and cutting a line between these two points on the circumferential of the pizza.

First note that the probability of having 3 cuts intersect at the same point is 0, so we assume all intersections are between just two cuts.

Also note that all the pieces that result from the cuts are convex.

With these two things in mind, if there were n cuts and c intersections then the number of slices would be 1+n+c, you can convince yourself of that by looking at what happens when you slowly start making a new cut.

So what is c? well for two cuts what is the probability that they intersect? if the first cut was A-B and the second was C-D, then they'd intersect if and only if the values of A B C D were ordered in one of the following forms:

And not the following forms:

ABCD ABDC BACD BADC CDAB CDBA DCAB DCBA

Or another way you can think of it is you choose 4 points on a circle and assign them labels ABCD with equal probability, what is the probability that AB are not neighbors?

So the probability for intersection is 1/3.

Let xi,j be a random variable that gets value 1 if cuts i and j inttersect and 0 otherwise, it's obvious that E[xi,j]=1/3.

It's obvious that c=sum_over_i_and_j(xi,j), we can't calculate the probability for c because xi,j's are not independant, but we can calculate it's mean because the mean is linear doesn't matter if the variables are independant or not, so:

E[c] = E[sum(xi,j)] = sum(E[xi,j]) = n(n-1)/2*E[x1,2] = n(n-1)/2*1/3 = n(n-1)/6

So on average you will get 1+n+n(n-1)/6 slices

This is correct.

One down, two to go. These should be pretty easy after looking at Anza's solution.

Edited by gavinksong

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.