• lauha@lemmy.world
    link
    fedilink
    English
    arrow-up
    165
    ·
    5 months ago

    This is because fibonacci numbers approach golden ratio which is approximately 1,618033… and one mile is 1,609344 kilometres exactly.

      • gwl [he/him]
        link
        fedilink
        English
        arrow-up
        5
        ·
        5 months ago

        Fun fact: there’s quite a lot of countries that use “mixed metrics”, with no real rhyme or reason for what uses old ancient imperial and what uses new shiny metric

        UK - Miles for long distances, switch to meters for distances less than a mile, always use km in air and sea. Milk in pints, petrol in liters, water in ml, beer in pints. Human heights in Feet Inches, building heights in Meters. Human weights in a unit even Americans don’t use anymore (Stone), animal weights in kg/g.

  • ExperimentalGuy@programming.dev
    link
    fedilink
    English
    arrow-up
    20
    ·
    5 months ago

    This is such a cool example of how some recursive algorithms have a closed form. We all know that there’s a simple equation to plug miles into to get kilometers, but we don’t talk about how the Fibonacci sequence has a closed form. This is so cool.

      • WolfLink@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        5
        ·
        5 months ago

        Closed form means it can be written out as a specific, finite set of instructions that work the same regardless of what the input to your function is.

        For Fibonacci, it is most commonly defined in its recursive form:

        f(0) = 0
        f(1) = 1
        f(x) = f(x-1) + f(x-2) for integer x > 1
        

        But using this form, computing a very large Fibonacci number requires computing all the numbers before it, so it’s not the same finite set of instructions for every number, it takes more computation to generate larger numbers.

        However, there is a closed form formula for generating Fibonacci numbers. Using this formula, you can directly compute any large Fibonacci number without having to compute all those intermediate steps. It takes the same amount of work to compute any Fibonacci number.

        f(x) = (a^x - b^x)/√5
        a = (1+√5)/2
        b = (1-√5)/2
        

        (Note that a and b here are constants; I only wrote them separately to avoid a mess of nested parenthesis)

        For an example of something that doesn’t have a closed form, we do not know of a closed form for generating prime numbers. There are several known algorithms for generating the nth prime number, but they all depend on computing all the previous prime numbers, making it very difficult to compute very large prime numbers (in fact, how generating large primes is actually done is by making an educated guess and then checking that it’s actually prime). Discovering a closed form formula for prime numbers would have a huge impact on mathematics and cryptography.

        • angrystego@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          5 months ago

          Thank you. So does that mean that the Fibonacci can help us because just like the miles-km algorithm it is closed form, so we can use it to compute a single number, and at the same time it gives us similarish results because of coincidence?

  • ramble81@lemmy.zip
    link
    fedilink
    English
    arrow-up
    12
    ·
    5 months ago

    To go from km to mi I always leaned “multiply by 6 and move the decimal one to the left”. So 6km is ~3.6mi. Or 10km is just about 6mi.

    • Pup Biru@aussie.zone
      link
      fedilink
      English
      arrow-up
      2
      ·
      5 months ago

      or add half and then 10% (because it’s 1.6km to the mile): easier than multiplying decimals or large numbers by 6, and the inverse is 0.6mi=1km so easy to remember both ways (same thing but don’t “add” just start from 0)

    • untorquer@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 months ago

      I used to remember because space (Karman line) is 100km or 62mi up. I guess it helps to be a space nerd for that one. Kind of just figure 1.6 going the other way.

    • BeardedGingerWonder@feddit.uk
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 months ago

      Honestly divide by 5 and multiply by 8 usually isn’t too difficult and just gives you the right answer.

      I remember it by 200mph is 320kph.

  • gwl [he/him]
    link
    fedilink
    English
    arrow-up
    8
    ·
    edit-2
    5 months ago

    Ah yes, I always remember the Fibonacci sequence and totally wouldn’t find it harder to calculate than just doing the conversion the regular way

    /sarcasm

    • Dumhuvud@programming.dev
      link
      fedilink
      English
      arrow-up
      5
      ·
      5 months ago

      “Remember”? Do you also remember all the digits of π?

      It’s defined as F(0) = 0, F(1) = 1 and F(n) = F(n - 1) + F(n - 2). Which makes more sense than imperial units.

      • gwl [he/him]
        link
        fedilink
        English
        arrow-up
        5
        ·
        edit-2
        5 months ago

        Or I could just do 1.6 km ≈ 1 mile whenever I need to convert from the standard that I use, Metric, to Imperial

        Far far far simpler

        Edit: I’m not American, I use sensible units, SI Metric

        Edit edit: I do fully have dyscalcus, mostly only effects “scary” looking maths, so no, your suggestion doesn’t help

        • Dumhuvud@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          ·
          5 months ago

          Tbh, the last sentence was just a silly jab at the imperial units.

          I was mostly just making fun of the fact that you implied the Fibonacci sequence can be memorized, when it is infinite. I’m not saying that referring to it is simpler than dividing/multiplying by a constant, no.

      • UnderpantsWeevil@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        5 months ago

        Which makes more sense than imperial units.

        But you’d only need to do the conversion if you started with imperial units.

      • gwl [he/him]
        link
        fedilink
        English
        arrow-up
        3
        ·
        edit-2
        5 months ago

        It’s rough estimation, a deviation of anything less than 50% is accurate enough for that

        Edit: Ooh I thought you were trying to “um actually, it’s 1.66”, but I just realised they put 0.6 instead of 1.6

    • Routhinator@startrek.website
      link
      fedilink
      English
      arrow-up
      2
      ·
      5 months ago

      US and Israel are the only places that still use Imperial. While older generations in Canada and UK will speak about weight in Imperial, the official unit system is Metric.

      • UnderpantsWeevil@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        5 months ago

        US and Israel are the only places that still use Imperial.

        But the US has a global business empire. So you’ll see the Imperial/Metric conversions all over the planet.

  • melsaskca@lemmy.ca
    link
    fedilink
    English
    arrow-up
    3
    ·
    5 months ago

    Cool! I wish I would have known this in the 70’s when Canada changed over from British Imperial units to the Metric system. Maybe this is the incentive needed to push the usa into the rest of the metric system world!

    • Mycatiskai@lemmy.ca
      link
      fedilink
      English
      arrow-up
      9
      ·
      5 months ago

      If every measurement being a factor of ten of a smaller or bigger unit isn’t going to convince Americans of the ease of metric then the Fibonacci sequence isn’t going to convince them.