Thanks again to Jane Street! jane-st.co/SUM-internships Yes, fatal flaws in my new system have already been found. Comment with more flaws or fixes below!
Actually doesn't they always know the number of shunts? They could theoretically choose anyway, because they know the order of people who added their number, and the difference between the shunts reveals who is buying for who, since your own number is an anchor. The number of shunt between the difference of your two numbers. EDIT: And this is not only the case for d but for anyone. It is probably detectable if they choose to swap with someone to far away, as they know how many shunts can happen and see that the distance would have been impossible.
@@traywor Since you can see the number of shunts and then you see the names associated with all of the receivers you should also be able to see all of the buying relationships. It appers to me that it is not anonomised at all.
Lololol! @SteveMould I hope you see this. Sending big festive hugs from South Africa. You and @standupmaths are such legends and reputable role models. Thanks for your good vibes!!
Nobody ever goes for my "Stochastic Santa" system where you just buy a present for someone at random and trust that everyone will get about the right number of presents in the long run
@@solsystem1342i think that may actually work both ways. The "favourite" in the group getting more presents but also the "im worried they will be forgotten about" getting more presents. Meaning the "normal" friends (for lack of a better word) have the biggest chance to recieve nothing. Or that would be my guess :p i wonder if there have been studies done on this.
I felt worried the gift I bought wouldn’t compare to some of the others but seeing that someone bought *a piece of cellophane* makes me feel a whole lot better 😂
As I told Matt 4 minutes before he posted the video, I think the new version proposed around 23:00 is quite flawed. The algorithm always produces a cyclic permutation where player Xn is giving to player X(n + m), with 0 < m < num_players. That's good, but since we don't shuffle after that and the ordered list is eventually public, everyone can figure out what m is: Just computing the difference between your own position in the list and your own recipient. That means you can figure out the entire graph!
You could probably fix this by having D shuffle after replacing their number at the end of first cycle and A shuffling at the start of the second cycle. This however doesn't fix the exploit of taking yourself out of the game.
For the record, I saw Tom7’s email five seconds after I set the video live. This is absolutely correct. We’d need to put shuffles back in somewhere before the names round, but this will allow the same shenanigans as the first system again. This new idea might be a bust. We might need to go back a version and use public-keys instead of names.
couldn't you simply shuffle the rows as you put in your name? that way, the list doesn't directly correlate to the cycle you're building anymore, but you're not changing anything about the assignments
To be honest Geoff when I saw you there I thought the same. You DID help Matt with a parkrun related stopwatch Bingo maths video that time though so I guess that counts doesn't it? (Annoyingly I've been stuck at 59/60 for ages on that)
Your method of generating random numbers is not random because the probability of each number decreases. Train numbers are given sequentially per train class so every class has a 001 but hardly any class would ever have 999
true... but like, arent you supposed to reveal yourself to the person _when_ you give the gift? naturally you dont want to reveal it beforehand, and maybe it's a cultural difference, but ive always had to reveal it to everyone in fact when giving the gift
@@rmvdhaak It might not show up for you because it's not part of the video itself but youtube put a link to Matt's channel (with his face as the icon) right on top of the video at that moment for me too.
@@bee_irl I know what people with way less clicks make and I'm pretty sure it's easy to find some data about that. and I'm pretty sure they all monetize their videos since there are ads *and* there even are sponsors. so that assumption isn't that bold.
I really like that you showed the process of explaining to everybody the system and almost none of them understood it the first time. When you don´t see the behind the scene stuff you think that all mathematicians just get everything math related first try. Which obviously is not true
@@landsgevaer not exactly, but there is i believe a function/algorithm that mimics the behavior of the factorial function that still works for non integer numbers
This gets into the ticky-tacky question of "What is the definition of factorial?" If you define it as "n! = n*(n-1)!" plus "0!=1" then no. However, if you define it as "A function that meets the above definition for all natural numbers" then maybe yes. I think we have to defer to calculators on this -- if you enter 1.25 and press the factorial button, it produces a number as a result, not an error. Thus, the Gamma function is the *true* definition of the factorial operator and the natural number definition is a "that's neat" type of thing. I can see people arguing the converse, though. After all, factorial existed long before the gamma function was discovered, so if you go back far enough then factorial was only defined on the natural numbers. Plus the gamma function is its own thing with its own name -- it seems suspect that there would be two _different_ operators defined for a single operator. The later argument can be countered by pointing out that gamma _isn't_ equal to factorial, but "(n-1)! = gamma(n)" is close enough to say "The gamma function *is* the factorial function." Too deep of a question for me, I'm afraid. 😂
@@landsgevaerWhile there are in principle infinitely many ways to extend the factorial function to noninteger values, if you add in a few extra conditions, the only possible extension is x!=Gamma(x+1). The conditions I'm thinking of are - x!/(x-1)!=x, and - the function f(x)=(x+c)!/x! is an increasing function for fixed c, for positive c and sufficiently large x It's a matter of opinion if you think these are reasonable restrictions. (If I've done my job right, the second condition should be equivalent to "log convexity", which states that log(x!) is a convex function for sufficiently large x)
Well the code would follow all the algorithms and thus always produce a fully functioning array. However the struggle with the problem is not how the algorithm could be wrong but rather how someone could deter from the algorithm without getting noticed or someone finding any informations about who could give to whom.
If you look for "banana random number generator" on google, there is a whole device I designed exactly for that: generating random numbers from potassium decay in bananas
The radioactive banana method was absurdly overengineered by normal standards, but disappointingly straightforward for Tom7. I hope he at least turned the banana into a NES emulator afterwards.
Merry Christmaths All!✨ and thank you to the editor who cut out the several minutes where I couldn’t figure out why someone would gift me such a tiny scarf. It is a very cute dog bandana, thanks Santa! 💗
"is there an e in Christmas?" I genuinely thought that 3Blue1Brown had sent "Maths Christmas" and then thrown a random e in there, just cause he likes when e randomly shows up in places
"We've ruined the sanctity of the 'no central authority' - it was just the easiest way to do it" On one hand- you crushed my spirit with that remark. On the other- I'm and engineer, so I'm fully on-board!
My thought is to use encryption, and have no set order of things. In a public document everyone puts in their public key. We know when that’s completed when the number of keys matches the number of participants. Then anyone who wishes to can shuffle the list. Now you have an ordered list of public keys. Each participant encrypts a message with their name/address with the public key of whoever is after them on the list. This can also be placed in the document. Then once all the messages are in, you try to decrypt each message with your private key until you find one which decrypts to a name/address, and that’s who you buy a present for. Edit: lol, I should finish watching the video before commenting!
Apart from the fun challenge, I also enjoyed seeing all my favorite math channel people gathered in a video-chat panel like that. Feels very Star Trek-y optimistic about the future. If eventually a panel of lovely intelligent people could replace all the politics of the world. Thanks and Happy Holidays!
What's Steve so mad about, the mug clearly states "τ < π!", which is patently true at least if if you accept using the gamma function to extend the factorial operation to non-integers (in which case π! ≈ 7.188)
There is this rule in (secure) software engineering that I always held in high regards: "Don't roll your own crypto". This video perfectly illustrates why :)
True, as the probability being exactly 1/e would imply that n!/e out of the n! permutations are derangements (where n is the number of people). This cannot be true since n!/e is not an integer. However, the true number of derangements is actually the integer nearest to n!/e, so the real probability of a derangement is as close as possible to 1/e. So it is (at least to me) more interesting than "only in the limit".
My family group has an annoying extra rule that couples can't buy for each other and none would have the tolerance for a spreadsheet. Haven't figured out how to guarantee a derangement for that yet.
@22:10, the multiple shunts have no effect because at the end you can match your receiving and giving number to find out how many shunts have been applied, right? So you can reverse as many shunts you want as long as you don’t match your own ID’s
I think this is what I'm getting hung up on as well. I'm kind of assuming I'm missing something here, but especially in the initial version, in Peter's "simulated" list at 18:55, I don't understand why their recipient and sender ID can even be in those positions. Since the first participant shunted once and then no more shuffles were applied, isn't the recipient ID at index _n_ in the list not always the same person as the sender ID at index _n+1_ ? And then also, as you said, the shunts seem to be easily reversed anyway- very confused here tbh :/
@@kiraaaaaa wasn't the list shuffled afterwards during that stage? If the list is shuffled after shunting they can be separated by any amount, where the shunt accomplishes pairing a receiver with a random sender (the shuffle makes it so that any of the other receivers can be in the next position), though maybe there wasn't shuffles at that stage, I didn't pay that much attention, I know there wasn't shuffling at the very end but I feel like there was still shuffling there
Thinking a little more about it, shuffling when shunting would have a chance to break the cycle, so I guess this is an issue. It could possibly be resolved with some kind of shuffling algorithm that keeps the derangement. The thing that is most important to prevent is a self-contained loop, that is for someone to be matched with themselves, so as long as a shuffle kept all of the IDs separated enough, it would be fine. You could only to a limited amount of shuffling and shunting like this, for example, if you were to move one set of numbers down two spots you could be sure the next shunt is fine, but the one after that wouldn't be. If you moved it further and the next shuffle moved it back, it also might not be fine, which is why it would be important to have the shuffles happen in a very specific way in order to guarantee it works regardless of randomness with other shunts and shuffles
Yeah, that's what's been bugging me. Like, am I misunderstanding the algorithm, or do the shunts simply do nothing? At 19:00, Peter knows what his receiver and sender IDs are, so he knows that the shunt was seven spaces (unless there is shuffling post-shunt (which I don't believe there is)). This means he knows who Sophie is buying for since he only has to count seven spaces. Unless I'm mistaken, she'd be buying for Mithuna, sender ID 607.
As an AFOL, I have to say that Brady Haran got the best gift out of the bunch. Also, I just realized that ⅔ of A Podcast of Unnecessary Detail are in this video (Matt, you should’ve invited Helen Arney to complete the triangle). Anyways, Merry Christmas and a Happy New Year to all of you!! 🎄🎅🏻🎁
Great video, bit a little sad that not everyone appeared in the unboxing, just enjoyed to see what kind of gifts they all got eachother and would have loved to see them all :)
How are you preventing/handling multiple instances of the same random number? If by happenstance, multiple people have the same random number as receiver or giver, then when it comes to reading the names or replacing them, people aren't going to know which one to read/replace.
I love that Tom7 is a part of stuff like this now. He’s brilliant and funny and totally deserves to be in this stuff. I wish he was in 3b1b’s topology utilities puzzle on that mug. He’s the best.
For the version with a random number of shunts, afterwards everyone would learn how many shunts happened. Then as the receiver IDs are replaced by names, everyone should be able to reverse the shunts and decode the sender IDs. (STAGE 2: Everyone [...] remembers their exact locations. [...] No one shuffles.) Also, for composite _n_ , the shunts may create multiple loops (as in 22:04 with n=4). This may or may not be desirable.
dealing with a conspiracy is considerably harder. I suspect you'd need seeded PKI to generate multiple anonymous-to-owner public keys per person. Doing the final unwrap would be challenging. (and per someone we all know and love "there is not enough space in this margin to fully explain the method" :)
This is why I prefer the "bribe and recruit" method of dealing with people with that mindset. If they are personally invested in it succeeding (and/or have been promised a reward if no one breaks it), they will work hard to make certain it succeeds and prevent others from messing with it. Bribery is less effective (because of counter bribes), but there are ways to make your bribe relatively inexpensive and something that can't be countered - like homemade fudge, playing video games if they are family/friend and like that, helping them with a project, covering a shift that no one will want to cover, etc. Getting them invested in the process is harder, but they are less likely to turn on you for $20 and a hot cocoa.
So you're saying that Matt came up with an "unhackable" approach that was immediately found to be hackable? I guess you could say it's a... Parker Santa 😁
2:24 But the central authority does not need to be a person. It can be a computer (e.g. an app)! You don't have to trust a person or use a super complicated algorithm.
But then you would still have to trust the people developing and operating the app. While this may solve the trust problem in practice, theoretically it only moves the problem and doesn't solve it.
I - without sitting down to confirm with pen and paper - feel that a distributed hash chain could prove nobody is tampering with the process. An unoptimised example - every step can brute-force (and hash) every possible next step (less the value being randomly changed) … which could be publicly announced and publicly verified by the step after the next.
29:05 This looks like an optical grating foil. You can make neat things with that, like melt chocolate on it to give it the same rainbow-like patters. A really neat trick :)
I wonder how much Jane Street is recruiting through these sponsors... They are a dream job for many. I thought they'd have a billion applicants without that sponsored segment.
On average it takes less than 3 times to get a derangement, this method requires 3 passes of a more complicated process, so on average this method is less efficient than just randomly shuffling.
The thing about the mug is that you don't even need to break the system or know the billing address to know that Matt sent it because that's such a Matt Parker gift to send.
I enjoyed that: this is possibly one of the greatest gathering of minds since the Manhattan project. they were all as confused as me readiing a Haynes manual.
5:14 The problem of "forged position" is easy to solve: pick a random number from the list (except yours) and label the gift you've bought with the picked number. At the end everyone revels their numbers and takes a gift with their number.
Whats it like being on a zoom call with a group of people who have collectively yielded a positive changed the lives of a billon or so people? The amount of math's and science education represented in that zoom call is nuts.
Love this! Matt making strides towards improving something..😂 My thought process went on from the 'choose a random note with a name' step, and combining that with the random the two random numbers in Matt's system, where my thoughts went onto 'choose a colour you like (like red, blue and so on', but then if two chooses the same colour it would have to be redone, and if there are a lot of people, the likelihood of that happening increases.. but then I thought, you can choose very specific colours, as they all have numbers associated with them in the digital world, and so you choose the hue you like (and can even use a colour picker online), and that is 'your colour'. When everyone has a colour, which is unlikely to be chosen by anybody else, you simply choose between all the chosen colours (although the last one doesn't have a choice, but that's the same really, as when you pick randomly from a hat/bowl/thingamajig).. The workings of this could be made using several online tools, where you are anonymous, and when you choose the second colour, they write their name, but don't have yours, and when someone chooses your first colour choice, you write your name to the anonymous chooser. This will make it so there aren't any loops, or any possibility of tinkering/hacking the system, I think. But I am inclined to think that Matt actively chose to gift to Steve😂 it was funny anyway, and a fantastically Matt Parkerish way of ending the video!
11:20 here's the thing: in this system it's bot impossible to find out who you're giving a present to, it's TRIVIALLY EASY. you see, in the third pass, everyone's label is both out for all to see in the receiver's column and right above the person they'll be gofting. Basically, anyone can know who will get anyone's gift, which is as far from anonymous as it's possible to do.
If you want people to not know who they're buying for, you could just have them buy the gift first, *then* assign recipients. But I love a good bit of maths so I still prefer your method hahah
my favourite system is this: everyone buys a random generic present and you choose which gift you want to take based on the wrapping, if you are left with your own you ask to swap.
Great video, love your stuff! One way to solve this problem that came to mind while watching this, is that instead of using playing cards, write each participants' name twice on a small rectangular piece of paper, do the shuffle, taping and cutting as shown in the video, then you reveal only the bottom part to everyone (by folding it up), which is the "sender". Then each person just takes the piece of paper with their name and get to see the person they should send a gift to ("receiver"). This does however require that everyone is around by the time of the receiver assignment, to avoid malicious disruption, so I guess this require a central authority in some sense. Although everyone could participate in the shuffling to make sure that the order hasn't been tampered with.
One way to avoid the exploit in the first method where the last person chooses who they are going to buy for is to use a one way function like a hash function. In the second pass, when the list reaches C (n-1 th) person, C chooses a random seed s , replaces every number x on the list with f(s||x) where f is a public one way function and shuffles the list. Now when the last person receives the list and shuffles it, but they do not know which value corresponds to which number. Finally the list can be made public, then C reveals the seed s. Every one can calculate their own f(s||x), find the corresponding row and buy a gift for that person. This still has the problem where you may not get a derangement but with repeated attempts the probability of not getting a derangement decreases exponentially, so should be fine
09:11 This Zoom Call is probably the greatest smartest gathering since the Solvet conference or the Avengers reunion. Maths, Trains, Guns, Film, objects, etc…. I’m flabbergasted! 😂 Big fan or you all!!
Additionally to the fact that the number of shunts is available publicly by just comparing the two columns for your number (as many other commenters have pointed out already) , there is (if i understand the protocol correctly) also the flaw that Pn-1 can figure out Pn's numbers by noting down the whole list in round one and looking for the newly added numbers in round 2, and can then, because they know that they are the last one to shunt the list, reshunt in in such a way that they either give a gift or receive a gift from Pn
I also saw this. Even if the shunt is done by a random amount, once D gets the list in the second round they know A) how big the shunt was and B) the identity of all the buyers (since the buyers column is just the publically-named receivers column but shunted by X amount, which they know). The order of the pairs would need to be shuffled as each stage in the second pass in order to hide this information from D.
If you've got a mathematical algorithm so complicated you clearly need a computer to help you implement it, just use the computer to make the selection!
You still need a trusted party to do it. Whomever runs the code could maliciously swap the agreed upon open source code for a several orders of magnitude less efficient _different_ code that ensures they will always buy a present for Steve Mould, and nobody will ever find out.
The point of the algorithm is that no person needs to trust another. If you use a single computer to do it, you're trusting whoever controls the computer.
I love how Brady is surprised that he's the one who understood Matt's plan right off the bat, seemingly forgetting that he's literally a professional Matt Parker Understander haha
Thanks again to Jane Street! jane-st.co/SUM-internships
Yes, fatal flaws in my new system have already been found. Comment with more flaws or fixes below!
If everybody or no one shunts, than D can detect that and choose who to buy for. I think. I am not a hundred percent sure.
Actually doesn't they always know the number of shunts? They could theoretically choose anyway, because they know the order of people who added their number, and the difference between the shunts reveals who is buying for who, since your own number is an anchor. The number of shunt between the difference of your two numbers.
EDIT: And this is not only the case for d but for anyone. It is probably detectable if they choose to swap with someone to far away, as they know how many shunts can happen and see that the distance would have been impossible.
@@traywor Since you can see the number of shunts and then you see the names associated with all of the receivers you should also be able to see all of the buying relationships. It appers to me that it is not anonomised at all.
Clever trick using "pi factorial" to make the mug technically correct
@@HunterJEmy thoughts exactly!
Several people pointing out that tau is in fact less than pi factorial. Now I hate the mug even more, thanks.
Sounds like another pi win 🎉
Lololol!
@SteveMould I hope you see this. Sending big festive hugs from South Africa.
You and @standupmaths are such legends and reputable role models. Thanks for your good vibes!!
This mug must appear in your next video :)
I hope Matt sends you a second, less snarky gift. But the mug is right though :)
@@SteveMould it’s beautiful!
Nobody ever goes for my "Stochastic Santa" system where you just buy a present for someone at random and trust that everyone will get about the right number of presents in the long run
I mean I guess it is true that everyone will get one present on average
But what if I accidentally get myself a present! I can’t stand the one in a billion chance 😔
@@Numbabu
It's very vulnerable to bad actors and people picking their favorite person to buy a gift for
@@solsystem1342i think that may actually work both ways. The "favourite" in the group getting more presents but also the "im worried they will be forgotten about" getting more presents. Meaning the "normal" friends (for lack of a better word) have the biggest chance to recieve nothing.
Or that would be my guess :p i wonder if there have been studies done on this.
Works for me, I wouldn't buy any present for anyone. But I don't have to be anonymous to do that, I'm very public about hating gift giving.
Everyone: *Finding some elaboratly stupid ways of generating random numbers*
Brady: *Looks up random number generator*
The only safe option.
he took the cgp grey approach
pseudo random, i giggled
mildly dissapointed someone didn't use lava lamps!
I'd just roll some d10
15:38 Everybody finding random numbers in interesting ways, and Brady just using a random integer generator gave me a good chuckle
a good chuckle? lol in my case it was an entire cackle
Wished there was a clip of a guy on a green screen just going "eeeeeh... 2... 7... 1"
You wouldn't have thought he'd be the odd one out
I felt worried the gift I bought wouldn’t compare to some of the others but seeing that someone bought *a piece of cellophane* makes me feel a whole lot better 😂
You bought the cellophane didn’t you … very clever
OK what
Hey why were you included in this? You're a doctor, not a math guy! I'm pretty sure you've never even said a number out loud.
@@LeoStaley medical statistics
@@LeoStaley, don’t make him pronounce your demise.
As I told Matt 4 minutes before he posted the video, I think the new version proposed around 23:00 is quite flawed. The algorithm always produces a cyclic permutation where player Xn is giving to player X(n + m), with 0 < m < num_players. That's good, but since we don't shuffle after that and the ordered list is eventually public, everyone can figure out what m is: Just computing the difference between your own position in the list and your own recipient. That means you can figure out the entire graph!
Oh, absolutely!
You could probably fix this by having D shuffle after replacing their number at the end of first cycle and A shuffling at the start of the second cycle.
This however doesn't fix the exploit of taking yourself out of the game.
For the record, I saw Tom7’s email five seconds after I set the video live.
This is absolutely correct. We’d need to put shuffles back in somewhere before the names round, but this will allow the same shenanigans as the first system again. This new idea might be a bust.
We might need to go back a version and use public-keys instead of names.
@@standupmathsI knew this problem was screaming cryptography
couldn't you simply shuffle the rows as you put in your name? that way, the list doesn't directly correlate to the cycle you're building anymore, but you're not changing anything about the assignments
Wait, does this make me a Maths UA-camr now? 😂 thanks Matt, thanks everyone, delighted to have taken part. Merry Christmas all 😊
Yep, your videos definitely have enough interesting stats
A maths UA-camr in Training
To be honest Geoff when I saw you there I thought the same.
You DID help Matt with a parkrun related stopwatch Bingo maths video that time though so I guess that counts doesn't it? (Annoyingly I've been stuck at 59/60 for ages on that)
Your method of generating random numbers is not random because the probability of each number decreases. Train numbers are given sequentially per train class so every class has a 001 but hardly any class would ever have 999
American here: It's actually pronounced "Matthew-tuber."
matt completely ruining it by sharing the tracking info is very funny after all of that effort lol
Might have been intentional. If he's going to troll someone by pushing their buttons, he's going to want them to know he's the one who did it.
Given the sentiment on the mug, there was no way Steve wouldn't know, lol
Would you not assume it was someone else pretending to be Matt as an extra level of Mystery? That's what I thought.
It’s a Paker Santa
true... but like, arent you supposed to reveal yourself to the person _when_ you give the gift? naturally you dont want to reveal it beforehand, and maybe it's a cultural difference, but ive always had to reveal it to everyone in fact when giving the gift
31:28 the face of Matt Parker appearing on screen as soon as it's revealed he bought Steve's gift is comedy gold
What are you talking about ?
@@rmvdhaak The end card subscribe button
@@rmvdhaak It might not show up for you because it's not part of the video itself but youtube put a link to Matt's channel (with his face as the icon) right on top of the video at that moment for me too.
The unboxing is why there should always be a price guide because I imagine cellophane and a fairly large lego set cost very different amounts 😅
😐
The lego set is ~$140 in my area.
Cellophane on Amazon is under 10 cents per square feet, for 100 feet rolls.
tbf considering the money they're making, it surely makes no difference and a fun gift might be better than an expensive one...
@its_w4yne bold assumption about their income
@@bee_irl I know what people with way less clicks make and I'm pretty sure it's easy to find some data about that. and I'm pretty sure they all monetize their videos since there are ads *and* there even are sponsors. so that assumption isn't that bold.
9:23 the amount of people I recognize from the Extended Parker Universe is quite staggering tbh
How many Parker squares are in the Parker universe?
What is the mass of the people you recognize?
Seeing Tom7 there threw me for a bit of a loop!
And many of them are more successful UA-camrs than Matt.
Weirdly the ones I recognise the most are the ones that aren't Mathematicians...
So thrilled to see Tom7 in this. His incredibly infrequent uploads are such a highlight.
I really like that you showed the process of explaining to everybody the system and almost none of them understood it the first time. When you don´t see the behind the scene stuff you think that all mathematicians just get everything math related first try. Which obviously is not true
31:37 It's factually accurate! τ is less than π factorial
I grudgingly accept this logic.
Is factorial defined for non-integers? It isn't quite Gamma...
@@landsgevaer not exactly, but there is i believe a function/algorithm that mimics the behavior of the factorial function that still works for non integer numbers
This gets into the ticky-tacky question of "What is the definition of factorial?" If you define it as "n! = n*(n-1)!" plus "0!=1" then no. However, if you define it as "A function that meets the above definition for all natural numbers" then maybe yes.
I think we have to defer to calculators on this -- if you enter 1.25 and press the factorial button, it produces a number as a result, not an error. Thus, the Gamma function is the *true* definition of the factorial operator and the natural number definition is a "that's neat" type of thing.
I can see people arguing the converse, though. After all, factorial existed long before the gamma function was discovered, so if you go back far enough then factorial was only defined on the natural numbers. Plus the gamma function is its own thing with its own name -- it seems suspect that there would be two _different_ operators defined for a single operator. The later argument can be countered by pointing out that gamma _isn't_ equal to factorial, but "(n-1)! = gamma(n)" is close enough to say "The gamma function *is* the factorial function."
Too deep of a question for me, I'm afraid. 😂
@@landsgevaerWhile there are in principle infinitely many ways to extend the factorial function to noninteger values, if you add in a few extra conditions, the only possible extension is x!=Gamma(x+1).
The conditions I'm thinking of are
- x!/(x-1)!=x, and
- the function f(x)=(x+c)!/x! is an increasing function for fixed c, for positive c and sufficiently large x
It's a matter of opinion if you think these are reasonable restrictions. (If I've done my job right, the second condition should be equivalent to "log convexity", which states that log(x!) is a convex function for sufficiently large x)
I'm just shocked we didn't get any crappy python code to test this
Or a spreadsheet!
If they use programming, then this is a short instead of a half hour overthinker video
Well the code would follow all the algorithms and thus always produce a fully functioning array.
However the struggle with the problem is not how the algorithm could be wrong but rather how someone could deter from the algorithm without getting noticed or someone finding any informations about who could give to whom.
15:30 Banana alpha decay... Tom is a genius!
Is that the harder drives guy?! Edit: IT IS! I love this guy
If you look for "banana random number generator" on google, there is a whole device I designed exactly for that: generating random numbers from potassium decay in bananas
BTW potassium 40 does not decay in alpha particles, but rather in beta
The radioactive banana method was absurdly overengineered by normal standards, but disappointingly straightforward for Tom7. I hope he at least turned the banana into a NES emulator afterwards.
And then used that emulator to make chess algorithms.
Wow, the thumbnail and title of this video didn't prepare me for the avengers assembling. What a Christmas treat!
😂
ah, The Parker Protocol. At least he gave it a go.
Merry Christmaths All!✨
and thank you to the editor who cut out the several minutes where I couldn’t figure out why someone would gift me such a tiny scarf. It is a very cute dog bandana, thanks Santa! 💗
I was expecting several more folds when you held it up, and got confused. 😅
Obviously your dog hacked the system!
"is there an e in Christmas?"
I genuinely thought that 3Blue1Brown had sent "Maths Christmas" and then thrown a random e in there, just cause he likes when e randomly shows up in places
leave it to tom7 to have a ridiculously overengineered method to generate random numbers
Very on-brand!
Followed by Brady just using a random number generator.
Gota get that sucker pinch in.
I was super surprised to see him and 0 surprised by his insanity.
When Steve revealed the tau < pi mug I *knew* it was Matt who bought it lol
It is parker-smaller-than ,you mean? That is, smaller-than, but you are allowed to be a bit off?
@@landsgevaer tau < pi factorial, factually correct!
I deeply appreciate the color choices being colorblind friendly ❤
The fact that this is flawed again it's making everyone happier I think.
Which makes this the Parker Santa, just like the Parker Square, in honour of "those methods that just fall short."
Just casually being able to set up a call with _all_ of mathematical UA-cam at once is quite the flex.
Wherher Matt getting Steve was sabotage or chance, it was perfect
"We've ruined the sanctity of the 'no central authority' - it was just the easiest way to do it"
On one hand- you crushed my spirit with that remark.
On the other- I'm and engineer, so I'm fully on-board!
The real gift here is getting to hear all these math folks discussing this with passion.
My thought is to use encryption, and have no set order of things.
In a public document everyone puts in their public key. We know when that’s completed when the number of keys matches the number of participants.
Then anyone who wishes to can shuffle the list.
Now you have an ordered list of public keys. Each participant encrypts a message with their name/address with the public key of whoever is after them on the list. This can also be placed in the document.
Then once all the messages are in, you try to decrypt each message with your private key until you find one which decrypts to a name/address, and that’s who you buy a present for.
Edit: lol, I should finish watching the video before commenting!
Apart from the fun challenge, I also enjoyed seeing all my favorite math channel people gathered in a video-chat panel like that. Feels very Star Trek-y optimistic about the future. If eventually a panel of lovely intelligent people could replace all the politics of the world. Thanks and Happy Holidays!
Feeling Jolly! Merry Christmas everyone. Peace and Love to all.
Merry Christmas, Destin! I went to Covenant College. Very cool to see you were there!
“I recorded the radioactive decay of potassium in a banana” is something i was not expecting to hear on a christmas day
Me just enjoying the community he invited at 9:20, casually reading through the na.. HOLY SHORTS I'TS TOM SEVEN!?!?!?!
HE PLAYS A CARRYING ROLE
Imagine how *I* felt, casually watching @Standupmaths!
@@tom7 Genuinely happy to see the cameo, and patiently waiting for more videos.
What's Steve so mad about, the mug clearly states "τ < π!", which is patently true at least if if you accept using the gamma function to extend the factorial operation to non-integers (in which case π! ≈ 7.188)
I never thought I'd see the day of a Tom7 and standupmaths collab. I'm in heaven.
Tom7 using potassium decay to generate random numbers is actually hilarious
There is this rule in (secure) software engineering that I always held in high regards: "Don't roll your own crypto".
This video perfectly illustrates why :)
Seeing Tom7 in a non-Tom7 video is perhaps the best gift I've gotten this year, let alone Christmas
Small correction: The probability of getting a derangement is only 1/e in the limit as the number of people playing approaches infinity.
Infinite Imaginary Friends.
True, as the probability being exactly 1/e would imply that n!/e out of the n! permutations are derangements (where n is the number of people). This cannot be true since n!/e is not an integer.
However, the true number of derangements is actually the integer nearest to n!/e, so the real probability of a derangement is as close as possible to 1/e. So it is (at least to me) more interesting than "only in the limit".
yoooo it’s matt, love that guy
Thanks 😁
I am constantly shocked by how small the youtube world can be. Loved seeing suckerpinch and hope to see more of him!
This has always been one of those problems that feels like there should be an elegant solution and yet we get to have all this fun instead.
I love how you ended up having a central authority just with extra steps because "it was just the easiest way to do it." 26:09
My family group has an annoying extra rule that couples can't buy for each other and none would have the tolerance for a spreadsheet. Haven't figured out how to guarantee a derangement for that yet.
There are apps for this, you can out forbidden people in I.e. A can't buy for B.
There are several free apps that do seceret name draws. DrawNames is one i've used that you can set up exclusions such as couples.
@22:10, the multiple shunts have no effect because at the end you can match your receiving and giving number to find out how many shunts have been applied, right? So you can reverse as many shunts you want as long as you don’t match your own ID’s
I think this is what I'm getting hung up on as well. I'm kind of assuming I'm missing something here, but especially in the initial version, in Peter's "simulated" list at 18:55, I don't understand why their recipient and sender ID can even be in those positions. Since the first participant shunted once and then no more shuffles were applied, isn't the recipient ID at index _n_ in the list not always the same person as the sender ID at index _n+1_ ? And then also, as you said, the shunts seem to be easily reversed anyway- very confused here tbh :/
@@kiraaaaaa wasn't the list shuffled afterwards during that stage? If the list is shuffled after shunting they can be separated by any amount, where the shunt accomplishes pairing a receiver with a random sender (the shuffle makes it so that any of the other receivers can be in the next position), though maybe there wasn't shuffles at that stage, I didn't pay that much attention, I know there wasn't shuffling at the very end but I feel like there was still shuffling there
Thinking a little more about it, shuffling when shunting would have a chance to break the cycle, so I guess this is an issue. It could possibly be resolved with some kind of shuffling algorithm that keeps the derangement. The thing that is most important to prevent is a self-contained loop, that is for someone to be matched with themselves, so as long as a shuffle kept all of the IDs separated enough, it would be fine. You could only to a limited amount of shuffling and shunting like this, for example, if you were to move one set of numbers down two spots you could be sure the next shunt is fine, but the one after that wouldn't be. If you moved it further and the next shuffle moved it back, it also might not be fine, which is why it would be important to have the shuffles happen in a very specific way in order to guarantee it works regardless of randomness with other shunts and shuffles
Yeah, that's what's been bugging me. Like, am I misunderstanding the algorithm, or do the shunts simply do nothing? At 19:00, Peter knows what his receiver and sender IDs are, so he knows that the shunt was seven spaces (unless there is shuffling post-shunt (which I don't believe there is)). This means he knows who Sophie is buying for since he only has to count seven spaces. Unless I'm mistaken, she'd be buying for Mithuna, sender ID 607.
As an AFOL, I have to say that Brady Haran got the best gift out of the bunch. Also, I just realized that ⅔ of A Podcast of Unnecessary Detail are in this video (Matt, you should’ve invited Helen Arney to complete the triangle).
Anyways, Merry Christmas and a Happy New Year to all of you!! 🎄🎅🏻🎁
When everyone was selecting their random numbers, they were extremely quiet. Got an ad in the middle and nearly went def
Considering the last week Numberphile video, I'm a really happy to see Ayliean McDonald still in your friends list !
Merry Christmas everybody !
Great video, bit a little sad that not everyone appeared in the unboxing, just enjoyed to see what kind of gifts they all got eachother and would have loved to see them all :)
How are you preventing/handling multiple instances of the same random number? If by happenstance, multiple people have the same random number as receiver or giver, then when it comes to reading the names or replacing them, people aren't going to know which one to read/replace.
We just had the rule that you cannot use a random number already in the list, you need to pick again.
Yeah I thought about this
I was wondering this too. - so the random number isn’t quite random …
Rare tom7 appearance
It's usually once a year on April 1!
This is exactly the kind of christmas morning program I wanted to watch! Merry Christmath, everyone!
I love that Tom7 is a part of stuff like this now. He’s brilliant and funny and totally deserves to be in this stuff. I wish he was in 3b1b’s topology utilities puzzle on that mug. He’s the best.
For the version with a random number of shunts, afterwards everyone would learn how many shunts happened. Then as the receiver IDs are replaced by names, everyone should be able to reverse the shunts and decode the sender IDs.
(STAGE 2: Everyone [...] remembers their exact locations. [...] No one shuffles.)
Also, for composite _n_ , the shunts may create multiple loops (as in 22:04 with n=4). This may or may not be desirable.
omg yes!!! i've been interested in this topic for ages, glad to see a video from one of my favorite math youtubers on it :D
Malicious actors could share their random numbers to break everything lol
Yes, none of these systems are robust against colluding malicious actors. It would be incredible if one is though!
dealing with a conspiracy is considerably harder. I suspect you'd need seeded PKI to generate multiple anonymous-to-owner public keys per person. Doing the final unwrap would be challenging. (and per someone we all know and love "there is not enough space in this margin to fully explain the method" :)
@@standupmaths This sounds like a good maths paper lol
This is why I prefer the "bribe and recruit" method of dealing with people with that mindset. If they are personally invested in it succeeding (and/or have been promised a reward if no one breaks it), they will work hard to make certain it succeeds and prevent others from messing with it. Bribery is less effective (because of counter bribes), but there are ways to make your bribe relatively inexpensive and something that can't be countered - like homemade fudge, playing video games if they are family/friend and like that, helping them with a project, covering a shift that no one will want to cover, etc. Getting them invested in the process is harder, but they are less likely to turn on you for $20 and a hot cocoa.
Well but who knows if they are sharing their real number as their own and not just one they saw...
So you're saying that Matt came up with an "unhackable" approach that was immediately found to be hackable? I guess you could say it's a... Parker Santa 😁
I miss the videos from Tom7 so much! We need much much more of his genius in this world!
2:24 But the central authority does not need to be a person. It can be a computer (e.g. an app)! You don't have to trust a person or use a super complicated algorithm.
But then you would still have to trust the people developing and operating the app. While this may solve the trust problem in practice, theoretically it only moves the problem and doesn't solve it.
I - without sitting down to confirm with pen and paper - feel that a distributed hash chain could prove nobody is tampering with the process. An unoptimised example - every step can brute-force (and hash) every possible next step (less the value being randomly changed) … which could be publicly announced and publicly verified by the step after the next.
I loved seeing all of the participants methods of getting their random numbers.
29:05 This looks like an optical grating foil. You can make neat things with that, like melt chocolate on it to give it the same rainbow-like patters. A really neat trick :)
It is indeed.
I wonder how much Jane Street is recruiting through these sponsors... They are a dream job for many. I thought they'd have a billion applicants without that sponsored segment.
My mind definitely went to public key cryptography as a method for anonymization. Glad you mentioned it!
I love how Steve mould is just hacking the postal system instead of Matt’s system. 😂
a side channel exploit if you will
23:08 - D will know how many shunts there have been due to how displaced their numbers are
15:39 After all these random number techniques, I totally expected Brady to lean over and scream: "Kylie!!! Give me 4 numbers! Kylie!!??!?"
Merry Christmas Matt :)
On average it takes less than 3 times to get a derangement, this method requires 3 passes of a more complicated process, so on average this method is less efficient than just randomly shuffling.
I think you missed the point of the video.
That's a good point, on average.
How dare you accuse Matt Parker of doing anything mathematical with an inefficient process.
The thing about the mug is that you don't even need to break the system or know the billing address to know that Matt sent it because that's such a Matt Parker gift to send.
Yo, Tom7! Love his stuff, so good to see him in the mix here
Merry Christmas, Matt and everyone!
I enjoyed that:
this is possibly one of the greatest gathering of minds since the Manhattan project.
they were all as confused as me readiing a Haynes manual.
5:14 The problem of "forged position" is easy to solve: pick a random number from the list (except yours) and label the gift you've bought with the picked number. At the end everyone revels their numbers and takes a gift with their number.
This doesn't guarantee a derangement; the last person may be forced to pick themself
in a standard trust based environment, "If you draw yourself, call out and, we go again" is good enough
The most impressive thing in all of this is that you managed to schedule a call with 18 maths youtubers and everyone had time
Whats it like being on a zoom call with a group of people who have collectively yielded a positive changed the lives of a billon or so people?
The amount of math's and science education represented in that zoom call is nuts.
Love this! Matt making strides towards improving something..😂
My thought process went on from the 'choose a random note with a name' step, and combining that with the random the two random numbers in Matt's system, where my thoughts went onto 'choose a colour you like (like red, blue and so on', but then if two chooses the same colour it would have to be redone, and if there are a lot of people, the likelihood of that happening increases.. but then I thought, you can choose very specific colours, as they all have numbers associated with them in the digital world, and so you choose the hue you like (and can even use a colour picker online), and that is 'your colour'. When everyone has a colour, which is unlikely to be chosen by anybody else, you simply choose between all the chosen colours (although the last one doesn't have a choice, but that's the same really, as when you pick randomly from a hat/bowl/thingamajig).. The workings of this could be made using several online tools, where you are anonymous, and when you choose the second colour, they write their name, but don't have yours, and when someone chooses your first colour choice, you write your name to the anonymous chooser. This will make it so there aren't any loops, or any possibility of tinkering/hacking the system, I think.
But I am inclined to think that Matt actively chose to gift to Steve😂 it was funny anyway, and a fantastically Matt Parkerish way of ending the video!
I find it incredibly funny how Matt went through all this trouble to hide who gave the gift, just to accidentally leak who he gifted to himself 🤣
Perfectly timed channel bubble popup in Steve's unboxing segment.
11:20 here's the thing: in this system it's bot impossible to find out who you're giving a present to, it's TRIVIALLY EASY. you see, in the third pass, everyone's label is both out for all to see in the receiver's column and right above the person they'll be gofting. Basically, anyone can know who will get anyone's gift, which is as far from anonymous as it's possible to do.
yes, the offset between label and number is the same for everyone so if you know your offset, you can know anyone’s
Tom7 is a role model. Incredibly talented
the range of gifts is entertaining. a piece of celophane was obviously the best one
everyone: Let me conveive the most difficult method to get random numbers. Brady: Opens the internet.
Santa is a quantum entity. Nobody has ever observed him so he's able to give presents to all houses simultaneously
If you want people to not know who they're buying for, you could just have them buy the gift first, *then* assign recipients. But I love a good bit of maths so I still prefer your method hahah
Selecting the random number was epic. Brady did what a lazy engineer like myself would have done - let's get something on the internet.
my favourite system is this: everyone buys a random generic present and you choose which gift you want to take based on the wrapping, if you are left with your own you ask to swap.
Ima call this the Parker Protocol 💀
Great video, love your stuff! One way to solve this problem that came to mind while watching this, is that instead of using playing cards, write each participants' name twice on a small rectangular piece of paper, do the shuffle, taping and cutting as shown in the video, then you reveal only the bottom part to everyone (by folding it up), which is the "sender". Then each person just takes the piece of paper with their name and get to see the person they should send a gift to ("receiver"). This does however require that everyone is around by the time of the receiver assignment, to avoid malicious disruption, so I guess this require a central authority in some sense. Although everyone could participate in the shuffling to make sure that the order hasn't been tampered with.
One way to avoid the exploit in the first method where the last person chooses who they are going to buy for is to use a one way function like a hash function.
In the second pass, when the list reaches C (n-1 th) person, C chooses a random seed s , replaces every number x on the list with f(s||x) where f is a public one way function and shuffles the list.
Now when the last person receives the list and shuffles it, but they do not know which value corresponds to which number.
Finally the list can be made public, then C reveals the seed s. Every one can calculate their own f(s||x), find the corresponding row and buy a gift for that person.
This still has the problem where you may not get a derangement but with repeated attempts the probability of not getting a derangement decreases exponentially, so should be fine
09:11 This Zoom Call is probably the greatest smartest gathering since the Solvet conference or the Avengers reunion. Maths, Trains, Guns, Film, objects, etc…. I’m flabbergasted! 😂 Big fan or you all!!
Additionally to the fact that the number of shunts is available publicly by just comparing the two columns for your number (as many other commenters have pointed out already) , there is (if i understand the protocol correctly) also the flaw that Pn-1 can figure out Pn's numbers by noting down the whole list in round one and looking for the newly added numbers in round 2, and can then, because they know that they are the last one to shunt the list, reshunt in in such a way that they either give a gift or receive a gift from Pn
That doesn't work - every round you swap out your numbers when you get the list exactly to prevent that.
I also saw this. Even if the shunt is done by a random amount, once D gets the list in the second round they know A) how big the shunt was and B) the identity of all the buyers (since the buyers column is just the publically-named receivers column but shunted by X amount, which they know).
The order of the pairs would need to be shuffled as each stage in the second pass in order to hide this information from D.
I love the nerdiness of this video, especially how they are generating random numbers.
If you've got a mathematical algorithm so complicated you clearly need a computer to help you implement it, just use the computer to make the selection!
You still need a trusted party to do it. Whomever runs the code could maliciously swap the agreed upon open source code for a several orders of magnitude less efficient _different_ code that ensures they will always buy a present for Steve Mould, and nobody will ever find out.
The point of the algorithm is that no person needs to trust another. If you use a single computer to do it, you're trusting whoever controls the computer.
I love that all of this could be solved by a very very simple program
I love how Brady is surprised that he's the one who understood Matt's plan right off the bat, seemingly forgetting that he's literally a professional Matt Parker Understander haha
Oh my God. The way everyone chose heir random numbers was just so fitting for everybody.