I think I know where the round cake is going, namely that "cutting at random" isn't defined rigorously enough. (Spoilers below) You could pick (1) two points on the circumference uniformly, or (2) an angle and a distance from the center uniformly, or (3) an angle and a _point inside the cake_ uniformly, and those won't be the same distributions. For example, (1) will produce many very uneven cuts, 50% where the endpoints are at most 90° apart, (2) will produce fewer (50% will have the endpoints at most 120° apart), and (3) still fewer, since the very uneven cuts are even less common than in option (2).
My thought is that this is equivalent to the problem: "Given three points on a line, if you pick one at random, what is the probability that you pick the middle one." And of course, the answer is 1/3.
at 1:30 in I'm going to say the chance is 1/3 since this situation is analogous to picking three points on the cake, then picking one of the three points to be the cut and letting the other two be the candles. For every possible triplet of points each piece has a candle exactly when the middle point is chosen as the cut. There is a 1/3 chance of the middle point being picked, hence the answer is 1/3.
My thoughts exactly. He didn't make it very explicit at the start that the uniform selection of positioning was from end of cake to end of cake for both candles and knife (rather than randomly positioning the second candle somewhere in front of the first candle for example) but I assumed he meant that.
I immediately went to my trusted integrals, and calculated 2 times the integral from 0 to 1 of x*(1-x) dx; so the chance of any candle being to the left of the cut, multiplied by the chance of any candle being to the right of the cut, this for every cut, and multiplied by 2 because it doesn't matter which candle is to the left of the cut, and which is to the right of the cut. This yielded 1/3 as the probability.
I went for the same approach right away. A clever argument is neat and all, but in the end of the day if the problem is already well defined, a trick might work or not, but you can try calculating and know pretty fast if it's reasonable to solve that way :)
Ben Sparks is rapidly becoming one of my favourite numberphile presenters. He has this very gentle "older brother" vibe and presents things in a way that gets me thinking on deeper levels. Great video!
Yes, when I paused this is how I started to go about it in my head. Obviously the chance of the cut being between the two candles is the average distance between the candles, and then I realized that I didn't know how to answer that either. I did think about Monte Carlo methods but then realized there was a much easier way to answer the question, which was to unpause the video.
Another way I was thinking about this, was: With 2 candles, they will segment the cake into 3 separate regions that add up to the total cake. As it's all random, there is no reason to think any region is going to be larger or smaller than any other, so there's no reason to expect the cut to have anything but an equal chance to hit each of the three regions, specifically the region between the two candles, or a 1/3 chance.
Another way to think of the intuition for the "ordering" method is to imagine that instead of two candles and a cut, it's two blue candles and one red candle. Then we'll take out the red candle and cut wherever it landed. Hence, we're really just asking what the chance is that the red candle is the middle one of the three. If we place all three randomly, each candle has a 1/3 chance of being in the middle, so our answer is 1/3. Much more intuitive than the first way I did it, as an integral from 0 to 1 of 2k(1-k) dk... though that also gets the right answer.
Fourth method: calculus! Let the cut be at the number x. We win if one candle is less than x and the other candle is greater than x, which occurs with probability 2x(1-x). Integrating this from 0 to 1 gives 1/3. [Similarly, the probability that both candles are less than x is x^2, and the probability that both candles are greater than x is (1-x)^2, each of which also integrates to 1/3.]
my thought is the probability of the cut being between the two candles, since the length of the cake is one, is the same as the average distance between the candles. if that's the case then we also know the average distance of two random points on a line through probability
I simulated it on Excel - twenty thousand cakes - and got 0.33 with a lot of variation after the second decimal place. It gets to a third but surprisingly slowly, takes a lot of cakes.
Here's my method: Suppose the cut is at point X ∈ [0, 1] The probability that a candle is to the left is X. The probability that a candle is to the right is 1 - X. This means that the probability that they are on different sides is: X * (1 - X) + (1 - X) * X which is equal to: 2 * X - 2 * X² Now we are going to divide the [0, 1] interval in segments of length ΔX, and average over each possibility, we get: Σ (2 * X - 2 * X²) * ΔX summing over X going from 0 to 1 by steps of length ΔX. Now we take the limit when ΔX goes to 0, the sum becomes an integral: ∫ (2 * X - 2 * X²) dX from 0 to 1, which is equal to: [ X² - 2/3 * X³ ] evaluated between 0 and 1: ( 1² - 2/3 * 1³ ) - ( 0² - 2/3 * 0³ ) = 1/3 - 0 = 1/3
This was a fun one to try before watching. Began by trying a case with N equally spaced discrete candle positions where the knife could cut in a continuous range. Running the numbers gave a general formula for the probability for N positions as (N+1)/(3(N-1)), taking the limit for N -> infinity to get 1/3.
12:26 "And now you're going to record a thousand shots of me randomly cutting a cake" Not gonna lie, was half expecting this to suddenly cut to Matt Parker there...
When he got to the bit where he was asking whether we had to be able to distinguish one candle from the other or if their identical, I’m reminded of the old physics problems where everything is a sphere of uniform density.
Of course, if the cake was ACTUALLY a Battenberg, you could also talk about what colour order the squares in the cut could be, since they alternate. Wouldn't that be fun!
As a further check, we know the probability density function of the uniform distribution. So we can label the candles x and y, and the cut z, and just calculate the probabilities x < z < y and y < z < x and add them up. The actual calculation is left as an exercise for the student. (But it better be 1/3.)
My initial thought was 1/3, and this was my thinking: The two candles divide the cake into 3 segments of random length (the segment to the left of the leftmost candle, the one to the right of the rightmost candle, and the segment between the two candles). The cut will come in randomly on one of those 3 segments. it seems reasonable to assume that, on average, each of those segments would be of equal value. Or put another way, there seems to be no reason to assume that any one of those segments would be bigger nor smaller than any other, on average. Since only one of those segments, the one between the two candles, would satisfy the problem, that gives a result of 1/3.
That was basically my same thought, as well. But then, I couldn't figure out the problem with this reasoning. Add a cut and a candle randomly on the cake, on average there should be a 50% chance of a candle being on one side or the other of the cut, so adding just 1 more candle you either double up a one of the sides or get your preferred single candle on each side. That would be a 50% chance. But we already know the answer is 1/3. I realized that I can't do those first averages, as on each trial, the cut is almost never going to be right in the middle, so it's not actually a 50% chance for the first candle, nor the 2nd candle, there is some kind of [candle location]^2 happening, which is not being accounted for by averaging the first two, and then adding the last candle.
My thought was 1/3. My thinking: There's 3 things, so surely it's 1/3. Then I also went: Maybe it's a pi related thing because everything is pi related. So my second guess was 1/pi. I can't be bothered to think much.
I gave it a try and got 1/3. Time to watch the video and see the correct answer! Edit: Yay, I got it! I used an integral but the geometric solution is my favourite. It is crazy how many approaches exist for such simple problem.
Another way to look at the problem is to say there are n+1 evenly spaced holes (including the edges of the cake) you can put the candles in. Assuming your cake is one unit long, the probability of your knife falling between the candles is proportional to the distance between them. For n+1 pegs, this gives us n*(n+1)/2 configurations, so the probability of falling between the candles is the sum of the distances of each configuration divided by the number of configurations. The sum of said distances turns out to be the sum of the first n triangular numbers divided by n, so the overall equation simplifies to 2/(3n)+1/3. As n approaches infinity, the probability approaches 1/3.
My initial thought: calculate the average distance between the two candles, call it d. Then then probability that the knife hits between the two candles is d/D, where D is the length of the cake. Checked it and it gives 1/3.
I tried to do It but isn't the average distance 0.25 giving the cake lenght Is 1? Like: On average a candle will end up at 0.5 cuz the average of 0 and 1 Is 0.5 The second candle also has a range 0 to 1, and because the 1st candle on average will end up at 0.5 the maximum distance Is 1-0.5= 0.5 Now on knowing the distance can be anywhere from 0 to 0.5 web know the average distance Is 0.25... I certaintly did something wrong...
I ckd it and got 37.5% which is supported by his "slightly higher than 1/3" brute force method (37.5% is 3/8 which is is slightly higher than 1/3 aka 3/9) C1 can, equally likely fall anywhere from the end to the middle. If C1 falls at the end the avg distance between the candles is 1/2 the total distance. (Cuz C2 on avg falls in the middle). So 50-50 chance cut is in the middle if C1 is falls in the middle, C2 will avg 1/4 the total distance from C1. (Cuz, again C2 on avg falls between C1 and the end). So 25% chance cut is in hte middle So the avg distance between the candles is (1/2 + 1/4)/2 = 3/8 the total distance. Hence 3/8 of the time the cut will divide the candles
another method: let the cake have a length of 1. let x be the distance from the end of the cake at which the cake is cut. as such, it is also the amount of the cake on one slice. 1-x is the amount of the cake on the other slice. then, the probability that both candles are on different slices, given a cut x, will be the probability that they are not on the same slice. this works out to 1-(x^2+(1-x)^2). to find the total probability, take the integral between 0 and 1.
@@jamielondon6436 no, it assumes that the probability of being to the left of the cut is x, as one interpretation. If the cut is 43% of the way through the cake, the probability that the first candle is on the left is 43%, which is x. Conversely, the probability that the first candle is to the right of the cut is 57%, which is 1-x.
The crucial part of the ordering approach is that because each items position comes from the same distribution independently any permutation is equally likely (one reason is the computation of P(a
My initial thoughts: find the average interval between the candles, then that size (normalize the whole cake to 1 for simplicity) is the probability of a uniform thing falling in that range.
@@Nomen_Latinum my bad, I mean we cant pull the answer straight by just knowing the distribution. Thats where mathematician and statistician is different; the way they approach problems.
@@iPlayDotaReligiously I'm not exactly sure what you mean. The distribution tells us all we need to know about the problem. In fact, as long as we assume the distribution is continuous and it is the same for both candles and the cut, it doesn't matter what the distribution is-the answer will still be 1/3.
@@Nomen_Latinum that is my point, if we were too accustomized with something that is more advanced, then we prolly would forgot that it isn't needed to be that advance to solve the problem.
You can also integrate the probability that the candles fall on either side of the knife, which is the integral from zero to one of x*(1-x) dx, but you need to multiply the result by two because the candles could swap places at every knife position.
My guess before I watch the whole thing, let's see if I'm right: the probability is the volume of the set of points in the unit cube that satisfy x < y < z ∨ z < y < x. This set consists of two disjoint sets of the same volume. Each of those is a tetrahedron, a pyramid with with half-triangle of the unit square as the base and unit as the height, so its volume is 1/3 * 1/2 * 1 = 1/6, and the answer should be twice that i.e. 1/3.
The combinatorial solution is probably the most elegant… but let me share another! First , I want to note that if the cake has length 1, the chance that the knife lands between the candles is exactly the same as the average distance between the two candles. What is this distance? Call it ‘x’ for now and consider the following recursive argument. The two candles could be distributed either one in each half of the cake, or both in the same half, each with probability 1/2. In the first case, one candle will be on average 1/4 of the way along the cake, the other on average 3/4 of the way making for an average distance of 1/2. In the second case, we end up with the same problem but on a cake half the size , ie what’s the average distance between two candles on a cake of size 1/2? Which would be our ‘x’ but divided by 2. So we must then have that x = 50%*1/2 + 50% * x/2, which can be rearranged to find x=1/3
There's of course infinite solutions to this problem, but the one that came most naturally to me was to solve the integral of 2 * x * (1-x) dx from 0 to 1 - the chance of a candle on each side given x, the position of the cut. This value is of course 1/3. Edit: I originally wrote (x-1), but this should be (1-x).
That's what I did, too. I also noticed that it was definitely going to be less than 1/2, because having the cut in the best possible place (the middle) gives 1/2 for the question, and it's less likely down to 0 as the cut is closer to one end than the other.
@@MCRuCr After the position of the cut is determined -- x, there are some cases that might happen. Candle 1 can be lower or higher than the cut, and candle 2 can be lower or higher than the cut. The cut is somewhere from 0 to 1, a range of size 1, so the probability of candle 1 being lower than the cut is the size of the area lower than the cut divided by the whole size of the cake: x / 1 = x. The probability that candle 1 is higher than the cut is (1 - x). The probabilities are the same for candle 2. We want either 1 lower and 2 higher, or 1 higher and 2 lower. Therefore x * (1-x) + (1-x) * x = 2 * x * (1-x).
If you write a simulation you have to generate three random numbers and choose what order to assign them. You can assign them candle 1, candle 2, and knife or candle 2, knife, candle 1, or whatever. As we saw in the video, there are 6 ways to assign these random numbers (6:40). If you have three random numbers, one will always be in the middle (ignoring when two or more are the same), and it will be in the middle in two ways--c1=smallest, knife=middle, c2=largest or c1=largest, knife=middle, c2=smallest--that means that two out of the six ways will have the knife in the middle, giving one third.
My initial impulse was to draw a tree diagram, starting with three sided dice and the probability to get the third number in between the first two. Then I moved forward to a four sided dice, then a five sided dice, and then I was thinking about doing complete induction to prove that for any given sided dice the chances will be 1/3. I love it how many different ways are found in the video and the commentary to solve the problem
Before Numberphile, I never would have paused the video, worked out a guess, then come up with two less mathematically rigorous but more intuitive (to me, only) versions of the first solutions shown. I don't know the formal math as well as I ought, but with all the cool problem solving you see on this channel (and Grant's as well), it's made a difference. I really was shocked at how close my methods were to the proper methods in the video. Keep up the great work.
My first intuition was Monte Carlo. I also considered Integration. But the ordering method mentioned in the video is just the most delicate and smartest method. Thank you.
First guess: 2 out of 6. Explanation: 1 cut and 2 candles will end up in a row with a random distribution. Short answer, there is 1/3 of a chance that the cut ends up in the middle.
Pretty easy to show the 1/2 guess is wrong: if the cut is in the middle, the odds are 1/2, and if the cut is towards one edge, the odds are very small, so the answer must be smaller than 1/2. (This leads to a solution by integration.)
This is exactly how I reasoned it should be less than 1/2. Suppose the cake is kut at x (between 0 and 1). Then the probability of candle A being “before” the kut is x, and the probability of candle B being “after” the kut is 1-x. So the probability of both happening is x(1-x). Similarly the probability of candle B being “before” and candle A being “after” is also x(1-x). So we integrate 2x(1-x) from 0 to 1 and see that this does indeed equal 1/3!
33% - you've got 3 points on one line. Non of the points is unique, they are all the same, so there is the same probability that any of them is in the middle between two others. Each piece of cake has one candle only when the "cutting" point is in the middle, so 1 case out of 3.
2:25 - It's not just that the cut can't happen where the candle is. Random placement ought to say if the candles can be together or have some minimum space between.
Before I watch this all through, I just took the cake to be of length 1 and the cut at distance x from one end. Then the probability of any single candle being in the first section is simply x, which means that the probability of it note being in that section is 1-x of course. So the possibility of both being in the first section is p(2)= x^2, and of none being p(0)=(1-x)^2. That must mean the probability of just 1 is 1-p(0)-p(2)=1-1+2x-x^2-x^2=2x-2x^2. Now integrate 2x-2x^2 between the limits of 0 & 1 and you get [x^2-x^3/3+c] between the limits of 0 and 1, which works out at 1-2/3+c-c = 1/3. So I make the probability of each piece having exactly one candle 1/3. I'm sure there's a much simpler and elegant way of doing it, but my approach wasn't too difficult. That's assuming I have it right of course... my particular trick for sanity checking such problems is to cheat and use Excel to model it in actual numbers, which is not something mathematicians might approve of. *** now I've watched the video, it seems I have used a completely different technique, albeit it feels like a sledgehammer to break a nut.
I followed a similar approach, although concluding from a geometrical argument. In my case putting cut position on the x-axis and then figuring out a "success-function of putting the candles on seperate pieces" f(x) = x*(1-x) that serves as the upper bound of an area together with the axis, integrating that area and scale it to the total possibility space. Turns out to be the same integral that you got algebraically exept for a scale factor, due to the candles being interchangeable, which is where the 2 comes from. TLDR: Got the same result with the same calculations, just performed in a different order.
A slightly less elegant way I solved this is a double integral: Integral from 0 to 1 of (Integral from 0 to 1 of ( | x - y | ) with respect to x) with respect to y. I imagine this as a function f(x,y) mapping the positions of the two candles to a probability that the cut will be between them. Thus forming a probability distribution not-unlike the cube shown in the video. This probability distribution can be summed to yield the 1/3 chance.
i tried that first as well and then thought it was incorrect, only because symbolab gets this integral incorrect, says it equals 0 which i knew wasn't the answer
My solution was to make the cake granular with n be the number possible locations the candles can be placed at. Then: 1. the probability of the two candles being k steps from each other is 2*(n-k)/n^2 2. the probability of the cut happening between the candles, when they are k steps apart, is k/n Which means that the total probability of the cut happening between the two candles is lim(n -> inf) of sum(k = 1...n) of the above two numbers multiplied together. Which is 1/3.
it's crazy... I immediately went to calculate the integral (as many others did as well) and was just blown away by the simplicity of the ordering approach...
My initial solution: Suppose the cake has length 1 and the cut is at position x. The probability of putting a candle on either slice is just equal to the size of the slice, so the probability of getting one candle on either side is: P(x) = x*(1-x) + (1-x)*x Where we get two terms for whether the first candle is before or after the cut. Simplifying this gives us: P(x) = 2 ( x - x^2 ) Now, the cut position is also random so we need to integrate this from 0 to 1: P = ∫ P(x) dx = 2 ( ½ x - ⅓ x^3 ) P = 2 ( ½ - ⅓ ) P = ⅓ I came up with the ordering solution afterwards though, since this way didn't seem very elegant...
Place first candle then cut the cake. The cake can now be represented by three regions: - from edge to candle, - from candle to cut, -from cut to the other edge. By symmetry there is no reason for any of those regions to be bigger than to other. As only one of those equal regions result in success we conclude that the probability is 1/3. By symmetry the different ordering of placing candles and cuts yields the same answer.
So proud that my initial guess was ~30% haha. My reasoning was: - For there to be a 50% or higher chance, the candles have to be at least half a cake apart. If they're less than half a cake apart, there's a more than 50% chance they'll end up on the same side. - There are more configurations where the candles are less than half a cake apart, because if they're close together you can put them anywhere on the cake, whereas putting them half a cake apart constrains you more on where you could put each candle. So I was fairly sure it was going to be less than 50%.
This might put me too far in the applied mathematics camp, but my solution was to take a double integral. The probability of cutting the cake in between two candles at points x and y, since the distance is 1, is given as abs(y-x). Therefore, you can take an integral from 0 to 1 of (the integral from 0 to x of (y-x) dy) dx. Which evaluates to 1/6, however, the function z=abs(y-x) is symmetric across y=x, so you can simply multiply the 1/6 by 2 to get 1/3. Essentially you are just looking at two equal triangles which divide the square region of {(x,y)|0
My very first guess was actually 1/3, but I second-guessed myself to 1/2. Clearly, I should've stuck with my first idea. Anyway my solution was pretty simple. Instead of either treating the candles as indistinguishable (which I think makes the math more confusing), or dealing with them independently (which gives you unnecessary possibilities to check), I just declared that _a_ was the leftmost of two independently chosen random cuts, and _b_ was the rightmost one (if you want to get pedantic, call the original two independent points a´ and b´ and define a=min(a´, b´), b=max(a´, b´)). Since I assign the labels after choosing the points, this doesn't affect the distribution, as I still choose two independent random points. Then I applied Bayes' theorem to turn P(a < c < b) into P(a < c|c < b) * P(c < b). P(c < b) is clearly 1/2, and I started considering how to solve the conditional, and started doing case analysis, but while working that out I realized that I hadn't fully considered my initial precondition of a < b, which had the consequence that their average positions were no longer in the center. That gave me a much simpler method, going straight from the problem statement to the solution. Intuition told me that randomly selected ordered values should be evenly spaced on average, so avg(a) = 1/3 and avg(b) = 2/3. I didn't immediately know how to actually prove this, but a quick numerical simulation confirmed that they do in fact tend toward those values for large sample sizes. Then, the probability that the cut position c, chosen independently of a and b, was between a and b, is P(avg(a) < c < avg(b)) = P(1/3 < c < 2/3), which is trivial to solve: just subtract the lower bound from the higher one to find the size of the middle range. (Note that it's important that c doesn't get included in the 'evenly spaced' consideration from before, changing the averages to {1/4, 2/4, 3/4}, because then you have to do the full case analysis and you're effectively just doing the proof from ordering in the video with extra steps.) I'm ignoring the cases where any of the points are equal because those have probability 0 (the probability of picking a particular element out of an uncountably infinite set is 0). They were also ignoring this in the video too, when they decided not to consider the case of 'cutting a candle in half'. I could address it, and it probably wouldn't even complicate anything much, but by definition it doesn't affect the result so I just excluded those cases and used < everywhere.
As a lazy / bad mathematician I would have jumped straight to a Monte Carlo model - I’m glad you got there in the end! And the key advantage is that when the going gets tough (multi-dimensional cakes?) the MC method is definitely easier :-)
I would do the same thing as a computer scientist... I suppose the difference between "computer scientist" and "lazy/bad mathematician" isn't very big.
If you start by taking a fixed cut at a distance h (between 0 & 1), the probability of the candles being either side is 2h(1-h) (one in the chunk of length h, one in the chunk of length 1-h, multiply by 2 since the candles can be swapped), and you can integrate this over all values of h (with a pdf of f(h)=1 bc it's uniform) to get 1/3. Obviously this is less graceful because it requires calculus, but it is very useful if you want to expand the problem to non-uniform probability distributions.
I got 1/3 by turning the continuous cake into a line of discreet points, started with three possible positions, got a third. Kept going with four and got a third again. Then I checked the comments and saw one that reframes the questions as picking three random points, randomly declaring one as a cut and the other two as candles, and looking at the chances of the cut being the centermost of the three points. It doesn't matter how far apart they can be, how many discrete positions the points can have, there's always one chance out of three that the cut lands between the two candles.
I have an alternative solution: Imagine you divide the cake in the middle into two equal sides (this is not the cut). Then similar to the ordering argument there are 8 possible outcomes: C1, C2 and K on the left side, C1 and C2 on the left side and K on the right side, C1 and K on the left side and C2 on the right side and K and C2 on the left side and C1 on the right side. The other four possibilities can be obtained by swapping left and right. Now the cases where the cut K is on one side and the candles are on the other side will definitely not have the cut in between the two candles, this leaves six possibilities. If there is the cut and one candle on one side there is a 50% chance that the cut will be closer to the centre and therefore cutting in between the two candles. If the two candles and the cut are on the same side we have the same problem as the original question asked us. Each of the 8 possibilities has probability of 1/8 which gives 2 * 2* 1/8 * 1/2 + 2 * 1/8 * x = x where x is the probability of the original problem. We can solve this for x which gives 1/3. However we can also use this relation 1/4 + 1/4 * x = x to get an infinite series namely summing over (1/4)^n for all integers bigger than zero. This is tells us that this sum will converge to 1/3. If we compare this series to the series which terms are (1/2)^n we see that it picks out every second term which means the remaining terms sum to 1-1/3=2/3. I think that is quite cool. Next one could divide the cake into 3 (or n) equal sides and do the same ordering argument which might give rise to solutions to other converging series’s.
My initial thought, from a logic and programing perspective. the operation to cut -must always be placed as last, because the other variants would result in a execution error, because the candles need to be put on the cake, and if the cake has been cut, it is not one cake anymore.
Ben, if it helps you not be surprised, the number of decimal places of the probability that you get with a Monte Carlo method goes like the order of magnitude of the number of trials. I know how you feel though, I always found it weird until that penny dropped for me. Each sucessive trial's impact on the probability figure goes like the inverse of the number of trials.
I find it more natural to look at the average distance between the two randomly placed candles, which is 1/3, and this immediately gives the answer to the probability of the cut landing in between them.
Before watching the solution, my intuitive reasoning: The two candles at the cut are three uniform random numbers, a, b and c. The condition we are looking for (the cut is in between the candles) is equal to a
My first idea was that (assuming the cake to be of length 1) the required probability is the same as the expected value of the distance between the two candles. To find this, we first imagine placing the first candle at some position x and then if the second candle is on the left of x (with probability x), it is expected to be at a distance of x/2 from the first candle and if it is to the right of x (with probability 1-x), it is expected to be at a distance of (1-x)/2 from the first candle. Hence, the answer is the integral from 0 to 1 of x • (x/2) + (1-x) • (1-x)/2, and by King's property this is the integral of x² from 0 to 1, i.e. ⅓. I felt that the method with arrangement was really elegant... The fact that it requires no calculus is amazing
I'd never heard of King's Property before, so the only way I got this answer was integrals. Can you clarify how the king's property helps get the answer of 1/3 without doing the integral manually? For others who also haven't heard of this, the King's Property states this: the integral (from a to b) of f(x) = the integral (from a to b) of f(a+b-x) Substituting our problem: integral (from 0 to 1) of x^2+x-1/2 = integral (from 0 to 1) of 1-(x^2+x-1/2) I just don't see how that simplifies to give us the answer of 1/3.
@@MyrddinE Split the integral into the sum of integral from 0 to 1 of x²/2 and that of (1-x)²/2, and then use King's Property on the (1-x)²/2 term to convert it into the integral from 0 to 1 of x²/2. Basically, all that does is mirrors the area which we're finding using integration along the vertical.
Having just finished a Combinatorics class, my first thought was simplifying to a discreet case. Instead of the candles and cut being any real number along the cake, split the cake into n regions and place them each in one region at random. If the cut is in the same region as one or both candles, count it in favor of the candles being on different slices. The probability we're looking for would then be the limit as n gets larger. The probability of the candles being on different slices is the number of outcomes where that's true divided by the total number of outcomes. Assuming the two candles are indistinguishable, they can either be in the same region (n possible orientations) or different regions (n choose 2 orientations), so there are n + n(n-1)/2 = n(n+1)/2 ways to place the candles. The cut can then be made in any of the n regions, so there are n * n(n+1)/2 = n^2(n+1)/2 possible outcomes. There are n ways to place the two candles on the same region and 1 way to successfully cut between the candles afterwards, there are n-1 ways to place the candles in adjacent regions and 2 regions to successfully cut, etc. In general, there are n-i+1 ways to place the candles i-1 regions apart and i ways to successfully cut the cake afterwards, for any i between 1 and n. The number of successful outcomes is then the sum from i=1 to n of i(n-i+1) which according to Wolfram Alpha has a closed form of n(n+1)(n+2)/6. The probability of cutting between the candles with n regions is then (n(n+1)(n+2)/6)/(n^2(n+1)/2) = 2(n+2)/(6n) = 1/3 * (n+2)/n The probability of the continuous case is lim as n -> infinity of (1/3 * (n+2)/n) = 1/3 * lim as n -> infinity of (n+2)/n = infinity/infinity, apply L'Hospital's rule: 1/3 * lim as n -> infinity of (d/dn(n+2))/(d/dn(n)) = 1/3 * lim as n -> infinity of 1/1 = 1/3
Thinking about this for a bit, this is a round about way of proving that if you pick two “random” numbers between 0 and 1, the average value of the smaller number is 1/3, and consequently the average value of the larger number is 2/3.
My intuition was 1/3 and was happy to learn I was right. My reasoning (not having a strong maths background) was that placing two candles created three regions and only one of the three regions resulted in candles on both sides. I could see that sometimes the region where a cut would be between the candles would sometimes be larger than the two regions on each side, but I figured that that would be balanced by the times when it was smaller. From there I made the jump that the differences in size effectively“cancel each other out” and you’re left with three regions that are effectively equal in size. If my reasoning was correct then the odds would be 1 in 3 that I hit between the candles.
My intuition was to compare the space between the two candles to the space outside them. When these two spaces have the same area it is 50/50 and deviations from that are compensated by deviations in the other direction. The space outside grows while the space within shrinks and vice versa. That landed me to think 50/50. But that assumes all sizes are equally likely and assumes a two section Is equivalent to a 3 section cake. Important to note that here all of the space outside the candles being to one side is probability zero. So really it is 3 distinct spaces the knife will land on. We could say before the near candle, between both candles and past the far candle, rather than between or outside the candles. So candle naming does help me gain some intuition here.
My first thought was just to do the most direct, brute force way which is that, if we put the cut at some point x, the probability that there's one candle on each side is 2x(1 - x) and then you just integrate that over x from 0 to 1. That said, I think the ordering approach is prettiest. It's easy to make an argument from symmetry that all 6 permutations are equally likely (we choose 3 uniformly random variables; since they're all sampled the same way, the result won't change if we interchange them; the only what that's possible is if all 6 configurations have the same weight) and that yields the answer both rigorously and simply.
I really liked this problem because I started trying directly integrating distributions and then I checked the solution (which matched) but the ordering is so simpler. Also, he said that he didn t make a strong argument about equiprobability but i d say distinguishing both candles and justify equiprobability because c1, c2 and K follow the same distribution thus have a symnetrical role is strong enough
I came with another solution while trying to solve it myself! The stupidest by far, but works! Cake is a line from 0 to 1. First we place first candle. If placed at 0, we can easily see the chance the cut is between the two candles is 50% (as shown in video). If placed at .25 we can calculate the probability to be 10/32. If placed at 0.5. we can calculate the probability to be 25%. We can call the first placement x and come up with general formula (x^2 + (1-x)^2)/2 for a probability of cutting between 2 candles depending on the placement of the first. Then we integrate it from 0 to 1, and we get the result 1/3 viola!
it makes sense without numbers or graphs or writing out the possible answers. the candles can be anywhere and equally likely to be everywhere. you've got two equal dividers in a cake, cut anything into equal size pieces twice and you've made thirds from the whole. you can think of the middle slice as the target, it's one third the total cake. you don't need a 3D plot, 2d is just fine.
Before I watch the rest of the video or read any comments: My guess is 1/3. There are 3 random elements: Candle A, Candle B and the Cut C. For 3 objects there are 6 possible permutations to arange them: ABC ACB BAC BCA CAB CBA Only 2 of those permutations are successes: ACB and BCA. So 2/6 possibilities are successes. Note: All permutations have an equal chance of happening.
See part 2 at ruclips.net/video/l5gUrDg01cQ/видео.html
I think I know where the round cake is going, namely that "cutting at random" isn't defined rigorously enough.
(Spoilers below)
You could pick (1) two points on the circumference uniformly, or (2) an angle and a distance from the center uniformly, or (3) an angle and a _point inside the cake_ uniformly, and those won't be the same distributions. For example, (1) will produce many very uneven cuts, 50% where the endpoints are at most 90° apart, (2) will produce fewer (50% will have the endpoints at most 120° apart), and (3) still fewer, since the very uneven cuts are even less common than in option (2).
i like the math-matition teacher guy. he reminds me of a country singer.
cQ is a risky ending to an url
@@Henrix1998 why?
You should make a video over imaginary numbers and how truly complex they can be
My thought is that this is equivalent to the problem: "Given three points on a line, if you pick one at random, what is the probability that you pick the middle one." And of course, the answer is 1/3.
Thank you.
This was my intuition as well, without having formed any proper reasoning for it initially.
Oh wow. That's a great way to put it.
Hey! that's what I did! Now time to melt our minds thinking about the circular cake!
Фала те! Я размишльа на млого по-тежак начин и долего до од прилике 66,66...% да неке. "Размишльа", тоя э подсвесно и размисли се за эдан трен.
They clearly knew what they were doing with that title
It's a really crappy reference
Noooo!
@@imveryangryitsnotbutter makes me sick
I don't get it. Some kind of 3-2-1 meme?
@@imveryangryitsnotbutter AAAAA
at 1:30 in I'm going to say the chance is 1/3 since this situation is analogous to picking three points on the cake, then picking one of the three points to be the cut and letting the other two be the candles. For every possible triplet of points each piece has a candle exactly when the middle point is chosen as the cut. There is a 1/3 chance of the middle point being picked, hence the answer is 1/3.
Sound logical argument.
My thoughts exactly.
That was clearer than this video.
At 2:00 I also think 1/3. Continuing now :)
My thoughts exactly. He didn't make it very explicit at the start that the uniform selection of positioning was from end of cake to end of cake for both candles and knife (rather than randomly positioning the second candle somewhere in front of the first candle for example) but I assumed he meant that.
I was confused for a while. 1/3 of the way into a Ben Sparks video and no Geogebra. But eventually it delivered.
I enjoy when Ben shows up on the channel. While the problems he brings are clever, I at least feel like I can wrap my dumb brain around them.
The video in which he works with the Mandelbrot Set is absolutely brilliant.
@@27122712ful it was, and that's kind of my issue. I've not really found his recent efforts that interesting.
And who doesn't like a guy who brings cake?
@@vigilantcosmicpenguin8721 Diabetics. :p
??
1 candle P(C
I immediately went to my trusted integrals, and calculated 2 times the integral from 0 to 1 of x*(1-x) dx; so the chance of any candle being to the left of the cut, multiplied by the chance of any candle being to the right of the cut, this for every cut, and multiplied by 2 because it doesn't matter which candle is to the left of the cut, and which is to the right of the cut.
This yielded 1/3 as the probability.
that's neat
Your integrals look like solutions searching for a problem 😎, I love your approach!
Very clever!
I went for the same approach right away. A clever argument is neat and all, but in the end of the day if the problem is already well defined, a trick might work or not, but you can try calculating and know pretty fast if it's reasonable to solve that way :)
If you think of the integral geometrically, I think this is similar to the pyramid approach!
Ben Sparks is rapidly becoming one of my favourite numberphile presenters. He has this very gentle "older brother" vibe and presents things in a way that gets me thinking on deeper levels. Great video!
Imagine if you also needed a letter for the cake. It would also be c.
So then you'd be talking about 2 candles, 1 kut and 1 qake.
Laughs in Dutch
Writing cut with a 'k' in Dutch is similar to using an additional 'n' in cut. (I've managed to explain this without triggering YT censor sensors).
Hmmmm...qake...
Ah my favorite fps: qake
The problem of two candles, one kut, and one qake can be modeled with three pyramids filling a xube. 🤔
I believe this also proves that the distance between the two candles averages to 1/3rd of the cake length.
Yes, when I paused this is how I started to go about it in my head. Obviously the chance of the cut being between the two candles is the average distance between the candles, and then I realized that I didn't know how to answer that either. I did think about Monte Carlo methods but then realized there was a much easier way to answer the question, which was to unpause the video.
I really enjoy Ben's manner, humor, topics and explanations.
Another way I was thinking about this, was:
With 2 candles, they will segment the cake into 3 separate regions that add up to the total cake. As it's all random, there is no reason to think any region is going to be larger or smaller than any other, so there's no reason to expect the cut to have anything but an equal chance to hit each of the three regions, specifically the region between the two candles, or a 1/3 chance.
Yep! That’s another way to do it
Basically, the expected distance between the candles is 1/3, so you have a 1/3 chance of cutting between them
Another way to think of the intuition for the "ordering" method is to imagine that instead of two candles and a cut, it's two blue candles and one red candle. Then we'll take out the red candle and cut wherever it landed. Hence, we're really just asking what the chance is that the red candle is the middle one of the three. If we place all three randomly, each candle has a 1/3 chance of being in the middle, so our answer is 1/3.
Much more intuitive than the first way I did it, as an integral from 0 to 1 of 2k(1-k) dk... though that also gets the right answer.
Fourth method: calculus! Let the cut be at the number x. We win if one candle is less than x and the other candle is greater than x, which occurs with probability 2x(1-x). Integrating this from 0 to 1 gives 1/3. [Similarly, the probability that both candles are less than x is x^2, and the probability that both candles are greater than x is (1-x)^2, each of which also integrates to 1/3.]
my thought is the probability of the cut being between the two candles, since the length of the cake is one, is the same as the average distance between the candles.
if that's the case then we also know the average distance of two random points on a line through probability
I simulated it on Excel - twenty thousand cakes - and got 0.33 with a lot of variation after the second decimal place. It gets to a third but surprisingly slowly, takes a lot of cakes.
Here's my method:
Suppose the cut is at point X ∈ [0, 1]
The probability that a candle is to the left is X. The probability that a candle is to the right is 1 - X.
This means that the probability that they are on different sides is:
X * (1 - X) + (1 - X) * X
which is equal to:
2 * X - 2 * X²
Now we are going to divide the [0, 1] interval in segments of length ΔX, and average over each possibility, we get:
Σ (2 * X - 2 * X²) * ΔX
summing over X going from 0 to 1 by steps of length ΔX.
Now we take the limit when ΔX goes to 0, the sum becomes an integral:
∫ (2 * X - 2 * X²) dX
from 0 to 1, which is equal to:
[ X² - 2/3 * X³ ]
evaluated between 0 and 1:
( 1² - 2/3 * 1³ ) - ( 0² - 2/3 * 0³ ) = 1/3 - 0 = 1/3
Great! Thanks!
This is exactly how I did it
why bother with the finite sum at all..?
also why write out every step of the grade-school mathematics evaluating the integral..?
touch some grass man
Yeeeees a Ben Sparks video ! Always a pleasure to watch
This was a fun one to try before watching. Began by trying a case with N equally spaced discrete candle positions where the knife could cut in a continuous range. Running the numbers gave a general formula for the probability for N positions as (N+1)/(3(N-1)), taking the limit for N -> infinity to get 1/3.
this is really cool
Love all the stuff in the background Ben!
That's all Brady's gear. :)
12:26 "And now you're going to record a thousand shots of me randomly cutting a cake"
Not gonna lie, was half expecting this to suddenly cut to Matt Parker there...
But then he parkered the "just do it" approach by not just doing it :(
When he got to the bit where he was asking whether we had to be able to distinguish one candle from the other or if their identical, I’m reminded of the old physics problems where everything is a sphere of uniform density.
I was praying you wouldn't superimpose the word "cut" with a "k" on the video. Thank god you didn't. I think I speak for all Dutch viewers 🙂
+1
Kaars en cut ligt idd nogal gevoelig dankzij Johan Derksen...
😮
Of course, if the cake was ACTUALLY a Battenberg, you could also talk about what colour order the squares in the cut could be, since they alternate. Wouldn't that be fun!
"Being able to draw in 3D is a surprisingly useful skill for a mathematician."
- Ben Sparks
Proceeds to use geogebra instead
Is it?
As a further check, we know the probability density function of the uniform distribution. So we can label the candles x and y, and the cut z, and just calculate the probabilities x < z < y and y < z < x and add them up. The actual calculation is left as an exercise for the student. (But it better be 1/3.)
My initial thought was 1/3, and this was my thinking:
The two candles divide the cake into 3 segments of random length (the segment to the left of the leftmost candle, the one to the right of the rightmost candle, and the segment between the two candles). The cut will come in randomly on one of those 3 segments.
it seems reasonable to assume that, on average, each of those segments would be of equal value. Or put another way, there seems to be no reason to assume that any one of those segments would be bigger nor smaller than any other, on average.
Since only one of those segments, the one between the two candles, would satisfy the problem, that gives a result of 1/3.
That was basically my same thought, as well. But then, I couldn't figure out the problem with this reasoning.
Add a cut and a candle randomly on the cake, on average there should be a 50% chance of a candle being on one side or the other of the cut, so adding just 1 more candle you either double up a one of the sides or get your preferred single candle on each side. That would be a 50% chance. But we already know the answer is 1/3.
I realized that I can't do those first averages, as on each trial, the cut is almost never going to be right in the middle, so it's not actually a 50% chance for the first candle, nor the 2nd candle, there is some kind of [candle location]^2 happening, which is not being accounted for by averaging the first two, and then adding the last candle.
My thought was 1/3. My thinking: There's 3 things, so surely it's 1/3.
Then I also went: Maybe it's a pi related thing because everything is pi related. So my second guess was 1/pi.
I can't be bothered to think much.
Here's my conceptualization of the question that's being asked:
What are the odds that a
I gave it a try and got 1/3. Time to watch the video and see the correct answer!
Edit: Yay, I got it! I used an integral but the geometric solution is my favourite. It is crazy how many approaches exist for such simple problem.
Another way to look at the problem is to say there are n+1 evenly spaced holes (including the edges of the cake) you can put the candles in. Assuming your cake is one unit long, the probability of your knife falling between the candles is proportional to the distance between them. For n+1 pegs, this gives us n*(n+1)/2 configurations, so the probability of falling between the candles is the sum of the distances of each configuration divided by the number of configurations.
The sum of said distances turns out to be the sum of the first n triangular numbers divided by n, so the overall equation simplifies to 2/(3n)+1/3. As n approaches infinity, the probability approaches 1/3.
As a homage to the two Ronnies, please make a follow up episode about what happens when four candles are used 🕯🕯🕯🕯🍴
Finally a topic I can grasp 😅 I am slightly disappointed there wasn't a reference to the Two Ronnies' Four Candles.
My initial thought: calculate the average distance between the two candles, call it d. Then then probability that the knife hits between the two candles is d/D, where D is the length of the cake.
Checked it and it gives 1/3.
I tried to do It but isn't the average distance 0.25 giving the cake lenght Is 1?
Like:
On average a candle will end up at 0.5 cuz the average of 0 and 1 Is 0.5
The second candle also has a range 0 to 1, and because the 1st candle on average will end up at 0.5 the maximum distance Is 1-0.5= 0.5
Now on knowing the distance can be anywhere from 0 to 0.5 web know the average distance Is 0.25...
I certaintly did something wrong...
I ckd it and got 37.5% which is supported by his "slightly higher than 1/3" brute force method (37.5% is 3/8 which is is slightly higher than 1/3 aka 3/9)
C1 can, equally likely fall anywhere from the end to the middle.
If C1 falls at the end the avg distance between the candles is 1/2 the total distance. (Cuz C2 on avg falls in the middle). So 50-50 chance cut is in the middle
if C1 is falls in the middle, C2 will avg 1/4 the total distance from C1. (Cuz, again C2 on avg falls between C1 and the end). So 25% chance cut is in hte middle
So the avg distance between the candles is (1/2 + 1/4)/2 = 3/8 the total distance. Hence 3/8 of the time the cut will divide the candles
Almost all videos with Ben are very high on my favourites list. Can't wait to see what he'll show us next.
I enjoy all the Numberphile videos, but I especially enjoy them when Ben is on. The interaction between him and Brody is infectious.
They knew what they were doing with the title
another method: let the cake have a length of 1. let x be the distance from the end of the cake at which the cake is cut. as such, it is also the amount of the cake on one slice. 1-x is the amount of the cake on the other slice.
then, the probability that both candles are on different slices, given a cut x, will be the probability that they are not on the same slice. this works out to 1-(x^2+(1-x)^2). to find the total probability, take the integral between 0 and 1.
Yep, exactly how I did it.
But doesn't that also assume that the probability for being on one side of the cut is 50%, which is only true if the cut is right in the middle?
@@jamielondon6436 no, it assumes that the probability of being to the left of the cut is x, as one interpretation. If the cut is 43% of the way through the cake, the probability that the first candle is on the left is 43%, which is x. Conversely, the probability that the first candle is to the right of the cut is 57%, which is 1-x.
@@emilywilson967 Thanks!
@@emilywilson967 I think I've worked it out now. :-)
The crucial part of the ordering approach is that because each items position comes from the same distribution independently any permutation is equally likely (one reason is the computation of P(a
My initial thoughts: find the average interval between the candles, then that size (normalize the whole cake to 1 for simplicity) is the probability of a uniform thing falling in that range.
Exactly, me too! Which ends up on nothing since we need to know the distribution 1st. Going to deep on statistic ends up not that good 😅
@@iPlayDotaReligiously Ben specified that the distribution is uniform.
@@Nomen_Latinum my bad, I mean we cant pull the answer straight by just knowing the distribution. Thats where mathematician and statistician is different; the way they approach problems.
@@iPlayDotaReligiously I'm not exactly sure what you mean. The distribution tells us all we need to know about the problem. In fact, as long as we assume the distribution is continuous and it is the same for both candles and the cut, it doesn't matter what the distribution is-the answer will still be 1/3.
@@Nomen_Latinum that is my point, if we were too accustomized with something that is more advanced, then we prolly would forgot that it isn't needed to be that advance to solve the problem.
You can also integrate the probability that the candles fall on either side of the knife, which is the integral from zero to one of x*(1-x) dx, but you need to multiply the result by two because the candles could swap places at every knife position.
Or integrate the probability they are on the same side (x^2 + (x-1)^2 ) right away
My guess before I watch the whole thing, let's see if I'm right: the probability is the volume of the set of points in the unit cube that satisfy x < y < z ∨ z < y < x. This set consists of two disjoint sets of the same volume. Each of those is a tetrahedron, a pyramid with with half-triangle of the unit square as the base and unit as the height, so its volume is 1/3 * 1/2 * 1 = 1/6, and the answer should be twice that i.e. 1/3.
The combinatorial solution is probably the most elegant… but let me share another!
First , I want to note that if the cake has length 1, the chance that the knife lands between the candles is exactly the same as the average distance between the two candles.
What is this distance? Call it ‘x’ for now and consider the following recursive argument.
The two candles could be distributed either one in each half of the cake, or both in the same half, each with probability 1/2.
In the first case, one candle will be on average 1/4 of the way along the cake, the other on average 3/4 of the way making for an average distance of 1/2.
In the second case, we end up with the same problem but on a cake half the size , ie what’s the average distance between two candles on a cake of size 1/2? Which would be our ‘x’ but divided by 2.
So we must then have that x = 50%*1/2 + 50% * x/2, which can be rearranged to find x=1/3
You forgot to carry the 50%
Here's how I would model the situation in a program:
Pick random numbers between 0 and 1 for variables A,B,C
If A>B>C OR A
There's of course infinite solutions to this problem, but the one that came most naturally to me was to solve the integral of 2 * x * (1-x) dx from 0 to 1 - the chance of a candle on each side given x, the position of the cut. This value is of course 1/3.
Edit: I originally wrote (x-1), but this should be (1-x).
That's what I did, too. I also noticed that it was definitely going to be less than 1/2, because having the cut in the best possible place (the middle) gives 1/2 for the question, and it's less likely down to 0 as the cut is closer to one end than the other.
How did you come up with that term 2x * (x-1). Doesn`t seem natural to me
@@MCRuCr After the position of the cut is determined -- x, there are some cases that might happen. Candle 1 can be lower or higher than the cut, and candle 2 can be lower or higher than the cut. The cut is somewhere from 0 to 1, a range of size 1, so the probability of candle 1 being lower than the cut is the size of the area lower than the cut divided by the whole size of the cake: x / 1 = x. The probability that candle 1 is higher than the cut is (1 - x). The probabilities are the same for candle 2. We want either 1 lower and 2 higher, or 1 higher and 2 lower. Therefore x * (1-x) + (1-x) * x = 2 * x * (1-x).
If you write a simulation you have to generate three random numbers and choose what order to assign them. You can assign them candle 1, candle 2, and knife or candle 2, knife, candle 1, or whatever. As we saw in the video, there are 6 ways to assign these random numbers (6:40). If you have three random numbers, one will always be in the middle (ignoring when two or more are the same), and it will be in the middle in two ways--c1=smallest, knife=middle, c2=largest or c1=largest, knife=middle, c2=smallest--that means that two out of the six ways will have the knife in the middle, giving one third.
My initial impulse was to draw a tree diagram, starting with three sided dice and the probability to get the third number in between the first two. Then I moved forward to a four sided dice, then a five sided dice, and then I was thinking about doing complete induction to prove that for any given sided dice the chances will be 1/3.
I love it how many different ways are found in the video and the commentary to solve the problem
Before Numberphile, I never would have paused the video, worked out a guess, then come up with two less mathematically rigorous but more intuitive (to me, only) versions of the first solutions shown.
I don't know the formal math as well as I ought, but with all the cool problem solving you see on this channel (and Grant's as well), it's made a difference. I really was shocked at how close my methods were to the proper methods in the video. Keep up the great work.
That cake looks nice and all, but that is one delicious-looking graph. That's my favorite here.
Ben: Let's imagine a cake..
Camera: (points to laptop)
Ben: Better still, let's code a cake using GeoGebra.
My first intuition was Monte Carlo. I also considered Integration. But the ordering method mentioned in the video is just the most delicate and smartest method. Thank you.
First guess: 2 out of 6. Explanation: 1 cut and 2 candles will end up in a row with a random distribution. Short answer, there is 1/3 of a chance that the cut ends up in the middle.
Thanks Kim Jong Un, but I think South Korea wants their chickens back ;)
I went for the math solution: if I have a cake of size 1 and two candles in positions c1
Pretty easy to show the 1/2 guess is wrong: if the cut is in the middle, the odds are 1/2, and if the cut is towards one edge, the odds are very small, so the answer must be smaller than 1/2. (This leads to a solution by integration.)
This is exactly how I reasoned it should be less than 1/2.
Suppose the cake is kut at x (between 0 and 1). Then the probability of candle A being “before” the kut is x, and the probability of candle B being “after” the kut is 1-x. So the probability of both happening is x(1-x). Similarly the probability of candle B being “before” and candle A being “after” is also x(1-x).
So we integrate 2x(1-x) from 0 to 1 and see that this does indeed equal 1/3!
3:21 The chance that is on the left is a 100%. If it is not on the left you spin the table 180°
First instinct was 1/3, just ordering Candle1 Candle2 and Cut as three things in a row, youve got 2 of 6 permutations with the cut in the middle.
Two candles one cake is Numberphiles version of "Two girls one cup"
Number 1 on numberphile
These are the kinds of math problems I love seeing from numberphile
Bot
Best maths teacher in numberphile
33% - you've got 3 points on one line. Non of the points is unique, they are all the same, so there is the same probability that any of them is in the middle between two others. Each piece of cake has one candle only when the "cutting" point is in the middle, so 1 case out of 3.
2:25 - It's not just that the cut can't happen where the candle is. Random placement ought to say if the candles can be together or have some minimum space between.
Before I watch this all through, I just took the cake to be of length 1 and the cut at distance x from one end. Then the probability of any single candle being in the first section is simply x, which means that the probability of it note being in that section is 1-x of course. So the possibility of both being in the first section is p(2)= x^2, and of none being p(0)=(1-x)^2. That must mean the probability of just 1 is 1-p(0)-p(2)=1-1+2x-x^2-x^2=2x-2x^2.
Now integrate 2x-2x^2 between the limits of 0 & 1 and you get [x^2-x^3/3+c] between the limits of 0 and 1, which works out at 1-2/3+c-c = 1/3. So I make the probability of each piece having exactly one candle 1/3.
I'm sure there's a much simpler and elegant way of doing it, but my approach wasn't too difficult. That's assuming I have it right of course...
my particular trick for sanity checking such problems is to cheat and use Excel to model it in actual numbers, which is not something mathematicians might approve of.
*** now I've watched the video, it seems I have used a completely different technique, albeit it feels like a sledgehammer to break a nut.
I followed a similar approach, although concluding from a geometrical argument. In my case putting cut position on the x-axis and then figuring out a "success-function of putting the candles on seperate pieces" f(x) = x*(1-x) that serves as the upper bound of an area together with the axis, integrating that area and scale it to the total possibility space. Turns out to be the same integral that you got algebraically exept for a scale factor, due to the candles being interchangeable, which is where the 2 comes from. TLDR: Got the same result with the same calculations, just performed in a different order.
That's exactly how I did it. I'm happy I still have some basic calculus knowledge left after several years out of school.
A slightly less elegant way I solved this is a double integral: Integral from 0 to 1 of (Integral from 0 to 1 of ( | x - y | ) with respect to x) with respect to y.
I imagine this as a function f(x,y) mapping the positions of the two candles to a probability that the cut will be between them. Thus forming a probability distribution not-unlike the cube shown in the video. This probability distribution can be summed to yield the 1/3 chance.
i tried that first as well and then thought it was incorrect, only because symbolab gets this integral incorrect, says it equals 0 which i knew wasn't the answer
@@i_cam interesting, maybe it can't do the absolute value. It will be zero if you don't take the absolute value of (x - y).
Intuitively a minute and 33 seconds and I’m going to say 1/3 chance.
My solution was to make the cake granular with n be the number possible locations the candles can be placed at. Then:
1. the probability of the two candles being k steps from each other is 2*(n-k)/n^2
2. the probability of the cut happening between the candles, when they are k steps apart, is k/n
Which means that the total probability of the cut happening between the two candles is lim(n -> inf) of sum(k = 1...n) of the above two numbers multiplied together.
Which is 1/3.
2 girls one cup*
it's crazy... I immediately went to calculate the integral (as many others did as well) and was just blown away by the simplicity of the ordering approach...
There's even a 4th way: integrating! Both integrals are from 0 to 1:
∫∫ |x-y| dx dy = ∫ (y²/2 + (1-y)²/2) dy = 1/3.
My initial solution:
Suppose the cake has length 1 and the cut is at position x. The probability of putting a candle on either slice is just equal to the size of the slice, so the probability of getting one candle on either side is:
P(x) = x*(1-x) + (1-x)*x
Where we get two terms for whether the first candle is before or after the cut. Simplifying this gives us:
P(x) = 2 ( x - x^2 )
Now, the cut position is also random so we need to integrate this from 0 to 1:
P = ∫ P(x) dx = 2 ( ½ x - ⅓ x^3 )
P = 2 ( ½ - ⅓ )
P = ⅓
I came up with the ordering solution afterwards though, since this way didn't seem very elegant...
Place first candle then cut the cake. The cake can now be represented by three regions:
- from edge to candle,
- from candle to cut,
-from cut to the other edge.
By symmetry there is no reason for any of those regions to be bigger than to other. As only one of those equal regions result in success we conclude that the probability is 1/3. By symmetry the different ordering of placing candles and cuts yields the same answer.
Another interesting Numberphile video. I love the use of a Battenburg cake. I like those and it makes me wish I could get one locally. :)
That black and blue Mandelbrot set used to be my desktop wallpaper too. It really is a beautiful picture.
I was in fact worried if the two specific candles mattered, I am no longer worried. Thanks.
So proud that my initial guess was ~30% haha. My reasoning was:
- For there to be a 50% or higher chance, the candles have to be at least half a cake apart. If they're less than half a cake apart, there's a more than 50% chance they'll end up on the same side.
- There are more configurations where the candles are less than half a cake apart, because if they're close together you can put them anywhere on the cake, whereas putting them half a cake apart constrains you more on where you could put each candle.
So I was fairly sure it was going to be less than 50%.
This might put me too far in the applied mathematics camp, but my solution was to take a double integral. The probability of cutting the cake in between two candles at points x and y, since the distance is 1, is given as abs(y-x). Therefore, you can take an integral from 0 to 1 of (the integral from 0 to x of (y-x) dy) dx. Which evaluates to 1/6, however, the function z=abs(y-x) is symmetric across y=x, so you can simply multiply the 1/6 by 2 to get 1/3. Essentially you are just looking at two equal triangles which divide the square region of {(x,y)|0
My very first guess was actually 1/3, but I second-guessed myself to 1/2. Clearly, I should've stuck with my first idea.
Anyway my solution was pretty simple. Instead of either treating the candles as indistinguishable (which I think makes the math more confusing), or dealing with them independently (which gives you unnecessary possibilities to check), I just declared that _a_ was the leftmost of two independently chosen random cuts, and _b_ was the rightmost one (if you want to get pedantic, call the original two independent points a´ and b´ and define a=min(a´, b´), b=max(a´, b´)). Since I assign the labels after choosing the points, this doesn't affect the distribution, as I still choose two independent random points.
Then I applied Bayes' theorem to turn P(a < c < b) into P(a < c|c < b) * P(c < b). P(c < b) is clearly 1/2, and I started considering how to solve the conditional, and started doing case analysis, but while working that out I realized that I hadn't fully considered my initial precondition of a < b, which had the consequence that their average positions were no longer in the center.
That gave me a much simpler method, going straight from the problem statement to the solution. Intuition told me that randomly selected ordered values should be evenly spaced on average, so avg(a) = 1/3 and avg(b) = 2/3. I didn't immediately know how to actually prove this, but a quick numerical simulation confirmed that they do in fact tend toward those values for large sample sizes. Then, the probability that the cut position c, chosen independently of a and b, was between a and b, is P(avg(a) < c < avg(b)) = P(1/3 < c < 2/3), which is trivial to solve: just subtract the lower bound from the higher one to find the size of the middle range.
(Note that it's important that c doesn't get included in the 'evenly spaced' consideration from before, changing the averages to {1/4, 2/4, 3/4}, because then you have to do the full case analysis and you're effectively just doing the proof from ordering in the video with extra steps.)
I'm ignoring the cases where any of the points are equal because those have probability 0 (the probability of picking a particular element out of an uncountably infinite set is 0). They were also ignoring this in the video too, when they decided not to consider the case of 'cutting a candle in half'. I could address it, and it probably wouldn't even complicate anything much, but by definition it doesn't affect the result so I just excluded those cases and used < everywhere.
As a lazy / bad mathematician I would have jumped straight to a Monte Carlo model - I’m glad you got there in the end! And the key advantage is that when the going gets tough (multi-dimensional cakes?) the MC method is definitely easier :-)
I would do the same thing as a computer scientist... I suppose the difference between "computer scientist" and "lazy/bad mathematician" isn't very big.
If you start by taking a fixed cut at a distance h (between 0 & 1), the probability of the candles being either side is 2h(1-h) (one in the chunk of length h, one in the chunk of length 1-h, multiply by 2 since the candles can be swapped), and you can integrate this over all values of h (with a pdf of f(h)=1 bc it's uniform) to get 1/3. Obviously this is less graceful because it requires calculus, but it is very useful if you want to expand the problem to non-uniform probability distributions.
I got 1/3 by turning the continuous cake into a line of discreet points, started with three possible positions, got a third. Kept going with four and got a third again.
Then I checked the comments and saw one that reframes the questions as picking three random points, randomly declaring one as a cut and the other two as candles, and looking at the chances of the cut being the centermost of the three points. It doesn't matter how far apart they can be, how many discrete positions the points can have, there's always one chance out of three that the cut lands between the two candles.
I have an alternative solution:
Imagine you divide the cake in the middle into two equal sides (this is not the cut). Then similar to the ordering argument there are 8 possible outcomes:
C1, C2 and K on the left side, C1 and C2 on the left side and K on the right side, C1 and K on the left side and C2 on the right side and K and C2 on the left side and C1 on the right side. The other four possibilities can be obtained by swapping left and right.
Now the cases where the cut K is on one side and the candles are on the other side will definitely not have the cut in between the two candles, this leaves six possibilities. If there is the cut and one candle on one side there is a 50% chance that the cut will be closer to the centre and therefore cutting in between the two candles. If the two candles and the cut are on the same side we have the same problem as the original question asked us.
Each of the 8 possibilities has probability of 1/8 which gives 2 * 2* 1/8 * 1/2 + 2 * 1/8 * x = x where x is the probability of the original problem. We can solve this for x which gives 1/3. However we can also use this relation 1/4 + 1/4 * x = x to get an infinite series namely summing over (1/4)^n for all integers bigger than zero. This is tells us that this sum will converge to 1/3. If we compare this series to the series which terms are (1/2)^n we see that it picks out every second term which means the remaining terms sum to 1-1/3=2/3.
I think that is quite cool.
Next one could divide the cake into 3 (or n) equal sides and do the same ordering argument which might give rise to solutions to other converging series’s.
My initial thought, from a logic and programing perspective.
the operation to cut -must always be placed as last, because the other variants would result in a execution error, because the candles need to be put on the cake, and if the cake has been cut, it is not one cake anymore.
Ben, if it helps you not be surprised, the number of decimal places of the probability that you get with a Monte Carlo method goes like the order of magnitude of the number of trials. I know how you feel though, I always found it weird until that penny dropped for me. Each sucessive trial's impact on the probability figure goes like the inverse of the number of trials.
I find it more natural to look at the average distance between the two randomly placed candles, which is 1/3, and this immediately gives the answer to the probability of the cut landing in between them.
Before watching the solution, my intuitive reasoning: The two candles at the cut are three uniform random numbers, a, b and c. The condition we are looking for (the cut is in between the candles) is equal to a
My intuition was 1/3, but I couldn't immediately come up with an explanation or an argument for it. Happy to find I was correct.
Excellent video. Thanks Math Damon.
My first idea was that (assuming the cake to be of length 1) the required probability is the same as the expected value of the distance between the two candles. To find this, we first imagine placing the first candle at some position x and then if the second candle is on the left of x (with probability x), it is expected to be at a distance of x/2 from the first candle and if it is to the right of x (with probability 1-x), it is expected to be at a distance of (1-x)/2 from the first candle. Hence, the answer is the integral from 0 to 1 of x • (x/2) + (1-x) • (1-x)/2, and by King's property this is the integral of x² from 0 to 1, i.e. ⅓.
I felt that the method with arrangement was really elegant... The fact that it requires no calculus is amazing
I'd never heard of King's Property before, so the only way I got this answer was integrals. Can you clarify how the king's property helps get the answer of 1/3 without doing the integral manually?
For others who also haven't heard of this, the King's Property states this:
the integral (from a to b) of f(x) = the integral (from a to b) of f(a+b-x)
Substituting our problem:
integral (from 0 to 1) of x^2+x-1/2 = integral (from 0 to 1) of 1-(x^2+x-1/2)
I just don't see how that simplifies to give us the answer of 1/3.
@@MyrddinE Split the integral into the sum of integral from 0 to 1 of x²/2 and that of (1-x)²/2, and then use King's Property on the (1-x)²/2 term to convert it into the integral from 0 to 1 of x²/2. Basically, all that does is mirrors the area which we're finding using integration along the vertical.
Having just finished a Combinatorics class, my first thought was simplifying to a discreet case. Instead of the candles and cut being any real number along the cake, split the cake into n regions and place them each in one region at random. If the cut is in the same region as one or both candles, count it in favor of the candles being on different slices. The probability we're looking for would then be the limit as n gets larger.
The probability of the candles being on different slices is the number of outcomes where that's true divided by the total number of outcomes.
Assuming the two candles are indistinguishable, they can either be in the same region (n possible orientations) or different regions (n choose 2 orientations), so there are n + n(n-1)/2 = n(n+1)/2 ways to place the candles. The cut can then be made in any of the n regions, so there are n * n(n+1)/2 = n^2(n+1)/2 possible outcomes.
There are n ways to place the two candles on the same region and 1 way to successfully cut between the candles afterwards, there are n-1 ways to place the candles in adjacent regions and 2 regions to successfully cut, etc. In general, there are n-i+1 ways to place the candles i-1 regions apart and i ways to successfully cut the cake afterwards, for any i between 1 and n. The number of successful outcomes is then the sum from i=1 to n of i(n-i+1) which according to Wolfram Alpha has a closed form of n(n+1)(n+2)/6.
The probability of cutting between the candles with n regions is then (n(n+1)(n+2)/6)/(n^2(n+1)/2) = 2(n+2)/(6n) = 1/3 * (n+2)/n
The probability of the continuous case is lim as n -> infinity of (1/3 * (n+2)/n) = 1/3 * lim as n -> infinity of (n+2)/n = infinity/infinity, apply L'Hospital's rule: 1/3 * lim as n -> infinity of (d/dn(n+2))/(d/dn(n)) = 1/3 * lim as n -> infinity of 1/1 = 1/3
Thinking about this for a bit, this is a round about way of proving that if you pick two “random” numbers between 0 and 1, the average value of the smaller number is 1/3, and consequently the average value of the larger number is 2/3.
My intuition was 1/3 and was happy to learn I was right.
My reasoning (not having a strong maths background) was that placing two candles created three regions and only one of the three regions resulted in candles on both sides. I could see that sometimes the region where a cut would be between the candles would sometimes be larger than the two regions on each side, but I figured that that would be balanced by the times when it was smaller. From there I made the jump that the differences in size effectively“cancel each other out” and you’re left with three regions that are effectively equal in size. If my reasoning was correct then the odds would be 1 in 3 that I hit between the candles.
i had the same reasoning :)
My intuition was to compare the space between the two candles to the space outside them. When these two spaces have the same area it is 50/50 and deviations from that are compensated by deviations in the other direction. The space outside grows while the space within shrinks and vice versa. That landed me to think 50/50. But that assumes all sizes are equally likely and assumes a two section Is equivalent to a 3 section cake. Important to note that here all of the space outside the candles being to one side is probability zero. So really it is 3 distinct spaces the knife will land on. We could say before the near candle, between both candles and past the far candle, rather than between or outside the candles. So candle naming does help me gain some intuition here.
My first thought was just to do the most direct, brute force way which is that, if we put the cut at some point x, the probability that there's one candle on each side is 2x(1 - x) and then you just integrate that over x from 0 to 1. That said, I think the ordering approach is prettiest. It's easy to make an argument from symmetry that all 6 permutations are equally likely (we choose 3 uniformly random variables; since they're all sampled the same way, the result won't change if we interchange them; the only what that's possible is if all 6 configurations have the same weight) and that yields the answer both rigorously and simply.
I really liked this problem because I started trying directly integrating distributions and then I checked the solution (which matched) but the ordering is so simpler. Also, he said that he didn t make a strong argument about equiprobability but i d say distinguishing both candles and justify equiprobability because c1, c2 and K follow the same distribution thus have a symnetrical role is strong enough
that's why I never invite mathematician to my birthday. They always end up ruining the mood with all their questions on cakes.....
I came with another solution while trying to solve it myself! The stupidest by far, but works!
Cake is a line from 0 to 1. First we place first candle.
If placed at 0, we can easily see the chance the cut is between the two candles is 50% (as shown in video).
If placed at .25 we can calculate the probability to be 10/32.
If placed at 0.5. we can calculate the probability to be 25%.
We can call the first placement x and come up with general formula (x^2 + (1-x)^2)/2 for a probability of cutting between 2 candles depending on the placement of the first.
Then we integrate it from 0 to 1, and we get the result 1/3 viola!
I love Ben Sparks with all my heart
it makes sense without numbers or graphs or writing out the possible answers. the candles can be anywhere and equally likely to be everywhere. you've got two equal dividers in a cake, cut anything into equal size pieces twice and you've made thirds from the whole. you can think of the middle slice as the target, it's one third the total cake. you don't need a 3D plot, 2d is just fine.
12:37 I love that Ben also immediately thought of Doc Brown.
Before I watch the rest of the video or read any comments: My guess is 1/3.
There are 3 random elements: Candle A, Candle B and the Cut C. For 3 objects there are 6 possible permutations to arange them: ABC ACB BAC BCA CAB CBA Only 2 of those permutations are successes: ACB and BCA. So 2/6 possibilities are successes.
Note: All permutations have an equal chance of happening.