8 ms·
Using Fibonacci numbers to convert from miles to kilometers and vice versa
- cben 2y agoI learnt this from Concrete Mathematics (Graham, Knuth, Patashnik). Don't remember if main text or the side notes of accumulated student wisdom... (I dont mean on my copy, this textbook is _printed_ with tons of amusing/insightful side notes) They also mention _approximate_ cm/inch conversion is doable by double shift on the Fibonacci scale - if golden ratio was exactly 1.6, its square would be 2.56, but actual phi² = 2.618 which is quite bad approximation for 2.54...
- noman-land 2y agoThis is amazing.
- deleted 2y ago[deleted]
- drivingmenuts 2y agoWell, there’s my new bar trick.
- deleted 2y ago[deleted]
- _hao 2y agoPretty neat!
- seanhunter 2y agoFun Fibonacci facts: - the first published use of the term “golden section” (which later became more commonly known as the “golden ratio”) to describe the number phi[1] was by Martin Ohm, the brother of Georg Ohm who the unit is named after. - Binet’s closed form series solution for the Fibonacci numbers[2] is really cool because it involves three irrational numbers yet every term of the resulting series is of course an integer. [1] (1+sqrt(5))/2 [2] F(n)=(phi^n - psi^n)/ sqrt(5) (n=0,1,2,…) where phi=(1+sqrt(5))/2 and psi=(1-sqrt(5))/2
- OutOfHere 2y agoThe article shows: fn(n miles to km) ≅ next_fib(n) fn(n km to miles) ≅ prev_fib(n) --- Similarly, fn(n kg to lbs) ≅ prev_fib(n) + next_fib(n) fn(n lbs to kg) ≅ (prev_fib(n) - prev_fib(prev_fib(n))) * 2 fn(fib(i) lbs to kg) ≅ fib(i-1) - fib(i-4) # Alternate formula
- madcaptenor 2y agoThis is basically multiplying by sqrt(5) ~ 2.236, and 1 kg = 2.204 lb. Not bad!
- LegionMammal978 2y agoThose are some amazingly spammy "Top Posts" at the bottom of the page. From the same blog, I thought at first that the "left-pad as a service" [0] was a parody, but the whole collection of Online Tools websites is so elaborate that it might truly be in earnest. Also, this should be (2010). The "last updated 3 weeks ago" is likely not real at all, every page on this blog was allegedly updated in a similar timeframe. (Maybe it counts every change to the list of links? Or maybe it's just bogus SEO nonsense.) [0] https://catonmat.net/1000-paying-left-pad-users https://catonmat.net/1000-paying-left-pad-users
- hluska 2y agoWhy be a hater? It doesn’t make you look smart. It just bores the rest of us.
- LegionMammal978 2y agoBecause they've allegedly gotten hundreds to thousands of people to pay up to $9 per month for basic string utilities as a subscription service, just about all of which are offered for free by a dozen other websites. Either they're padding out their subscriber count by a lot, they have some impressive functionality they aren't advertising, or these subscribers are getting ripped off. Also, comparing to archived versions of the pricing page, they've been ratcheting up the price over time. Meanwhile, they're making some dubious claims about the security and privacy of their cloud browser service. Sure, your ISP might not see which websites you're visiting on it, but now they can go snoop on your browsing however they'd like, and read off all your passwords and whatnot.
- deleted 2y ago[deleted]
- gjm11 2y agoI don't see any hate. I do see useful information. Looking at the linked page for myself, and seeing a list of "Top posts" all of which are obviously ad-infested SEO gunge, I immediately learn that I cannot trust whoever made the page, because getting eyeballs onto their advertisements is more important to them than truth. This doesn't have any particular implications for this particular page, and the "lucky 10,000" who had never before encountered the idea of converting between miles and kilometres using Fibonacci numbers will have learned something fun, which is great. But seeing the SEO bullshit tells me immediately that I am not going to want to (e.g.) add this blog to my feed aggregator[1]. [1] Does anyone else actually use these any more? I feel a bit of a dinosaur. The grandparent of this comment was useful to me. Your "why be a hater?" was not.
- bena 2y agoThere's a slightly quicker way that they kind of stumble upon, but never outright say. miles * 8/5 = km and km * 5/8 = miles. How many km in 100 miles? 100/5 = 20, 20 * 8 = 160. How many miles in 400km? 400/8 = 50, 50 * 5 = 250. And 8/5 is 1.6 exactly, which is close to the "golden ratio".
- j0057 2y agoWhen driving in the UK, I found myself practicing my 16-table a lot: when seeing a 50 mph max speed sign, I'd multiply 5 by 16 to get 80 km/h.
- robertlagrant 2y agoHah I've just been driving in France and kept multiplying by 0.6. Much simpler than 16!
- NikkiA 2y agoGiven (official*) UK speed limits are always in multiples of 5, using the 8/5 rule would be quicker and work just as well. * There are occasional places where private property has speed limits with weird factors, but they're so rare as not to worry about. (the one example I remember is when I used to cycle to work and took shortcuts through a sewage plant that had an '11 mph' speed limit, why? who knows.
- gjm11 2y agoIf you want real accuracy, note that the actual mile/km ratio is almost exactly half way between 1.6 and (1+sqrt(5))/2. So do both conversions and take the average. (You won't get results as accurate as that suggests, of course, because doing the Zeckendorff + Fibonacci-shift thing only gives you an approximation to multiplying by (1+sqrt(5))/2.)
- tcdent 2y ago> A pure coincidence that the Golden ratio is almost the same as kilometers in a mile. Is it really just a coincidence? Genuinely curious.
- plorkyeran 2y agoYes, of course.
- delecti 2y agoConsidering pre-metric France didn't use the mile, and the meter was originally meant to be 1/10,000,000 of the distance from the north pole to the equator, it seems almost impossible that it's intentional.
- ikawe 2y agoThe current "mile", the "International Mile", is very close to the 1593 "statute mile", going through a lot of history, but ultimately coming from 1,000 (a "mil") paces. The kilometer: As part of the widespread rationalization that occurred during the French revolution, the meter was defined in 1791 as 1 ten millionth the distance of a line drawn from the equator to the north pole, through Paris. Golden ratio: 1.618... km / mile ratio: 1.609... So, seems like just a coincidence. But these are fun: https://en.wikipedia.org/wiki/Mile https://en.wikipedia.org/wiki/Mile https://en.wikipedia.org/wiki/Kilometre https://en.wikipedia.org/wiki/Kilometre
- akira2501 2y ago> as 1 ten millionth the distance of a line drawn from the equator to the north pole, through Paris. Rationalized but nearly unrealizable.
- ahazred8ta 2y agoThe distance from pole to equator is 90*60 = 5400 nautical miles, and the same distance is 10,000 km. So for a long time the km was exactly 0.54 nautical miles.
- renewiltord 2y ago
- bloopernova 2y agoIf you find this neat, look into all the different calculations you can do on a Slide Rule: PDF link: https://www.sliderulemuseum.com/SR_Class/OS-ISRM_SlideRuleSeminar.pdf https://www.sliderulemuseum.com/SR_Class/OS-ISRM_SlideRuleSe...
- litoE 2y agoMy Breitling watch has a built-in circular slide rule. When in a foreign country, I set it (once) to the local currency exchange rate, and can quickly convert how much anything costs into dollars. I could do the same with the calculator on my phone, but I would have to key in the exchange rate every time - if I can even remember what it is.
- tgv 2y agoI've got a circular slide rule (not really a rule, is it?) with square and cube values, so you can convert surface and volume. Conversion numbers are printed on the back. It seems to have been made as a cheap handout. Not that I ever use it, but it's a cool idea.
- sorokod 2y ago"just express the original number as a sum of Fibonacci numbers" This is aways possible, see Zeckendorf's theorem. https://en.m.wikipedia.org/wiki/Zeckendorf%27s_theorem https://en.m.wikipedia.org/wiki/Zeckendorf%27s_theorem
- actinium226 2y agoAs amusing as this is, I could not tell you offhand how to express 121 as a sum of fibonacci numbers. I mean I could figure it out, but I could also either multiply by 1.5 (121mi ~180km) or by 2/3 (121km ~80mi) and it would probably be a little bit faster than the fibonacci way.
- sorokod 2y agoAs suggested elsewhere, this is more of a party trick then a practical approach to convert between km and miles. The Wikipedia entry does suggest a greedy algorithm (at each step choosing the largest fib number that fits) though, using that we have 121 = 89 + 21 + 8 + 3
- pavon 2y agoI do think that it has practical applications for the smaller ratios that are easy to remember and/or derive. For example 5:8 is a both a closer approximation than 3:5 that most people use, and is more convenient when miles are a multiple of 5.
- outop 2y agoOne problem with this is that it decomposes 2 * 55 to 89 + 21, etc which makes the conversion slightly harder than just converting 55 and doubling.
- outop 2y agoAlso the decomposition of 88 is 55 + 21 + 8 + 3 + 1. A lot of terms just to find that phi * (Fn - 1) is (F{n+1} - 1) which isn't even very accurate.
- yegle 2y agoCall me snarky but instead of just multiply/devide by 1.6, you rather prefer remembering the Fibonacci numbers up to, I don't know, 200 to be useful?
- nrr 2y agoIn practice, at least in my experience, only up to 13. (Though, I have the sequence memorized up to 21 because of a sign outside Chattanooga[0], which is what gave me my "hey, wait" moment about this.) A combination of both the fundamental theorem of algebra and Zeckendorf's theorem has allowed me to fill in the rest so far. For example, 25 mi = 5 * 5 mi, which yields 5 * 8 km = 40 km. As it turns out, that is how far Cleveland, TN, lies from Chattanooga. 0: https://usma.org/metric-signs/tennessee https://usma.org/metric-signs/tennessee
- sigmoid10 2y ago>A combination of both the fundamental theorem of algebra and Zeckendorf's theorem How do you apply the fundamental theorem of algebra here?
- bobbylarrybobby 2y agoI will go out on a limb and assume they meant the fundamental theorem of arithmetic, that all numbers can be (uniquely) factored into primes.
- battles 2y agoThat's what I was thinking. I good example of over-engineering though.
- dylan604 2y agoSome people think differently. Some methods click with some people, while making others think it's making it overly complicated. The new math drove people crazy. The concept of doing extra math by rounding a number up to a whole number, and then subtracting the diff seems like a lot of work, but is amazing when used frequently to do "in your head" type of work. That extra match can lead to an answer faster than traditional math
- starktyping 2y agothis has Rube Goldberg energy if you have seen the Golden Ratio connection or derived Binet's formula before - my first thought was "yeah because the conversion and the golden ratio are both 1.6ish"
- pg_bot 2y agoA mile is 5,280 feet and a kilometer is approximately 3,280 feet. If you need to do rough conversions just think of a kilometer as slightly more than 3/5ths of a mile.
- theendisney 2y agoYou are doing it wrong. A kilo meter is 1000 meter like a kilo gram is 1000 gram. A land mile is 1609.344 meter. 16 is easy to remember as a symbol of immaturity but you do get to drive in the us. Not in the eu nein
- namrog84 2y agoIf remembering a fraction or number. I always felt like it was easier to remember 100kph is 62mph or basically close to a mile a minute.
- riccardomc 2y ago> just think of a kilometer as slightly more than 3/5ths of a mile. I can confidently assure you that right about now there are a bunch of Europeans reading your message multiple times, trying to figure out what 3/5ths of a mile even means, asking themselves if this is satire.
- jameshart 2y agoSure you can use 3/5 - an easy Fibonacci fraction. Or about 5/8. Or 8/13. These fractions have the advantage of being easy to produce and having different prime factors that cancel more easily with some numbers.
- ordu 2y ago
- dwe3k 2y agoI find it interesting, but I question how practical it is for regular use. On a recent trip, I was driving in Canada in a car bought in the United States that did not have the metric values on the speedometer. But all of the posted speed limits were in values of 5 kph. Once you get that (roughly) 100 kph = 62 mph and 10 kph = 6 mph, there are some simple quick divisions or subtractions to convert the speed limit to close enough. - 50 kph = (100 kph) / 2 = 62 mph / 2 = 31 mph - 80 kph = 100 kph - 2 * 10 kph = 62 mph - 2 * 6 mph = 50 mph
- Taek 2y agoI use the fib conversions quite regularly. Both of your examples are actually easy Fibonacci numbers. 50kph - 5 is a fib number, and the previous number is 3. I can go 50->30 without any math at all. And 80kph, well 8 is also a fib number. And the previous is 5. I can go 80->50 without any math at all. 120kph is close to 13, so I know 120kph is somewhere below 80mph. I always divide any remainder by 2, so I would quick math my way to 120->75. That's accepatably close to the real answer of 74.4 Same thing with 110kph. That's close to 13, so I'd quick math to 70 mph (130->80, remainder is 20, subtract half the remainder). That's acceptably close to the real answer of 68.2
- jameshart 2y agoInstead of halving the remainder, you can do 3/5 - since it’s always going to be a multiple of five - so 120kph is going to be more like 74mph because it’s 10kph less than 130, and 10kph=25kph≈23mph=6mph Also, this doesn’t only work with Fibonacci numbers, it works with any Lucas sequence, since they all tend to phi, so as well as 2-3-5-8-13 you can also use the higher numbers from 1-3-4-7-11 to fill in some gaps and help estimate. And as a bonus, it means if you know A kph is equal to B mph, you also know that A mph is ~equal to A+B kph. So given your result above of 120kph=74.4mph, I would estimate 120mph≈194kph. And it turns out it’s actually 193.1koh, so… not far off.
- chillingeffect 2y agoTo mult by 1.6: double it four times then divide by 10. Eg. 55mph = 110, 220, 440, 880, 88.0 kph To divde by 1.6, multiply by 10, then divide by 2 4x. Eg : 200 kph, 2000, 1000, 500, 250, 125 mph
- mikewarot 2y agoTangentially - If it weren't for the arbitrary decision of Carl Johansson, converting lathes from metric to imperial units wouldn't be exact. Thanks to him, an inch == 2.54 cm exactly.[1] This means you can use a 50 and 127 tooth gear pair to do conversions and make metric threads accurately on an imperial lathe, and vice versa. [1] https://en.wikipedia.org/wiki/Carl_Edvard_Johansson#Johansson_and_the_inch https://en.wikipedia.org/wiki/Carl_Edvard_Johansson#Johansso...
- deleted 2y ago[deleted]
- samatman 2y agoEvery time this is mentioned I feel a wild flash of anger that he didn't set it to 2.56cm. That would make the inch precisely (1/10 000)^8 meters. Instead, we're stuck with almost that. Forever.
- cryptonector 2y agoI do this all the time.
- deleted 2y ago[deleted]
- kylehotchkiss 2y agoKM to MI shortcut: divide by 2 and add 7. Not super accurate but makes driving through Canada a little easier.
- dktalks 2y agoThis is a good theory but the basic maths is that 1 mile = 1 km * 1.6 or vice versa. This is the basic thing you need to do. However, this can get confusing it it get's to odd numbers etc, so what you can do is, simple leave it as miles because if you are in a miles country no one is converting it to km or vice versa. Same with C and F in temperatures, there are basic maths systems that can do this in constant time, so there is no real reason to complicate it unless you want to do it in your head and then there is the basic maths to do it, if you can't just use a calculator.
- orourkek 2y ago> if you are in a miles country no one is converting it to km or vice versa My relatives & friends visiting from Europe often appreciate knowing such values in km/C. There are various other reasons to want to do the conversions too, and sometimes speed > accuracy. It's a bit ridiculous to think that _no one_ is doing these conversions and that shortcuts/approximations like this are not useful.
- ziddoap 2y ago>simple leave it as miles because if you are in a miles country no one is converting it to km or vice versa. Maybe true in a miles country, I'm not sure. However, so much stuff posted on the internet just assumes you are from the states, so they use imperial measurements only, and most of the rest of the world does need to do these conversions. I'm converting on an almost daily basis.
- Symbiote 2y agoIt's a minor peeve of mine that many people assume English means miles and pounds, when there are millions of tourists etc reading the English signs who want the original, metric measurements.
- dhosek 2y agoIs this really easier for people than simply multiplying by ⅝ or ⁸⁄₅ as appropriate? And how often does one need to do this conversion anyway? I definitely don’t have any fibonacci numbers above 13 memorized.
- ordu 2y ago> Is this really easier for people than simply multiplying by ⅝ or ⁸⁄₅ as appropriate? I usually just treat miles as kilometers. When I need more precision I multiply miles by 1.5. All these 8/5 just don't stick in my mind, and 1.6 is not much better then 1.6, but it is much easier to multiply by 1.5. > And how often does one need to do this conversion anyway? Every time I see distance measured in miles. It may be 1 time per week, or multiple times per day.
- jojobas 2y ago>I usually just treat miles as kilometers. I'll take "things not to say to a cop" for 300 Alex.
- madcaptenor 2y agoAlex isn’t the host any more and there hasn’t been a 300 in a very long time.
- habibur 2y ago"how many kilometers are there in 100 miles?" Increase by 60%. That's how I do it.
- IAmGraydon 2y agoOr you could...you know...multiply the number of miles by 1.609 or divide the number of kilometers by the same to get the actual correct answer. The fact that miles/km is close to the golden ratio is what we call a coincidence, and I'm really unsure why anyone finds this to be interesting.
- RomanPushkin 2y ago[dead]
- luxuryballs 2y agoHow does he know it’s a coincidence?
- henearkr 2y agoNice! The wow effect was enough to imprint it into my mind. Now I'm waiting for something that cool for Celsius and Fahrenheit...
- igornadj 2y agoI use Everything Metric (https://chromewebstore.google.com/detail/everything-metric-auto-un/hknjpaididhfgeocegbacehlnkofjoni https://chromewebstore.google.com/detail/everything-metric-a...)
- tzs 2y agoOne nice thing about mi/km conversions (and ℉/℃ conversions which have been mentioned in the comments) is that once you have a way to do them mentally that works well for you, you are done. I once worked out a way to quickly figure sales tax for my area using just a small number of operations that are easy to do in my head. "Easy" means that it just involved things like taking 10%, or multiplying or dividing by 2, or adding or subtracting, or rounding to a given precision, and that it did not require keeping too many intermediate results in memory. It worked great. And then the sales tax rate changed. I have a vague recollection of then writing a program that would brute force check all short combinations of my "easy" operations to find ones that worked for a given tax rate. But I can't find that program now, and may have only thought about writing it.
- maxerickson 2y agoIf you just need the rough estimate, round up and multiply is pretty universal. Doesn't work if you are trying to decide if you have enough change to buy something of course.
- mauvehaus 2y agoFor practical applications, multiplying by 16/10 or 10/16 is pretty easy and doesn't require memorizing or calculating Fibonacci numbers. In your head you can multiply or divide by two four times and move the decimal point once when it's most convenient or best facilitates further multiplication or division.
- scarmig 2y agoChallenge: find other sequences that you can use to convert, using integer coefficients in the recurrence. For miles to kilometers, you have to get a better approximation than phi. I wasn't able to for miles to kilometers, but for pounds to kilograms I got: a_n = a_{n-1} + 4*a_{n-2} - 3*a_{n-3} Converges (slowly!) to a ratio of 2.199, so you can then take the previous term of the sequence to convert from pounds to kilograms.
- dirtdobber 2y agoInterviewer: "Write a Θ(log(n)) approximation algorithm for converting n miles to kilometers that's accurate within plus or minus .01*n kilometers."
- garrettgarcia 2y agodef m2k(n): return n*1.609344 There, did it in O(1)
- dirtdobber 2y agoI said θ ;) In other words, your algorithm is asymptotically too fast and you failed the interview! :D
- cben 2y agoYou could add "without using multiplication or division" as a less arbitrary constraint. Early microprocessors (and some really cheap microcontrollers still) didn't have the circuitry. That said a fixed-factor mutiplication can probably be done faster AND [more] precisely as a sum of some shifts. Or many other ways with a lookup table.
- aaron695 2y ago[dead]