What Happens If We Add Fractions Incorrectly?
Vložit
- čas přidán 27. 06. 2024
- What happens if we add fractions incorrectly? Can we do something with that? This video covers mediants, Simpson's paradox, Farey sequences, the Stern-Brocot tree, Ford circles, rational approximations, and Hurwitz's theorem.
Hurwitz range interactive: www.desmos.com/calculator/q39...
Credit to mathmasterzach for his help. His website: www.mathmasterzach.com/
Additional sources:
www.cut-the-knot.org/blue/Med...
www.whitman.edu/Documents/Aca...
My Patreon: / zhulimath
0:00 Definition of a mediant
1:52 Simpson's Paradox
6:03 List of all rational numbers
15:41 Visualizations
17:08 Ford circles
18:41 Rational approximations and Hurwitz's Theorem
25:20 Outro: Why did we do all of this?
Intro riff taken from: Nikolai Kapustin - 8 Concert Etudes, Op. 40: III. Toccatina
Music Credit:
Elegance / Megan Wofford
Technicolor Dreamscape / Franz Gordon
Joy in the Little Things / Sayuri Hayashi Egnell
Reve d'enfant / Magnus Ludvigsson
Lovely Dinner / Franz Gordon
When Sun Meets Moon / Gavin Luke
courtesy of www.epidemicsound.com
Imagine teaching fractions in elementary school and a kid says "I'm not doing addition wrong, I'm computing the median" and then explains everything from this video.
That's some Terry Tao shit
Bro's believes hes Gauss
@@alonelyphoenix8942
“By the time Gauss was 7 years old, his schoolmasters admitted that there was nothing more they could teach the boy.”
~David Burton, Elementary Number Theory
Simpson's paradox seemingly exists because of the disconnect between percentage and absolute values. To make the paradox more intuitive you can use an analogy: you can state that a cup of vodka is 50% alcohol and wins over 5,000,000 barrels of 18% alcohol wine, but if you add a gallon of water with .0001% alcohol to each the wine would "win." Basically the absolute value of how many objects you are working with gets 'lost' or 'obfuscated' or 'untracked' when you mix the two data sets, if stated in a slightly better way it would become obvious that small amounts of data are more susceptible to outliers than large amounts of data.
You can even add a gallon of "winning" water with 2% alcohol to the vodka, and a gallon of "losing" water with 1% alcohol to the wine.
@@RibusPQR
I hesitated to split the second set into two due to making the "simple" explanation too hard to read but the major take away is that the SIZE of all the different sets is a large reason why this works. But you do make a good point that the actual "paradox" comes from adding winners vs adding losers.
----
On a side node, in my example if you added 1 trillion barrels of 2% alcohol and 1% alcohol the vodka would go back to winning. Gosh this entire area of math just doesnt want to cooperate.
And, as abstinent, I can always redefine the"win" and the "lost" :P
Not to try and roast ya but I was unfamiliar with simpsons paradox until this vid and it took me so gd long to figure out what you meant. Honestly still not even there, I thought you meant that the vodka wins because it’s a higher percentage of alcohol. And that it changes when you add the gallon of .0001% water to the wine because maybe there’s more gross alcohol in a gallon of low alcohol content than one cup high. But that still doesn’t make any sense because one hand is measuring gross and the other percentage. How exactly are you determining who wins, and why is the vodka just a cup and the wine a barrel (55 gallons I guess)? Funnily enough I understand simpsons paradox (looked into it separately) but I can not for the life of me figure out how it relates to your example lol
@@monhi64 the wine wins in alcohol percentage because the wine is 5,000,000 barrels so adding a gallon of water doesnt change the percentage of alcohol in the wine much but the vodka is a cup so adding a gallon of water dilutes it more so the percentage of alcohol in the vodka ends up being lower than the wine even though the vodka begins with higher percentage
i was the apprenticeship instructor for the roofing program in calgary for 13 yrs...
my most fulfilling memory was being able to teach fractions and the metric system to 40 yr old roofers with learning disabilities, addiction problems and 'incomplete' education scenarios...
seeing the look on someone's face when they actually get it and feel good about themselves...i was so blessed to help...
Even if the other entries in SoME3 are incredible, this deserves at the very least an honourable mention.
Good news!
If ad-bc=1, you can use Pick's Theorem to prove a bunch of properties of the mediant. The parallelogram is a lattice polygon with area 1, and we know 4 points on its border. Since the area is the number of interior points plus half the border points minus 1, there must not be any points in the interior and no more points on the border, so there cannot be any rational numbers that would fall in this region or on its border.
Strongly agree
what a load of bs. is this what most PhDs in meth do?
Yes yes definitely agreed
Finally someone talked about this ! Last year I rediscovered most of this, in a attempt to find an algorithm that converts computer floating point numbers into a ratio, without suffering from the precision loss of floating point arithmetic. I couldn't find anything about this on the internet, until a friend of mine did. I'm happy more people learn about this simple but very interesting maths concept !
Just wondering, did you do project Euler? If so then for that problem I think what I did was if the |ratio - floating point|
@@siddanthvenkatesh2744 I don't know about project Euler, but yes you avoid any operations on floating numbers to avoid losing precision, and just use comparisons in order to know if your ratio is close.
That was the first thing I thought of when thinking of a fun application for these concepts. A friend of mine actually fiddled around with similar ways of representing floats after I told them that the only way to never lose any precision was to always preserve the full chain of operations that occur when some variable becomes imprecise, then recalculate values on the fly with the desired precision when retrieving them in the future. I believe they did end up representing floats as ratios of VLIs, but I'm not sure how far they got in terms of being able to achieve any desired precision.
Actually floating point numbers are alreaady exact rational numbers; imprecision comes in only when you try to calculate a number that cannot be exactly represented as floating point value. However when converting to a fraction, that loss alredy happened, and if you convert to anything but the exact value of that float, you are going to adda second imprecision on top of it. That second imprecision *may* cancel out the first, but unless you take into account knowledge on how you arrived at it, generally it will not.
Indeed, every floating point number (except for infinities and NaN, of course) can be written exactly as m*2^n where m and n are integers where m can be derived from the sign and mantissa bits, and n can be derived from the exponent bits (with some special handling for denormalized numbers; those however are also of the form above, just the formulas for m and n are slightly different). Of course in that representation you lose the signed zero (unless you store m in a signed-magnitude or 1-complement integer representation, which also has signed zero), but then, mathematically 0 = -0 anyway..
@@__christopher__ Floating point numbers aren't exact rational numbers because of infinite (binary) decimals that can't be represented. And in my algorithm for the conversion, you define the converted number as the one that if you convert back to a float, you get the original, so in a way there are no loss of precision during conversion. Also you can represent infinities, nan and -0 in a well-designed library with 1/0, -1/0, 0/0, 0/-1.
It is just nice when u start from very simple things and sort of play around with it to discover interesting observations. It feels like going in the reverse direction when u are reading a theorem. Instead of having a very complicated unintuitive statement thrown at you and then having to use every single brain cell to figure out why that even works in the first place, this just feels very satisfying. It feels like the thought process flows naturally, without resistance.
I love it when different bits of math come together so sensibly and beautifully. Excellent video.
It was lovely getting an intuition on where the mystifying square root of 5 comes from in Hurwitz’s theorem!
I'm in high school. Clicked with great curiosity to watch and expand my knowledge but it slowly kept getting more and more complex until my brain couldn't understand
That's ok! It's amazing that you have curiosity about math. The video can get a little advanced at places, it's not a video meant for everyone. Don't worry too much about it, just try your best and take things at your own pace, maybe come to it in the future when you have stronger foundations.
Some of my other videos might be a little simpler and easier, if you want to give them a try, like this one: czcams.com/video/3B-D3w292TI/video.html
I am in highschool too, few months ago I saw it understood not very much, today rewatching understood more then that time(not everything obviously) so maybe in my next re watch I will understand more
Damn criminally underrated video. Good work man. Keep em coming
Excellent video. I felt like every time you introduced a new concept, I had some questions pop into my head and thought "I'll have to google this after..." but then you answered the question in the video!
Wow, I saw the thumbnail and thought that the video would be something really simple, but then saw it was nearly 30 minutes long! Unexpectedly turned out to be an absolutely banger! Good job man!
Me too - i recall stern brocot series' "name" from some quantum or other foo-bar but only the name - its the first video somebody draw it for me/ made a picture of it :)
I can’t believe this channel isn’t bigger, you’re doing amazing!
Great video, I like it! It's interesting and yet incredibly calming. It draws you in and immerses yourself into the topic. I didn't think that a bit of classical piano could do that to a video. I can imagine myself calming down to it in the evening or something. A portion of Maths before bed. Your calm voice goes with it.
Frick yeah, new zhuli video just dropped!
The intro riff sounded vaguely familiar to me, so I checked the description and it’s Kapustin! Great taste in music and great video
The piano is so relaxing, thank you!
I ran into these structures while solving some project Euler problem. This explanation was just so perfect. Thank you.
This was really neat. I did see the graph visualisation coming, but seeing a visual example of Simpsons Paradox was also pretty cool. And the irrational approximations was also pretty cool
would love a ford circle video! love the way you break things down :3
This is a great video! I love this graph in the outro, it looks cool and really helps to rewind the video in the head.
The theme is very cool too, I love when the video just starts investigating and playing with some concept just to see what happens. That's really my favorite part of math. Last time I caught that feeling when watching that video about hackenbush and surreal numbers. This was like my 2nd favorite math video of all time, and yours is really high up there!
It's a shame that you couldn't fit everything in it, on 18:00 the audio quality changes for a moment meaning that this part was recorded after everything else, so you probably didn't have enough time. So please make part 2 to cover it!
Spectacular video and ending message. Keep exploring, gathering adjacrent math topics, and learn something new!
جميل جداً، عمل متقن ومثير للاهتمام
شكراً على الجهود المبذولة في هذا الفيديو
Very good video. Criminally underrated.
Great video, watched the whole thing, hope you get more views 😄
Great video, I'm subscribing!
jajaja. I was wondering why you weren’t just using the determinant at the beginning, good that I stayed. Great video! Interesting as well.
This is the first video I’ve ever seen from this channel. I love the choice of music for the intro lol - the end of Kapustin‘s 3rd Concert Etude.
This is a banger!let me share it! Eye opener
this channel is so underrated!
I was not prepared for this wild ride
I like how my thought upon seeing the thumbnail was, "So like vectors?"
Yep.
I planned on covering this topic as an interactive website for SoME1 for use as estimations. You came at it from a much better angle and covered more than I would have
This video gives me a brand new perspective of how to look at math. Thanks
Your Stern-Brocot (mediant/parallelogram) tree is interesting. Perhaps it has some utility in combinatoric questions, such as the open no-three-in-line problem. In any event construction of the tree is simpler than attempting to enumerate unique slopes on a grid from scratch.
This was very reminiscent of a first year linear algebra course where you just jump from one result to the next, it was actually a very nice style which I enjoyed. I imagine a lot of people will need to skip back and rewatch some proofs (I usually watch on x3 speed, but here I had to take it all the way down to 1.5), but I don't think this is a bad thing, it just meant it was dense with information. The results were certainly better motivated and appeared more naturally than in a university course, and I especially liked how you drew from many areas to show results. This is a perfect mix of technical writing, recreational mathematics, and use of the video medium. Well done!
You have 3x speed?!
@@1.4142 I've got a firefox extension that allows me to change the playback speed. Gives me much more resolution in choice of speed, lower and higher speeds, and keyboard shortcuts to change speed. Works on pretty much any video as well, not just on youtube.
School teachers: "You can't divide by 0"
Mediant: "Hold my beer"
This is a killer math video will be recommending to all my friends! 👍👍
I took a break from a math practice test to watch a half hour long video about math.
Truly a chad
for those still confused about Simpsons paradox, it's because the pair of vectors which have lower slopes has most of its magnitude distributed into its higher slope vector, whereas the higher slope pair of vectors doesn't.
basically it's the weighting.
5/5 is larger than 499/500 and 1/4 is larger than 1/5, but 6/9 is smaller than 500/505
Hi - i am sorry but i cant imagine your explanation - i think it can happen but not always so the "always iff explanation wont make always working examples" ?
regarding the first part of video i simply (as a phycisist) thought about normalized vectors instead of circles or spheres :) and found out there are also some lower + lower pairs that wont make higher sum. in 2D continuus space there is the whole complex theorems space that can happen :)
Great video. Thank you
The part with the slopes reminded me of "a natural construction for the real numbers" by "Norbert A'Campo", where a real number is defined as an equivalence class of objects called slopes, which are "almost linear" functions on the integers.
i kid you not, THE DAY after i watched this i had a math competition, and one of the problems was to find the fraction will the smallest denominator between 2 fraction, i tried trial and error and then remembered this video and immediately got the answer
Very cool video, thank you!
Besides the content of the video, the music of the video is amazing.
It's like a random walk from flower to flower in a garden - then at the end you realise you know the shape of the whole garden.
Amazing video. Came in there without any expectations, and it fulfilled my interests much more than I expected.
1:17 This function has fascinated me for years. To me the practical application is when you divide something up and divvy it evenly amongst multiple people. Take a wandering band of fishermen living around ancient Sumeria for example. Let's say 13 guys catch 6 lb. of fish. They happen across some old allies they still love, and decide to have supper together. The other wandering band is 8 guys who caught 4 lb. of fish. How can they equally allot the fish to each fisherman, in the combined supper that night? 6/13 (+) 4/8 = 10/21 . Each person gets 10/21 lb of fish to eat.
Now let's say you come along, and tell them, you need to reduce the fractions first. So, the equation becomes 6/13 (+) 1/2 = 7/15 lb. See why we need to do away with this rule?
Now i'm much less familiar with vectors, than making sure i eat enough. But from what you're showing around 5:00 in, it looks like my example should work with vectors also. The demand to reduce the fractions isn't a good idea.
Wow I was not expecting Kapustin when clicking on this video, thank you for that
Can we do something with this?! Mediants are how almost every US teacher grades their students. a/b and c/d being grades on b and c "point" test/assignments are merged (a+c)/(b+d). The mediants provide weighted averages of tests/assignments. Mediants are how almost every statistical study is done. You send out dozens of collectors to take small samplings and count all the positive events (sum of numerators) and divide by the total samples (sum of denominators) Two samples of 1 out of 2, sum to one sample of 2 out of 4. But a sample of 8/9 and a sample of 1/1 sum to 9/10.
we have 3blue1brown at home
meanwhile at home:
no im just kidding, great video dude, your editing chops are amazing
Fun exercise: Find the product of 2*sin(πx) where x ranges over all fractions in the Farey sequence of order n, excluding the endpoints 0/1 and 1/1.
Truly delightful
What a beautiful video. I should do more mathematics.
I never thought something arising from this much of abstractness would attract me to this extent
isn't simpson's paradox just…gerrymandering
Zhu Li, you did the thing! (Sorry, couldn't resist that one.)
I stumbled across Hurwitz's theorem a few years ago, but this is the first time I had ever seen a proof of it. I'll have to take some time to digest that to see if I really understood it -- some of those steps really flew by. But it's neat to see that you can do it in such an elegant, geometric way.
Very cool way of visualization
Great video
Great video.
Great video. Ty ty ty
Amazing video. Subscribing.
Is it SoME time already?? Heck yeah!
Overall good concept. Honestly, there's something flawed in the flow of your arguments, as far as presentation is concerned. I kept going blank because I didn't know "what this is leading to", even though every single concept (Farey sequences, Simpson's paradox, mediants) are all familiar to me. Consider mapping out the steps you're leading in advance, because this video's main points are dependent on catching VERBAL content, and not mathematical content.
Hmm it seemed like junior high school math, but that vector approach was simply brilliant
What a nice video, I thought I understood math lol. Such a nice topic.
The title makes it look like it's just vectors, now I am starting to watch whether what I guessed was correct!
4:10 I'm getting Chopin Nocturne vibes from the background music and kind of digging it.
Here because the thumbnail interested (and confused) me.
0:19 The thumbnail actually supports this. It had 1/2+1/2=1 being wrong and 1/2+1/2=2/4 written in as being "right."
0:30 Yes, but the thumbnail had the addition operator, not the mediant operator.
clickbait at its finest right?
Very nice video.
intro is fire
Amazing video, but not for when I'm delaying going to sleep and only half conscious.
Gonna mark the video to watch tomorrow and will give my opinion then, when I can understand anything.
REALLY cool, thanks for sharing!!!
You can think of the mediant as translation of vectors. a/b (+) c/d which should be (a + c)/(b + d). given that the nominator is the x component and the denominator is the y component, you can compare a+c to c+a. ‘a’ vector translating by +c in the x axis, or ‘c’ vector translating by +a in the x axis
I accidentally did something like this, and got the right answer. Much later I needed to take the same code/math and update it to account for multiple fractions being added together, and it all fell apart. Took me a while to realize what the correct answer was, but it was a fun journey. I think it had something to do with accidentally solving for the reciprocal of the fraction, then forgetting that step occurred. Pretty simple with two fractions, much more complex and obvious with three.
The video could be subtitled to include an answer: "You discover the beauty of math!"
Thanks a lot for this video! I've recently been learning about continued fractions and best rational approximations, and this idea of treating fractions as vectors really demistifies a lot of these concepts.
Zhuli:D
I would love to see the skipped proofs as i am not knowledgeable enough to prove them solo.
Wonderful video!
Thanks a tonne🙂
Someone very wise said : '' Math is you, a paintbrush and an empty board with infinite possibilities. ''
This video is literally my mind mid-exam
"So x divided by y = z."
My other part of my consciousness: "hello vesauce here, what if we calculated it differently? What if we change it? And is this question have similarities to questions 5 in page 3?" 5 minutes fly by that moment 😂
I'll make a mental note to rewatch this video. I think it's going to need multiple watches to absorb and understand everything.
Music makes this video perfect
Subscribed
How the fuck do you have 15k subs, this is amazing!!!
> we should learn to embrace this exploration, and let our curiosity take us where we want. if we end up where we expected, great. if we end up somewhere completely different, that's also great.
this is one of the most important parts of math, and missing it might make math seem boring when it's really the opposite (although i wouldn't say that all cases of being bored by math are caused by this). maybe not even math specifically, maybe it's way more general, but i don't know a lot about that.
thank you very much for formulating it, i'm glad i watched this video. the reasons why i love math have been just vague feelings and intuition for a very long time, and it's really nice to understand them and maybe even be able to explain them to others. although to fully comprehend these reasons, i would probably need to make a list of them, and it would be a loooong list :D
Algorithm bump. I don't follow math well. Butt you did an excellent job. And the recap was really valuable. Wow
Deep. Elegant. AweSoME3.
Simpson's paradox, in the example you gave, isn't unintuitive at all. "Paradox" is overkill there for sure.
using the mediant operator would be a fun way to try to calculate digits of pi, though you'd need a precise way of generating circle's diameter and circumference. at that point, you'd already be able to compute pi lol
Great video, found this interesting. Curious about what you use to make the animations?
Manim, a python library by Grant Sanderson of 3Blue1Brown fame.
This video wasn't meant to be a out tf2, but I think I now better know how trimping with demoknight works. Granted it's mostly eyeballing how much you need to turn to gain an adequate amount of speed, but if you know how much is too much then I feel like estimating what the median of that is would help improve your trimping skills a ton!
What is this comment lol
Heho vectors go brrrrrrrrr
Dang, this is so dense with information that i looked away for 2 seconds and suddenly i have no idea whats going on😂
Math class all over again
I have a probabilistic argument that the denominator in Hurwitz's theorem should be q^2, which I find pretty neat. It goes like this: Suppose you have an arbitrary irrational number, x. How good can you expect the "best" rational approximation with denominator < q to be? Well, since fractions with denominator q form a lattice with spacing 1/q, the distance from x to the nearest such fraction, p/q, can't be more than 1/(2q). So it makes sense to take the number h = 2 |qx-p| (which is always between 0 and 1) as a measure of how "good" the rational number p/q is as an approximation of x. If x is "randomly" chosen, we can say that h is uniformly distributed between 0 and 1. If you test all denominators between 1 and q to find the one with minimum h, you essentially have q independent tries. The expected value of the minimum of q independent numbers chosen uniformly at random between 0 and 1 is 1/(q+1), so we should expect the "best" rational approximation to x with denominator less than q to differ from x by about 1/(2q(q+1)), or, asymptotically for large q, something of order 1/q^2, which meshes very nicely with Hurwitz's theorem. From this perspective, it becomes really interesting that there are some simple-ish approximations for π (for example, 355/113) that beat this bound by quite a lot. Most other irrational numbers you might come up with (say, e, or √2), don't have such exceptionally good approximations.
Cool ideas! I haven't looked into this space very deeply or rigorously, but I suspect the reason why you can beat the bound significantly with pi, but not so significantly with some other irrational numbers, as a lot to do with the continued fraction representation.
If I had to conjecture, I think there are some ways to metricize how close these rational approximations can get, and there's probably a metric in which the golden ratio is the furthest away from its rational approximations.
@@zhulimath For sure with the pi thing, you can see it in terms of the continued fraction expansion, which is a really tidy way to get the best rational approximations (that I didn't know about when I was thinking about this the first time). But if you ask me, that just pushes the question back a step. If you start computing the continued fraction expansion of pi, you get 3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, 1, 1, .... That 292 corresponds 355/133 being such a weirdly good approximation, and it's surprising that it shows up so soon. Why does that happen? Unlike for quadratic irrational numbers or for e, for example, there's no clear pattern to the continued fraction expansion for pi. And maybe there's no satisfying answer, but it is interesting.
I'm sure there are good reasons for it, but I'm not too well-versed on this (yet).
@@rossjennings4755 I think the lack of pattern is because pi is transcendental (cannot be formed from a non infinite equation) and if a continued fraction has a repeated pattern then the result can be written as the solution to an finite equation e.g. sqrt(2) has denominators 2,2,2,2,2,2... and so (2+2/x)=x has roots sqrt(x). e should be the same as it is transcendental but I think it just tends to have smaller denominators than pi (I have no idea why).
I think the visualisation of the tree of rationals being those that are 'visible' could be thought of as a slice of the graph of a function on homogeneous coordinates
The Stern-Brocot tree is wonderful. All the enumerations of the rationals are wonderful. It feels like they tie so much together. You don't want to use fractions to represent rationals when you know about the Stern-Brocot tree - fractions are ugly, there are more ways to represent the same number! You can just index into the Stern-Brocot tree instead. It may be slightly harder to calculate with, but ...
Nice vid! Considering this uses vectors and addition, and is between zero and one, could it be used in a GPU algorithm for inverse square roots? Not my area, but fun thought!
Hey, I have an interesting question: could there be an isomorphism to study this median such that the group of simplest form fractions (which is an equivalence class) with the operation median is like the group of integers with the sum (understanding the integers like equivalent classes, e.g. (2,1)=(3,2)=(1,0), like in zermelo Franklin axioms)
I now wonder how to design built-in datatype for rational numbers for n bytes, such that the values cover some level of mediant approximations
you can also use these mediants to enumerate markov numbers :D