François-René Rideau (fare) wrote,
François-René Rideau

  • Music:

Fun with Fibonacci

Everyone having studied science has met Fibonacci numbers somewhere or another in his curriculum. And everyone having studied recursion in programming languages has at one moment or another been taught how to "optimize" an exponentially slow recursive implementation of the Fibonacci function into a linearly slow iterative loop. Except they were lied to. For that loop they learnt as a model to emulate is far from "optimal". There exists an algorithm that is (asymptotically) infinitely faster. And to understand how this algorithm may be devised allows us to explore a few ways that expressive languages like Lisp can open your mind to horizons unconceivable using such inexpressive and awkward languages as are mainstream in the industry. Have a look at fibonacci.lisp

Tags: code, en, lisp, mathematics

  • Ultimate Game Manual

    In my morning dream, I was inside a computer role-playing / adventure game, but following the instructions in the manual didn't have the expected…

  • Comparative lessons of French vs US voting processes

    In France, there are always enough polling stations. Schools and town halls are polling stations. More people whose ballots to count? That's…

  • Slave Reparation Racism

    Regarding Slave reparations: About everyone in Europe was a slave (in Latin, "servus" — serf) since Diocletian's socialist "reforms". Emancipation…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded