Successfully reported this slideshow.
Your SlideShare is downloading. ×

The Universe as Code - Dave Kerr

The Universe as Code - Dave Kerr

Download to read offline

The Universe as Code - What Programming Can Teach us about Maths, Science and Philosophy.

The topic for ‘DevOpsDays’ is ‘Everything as code’. You can’t get more ‘everything’ than the universe! In this presentation I’m going to step away from containers, orchestration and servers to talk about what programming can teach us about maths, science and philosophy. This presentation probably isn’t going to help you build or manage systems, but it should excite and interest those who are curious about the big questions!

The Universe as Code - What Programming Can Teach us about Maths, Science and Philosophy.

The topic for ‘DevOpsDays’ is ‘Everything as code’. You can’t get more ‘everything’ than the universe! In this presentation I’m going to step away from containers, orchestration and servers to talk about what programming can teach us about maths, science and philosophy. This presentation probably isn’t going to help you build or manage systems, but it should excite and interest those who are curious about the big questions!

Advertisement
Advertisement

The Universe as Code - Dave Kerr

  1. 1. The Universe as Code What Programming Can Teach us about Maths, Science and Philosophy @dwmkerr Dave Kerr Senior Expert, McKinsey & Company
  2. 2. Who am I? @dwmkerr
  3. 3. I am a technology consultant. @dwmkerr
  4. 4. Which is closer to this… @dwmkerr
  5. 5. I’m not going to talk about devops… @dwmkerr …sorry!
  6. 6. “Everything as code” @dwmkerr The CFP for devops days is:
  7. 7. The Universe as Code @dwmkerr …and the theory of everything
  8. 8. The Theory of Everything? @dwmkerr Just what is
  9. 9. General Relativity Quantum Field Theory
  10. 10. General Relativity Quantum Field Theory Gravity The very large and very heavy Electromagnetism Strong Nuclear Force Weak Nuclear Force The very small and very light Theory of Everything? String Theory? M-Theory? ?
  11. 11. The Theory of Everything? What if we had
  12. 12. Langton’s Ant @dwmkerr
  13. 13. @dwmkerr Christopher Langton Academic involved in ‘cellular automata’. Coined the term ‘artificial life’ in the late 80s. Created ‘Langton’s Ant’ in 1986. Comes with a Theory of Everything! By Cary Herz - Santa Fe Institute, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=16781577
  14. 14. @dwmkerr The Theory of Everything 1. The universe is an infinite plain of white tiles 2. An ant sits on a tile in the center of the universe 3. If the tile is white, the ant flips it to black, turns 90° right and moves forwards 4. If the tile is black, the ant flips it to white, turns 90° left and moves forwards
  15. 15. @dwmkerr https://rosettacode.org/wiki/Langton%27s_ant
  16. 16. @dwmkerr github.com/langtonsant
  17. 17. Demo 1 @dwmkerr
  18. 18. Symmetry – simple right? @dwmkerr Demo 1
  19. 19. Demo 2 @dwmkerr
  20. 20. Symmetry, chaos, order @dwmkerr Demo 2
  21. 21. Where was this in our theory?
  22. 22. Chaos Theory @dwmkerr The Universe as Code
  23. 23. Chaos Theory Chaotic systems are systems which are very sensitive to their initial configuration. Even though they are deterministic, their behaviour is incredibly hard to predict. A famous example is ‘The Butterfly Effect’.
  24. 24. Is our universe chaotic?
  25. 25. Very Much So Weather Systems Social Networks Fluids, The Internet, Traffic…
  26. 26. Is Langton’s Ant chaotic?
  27. 27. Demo 3 @dwmkerr
  28. 28. Langton’s Ant is Chaotic @dwmkerr Demo 3
  29. 29. Even seemingly very simple systems can be very chaotic @dwmkerr
  30. 30. Determinism @dwmkerr The Universe as Code
  31. 31. A deterministic system always behaves in the same way. @dwmkerr
  32. 32. Demo 4 @dwmkerr
  33. 33. Langton’s Ant is Deterministic @dwmkerr Demo 4
  34. 34. @dwmkerr A non-deterministic system has randomness – we cannot predict how it will behave.
  35. 35. Demo 5 @dwmkerr
  36. 36. Rangton’s Ant is Non-Deterministic @dwmkerr Demo 5
  37. 37. Is our universe deterministic?
  38. 38. @dwmkerr We don’t know. And it might be impossible to know.
  39. 39. @dwmkerr Classical Physics is Deterministic
  40. 40. @dwmkerr Quantum Mechanics is Non-Deterministic By Felix Kling - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=11921166
  41. 41. Quantum mechanics has randomness built in.
  42. 42. @dwmkerr “As I have said so many times, God doesn't play dice with the world.”
  43. 43. By Retro-Computing Society of Rhode Island - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=7372673 Can you write a function to produce a random number?
  44. 44. The Universe as Code @dwmkerr …and the theory of everything
  45. 45. What can the universe as code teach us? @dwmkerr Chaos Theory • Our Universe is a chaotic system • Very simple systems can have behaviour which is extraordinarily complicated to predict Determinism & Non-Determinism • Non-deterministic systems are inherently unpredictable • It is entirely possible that our universe is non-deterministic The Theory of Everything • The holy grail of physics, a ‘Grand Unified Theory’ • Might not tell us as much as we hope!
  46. 46. Thanks! A lot of this stuff is on my blog and GitHub. @dwmkerr dwmkerr.com github.com/dwmkerr linkedin.com/in/dwmkerr Interested in the topics? Try any of the above! https://github.com/dwmkerr/langtonsant
  47. 47. Appendix @dwmkerr
  48. 48. Images - Stellar Nursery in the Eagle Nebula, https://commons.wikimedia.org/wiki/File:Eagle_nebula_pillars.jpg - The formation of a Higgs Boson at the LHC, https://commons.wikimedia.org/wiki/File:CMS_Higgs-event.jpg - Christopher Langton, By Cary Herz - Santa Fe Institute, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=16781577

Editor's Notes

  • I do three things:
    Advise on strategy, typical McKinsey stuff
    Lead our engineering practice
    A lot of coding
  • Lessons Learned: 2 mins
    23/25 mins

    You cannot simply transplant existing projects onto a platform like kubernetes and expect it to scale.

    Anecdote: a week of time lost while the team try and get a complex multi-database solution working on Kubernetes, a day to run it on VMs.

    Lesson: Know what works. Stateless, or self organising homogenous nodes
  • 5m mark:
    Serving clients across the world, deploying in airports, writing code.
  • Have to come clean on this one.
    Did submit a paper on getting started with Docker.
  • The CFP for devops days is everything as code. So I’ve taken it literally.
  • The CFP for devops days is everything as code. So I’ve taken it literally.
  • There are four fundamental forces in the universe, that we know about. They are completely covered by two hugely successful theories. They are:

    Einstein’s General Theory of Relativity. This covers gravity; and we use it to predict and understand what happens with very large things. The picture on the left is a stellar nursery in the Eagle Nebula.
    Quantum Field Theory. This covers the non-gravitational forces; and we use to the predict and understand what happens with very small things. The picture on the right is from the LHC, and shows the formation of a boson.

    These theories are incredibly accurate, in that the can predict physical phenonena with a high degree of accuracy.
  • Relativity handles the large and heavy and takes no account of electrical interactions. It deals with planets, stars, galaxies and so on.
    QFT handles the very small. It does not take into account gravity. It deals with atoms, electrons, quarks and so on.
    These theories are incompatible.
    Many problems cannot be dealt with if they are not all taken into account, such as the early universe (very small and very heavy).
  • This is what we are going to look into now.
  • Show the code, run it in a browser.
    Show the hosted version.
  • In this demo ‘tick’ the universe a few cycles. Show the ant making nice, symmetric patterns.

    Show the controls.
  • The CFP for devops days is everything as code. So I’ve taken it literally.
  • In this demo, run for a few hundred moves, show a more chaotic, random pattern.
    Finally, show the evolution of the highway.
  • We have exhibited quite complex behavior.
  • This is strange, we built nothing in to handle highways, does this always happen?
  • In this demo, run the ant with different configurations, showing just how different the universe appears.

    LR: forms a highway
    RLR: seemingly chaotic, unknown whether a highway is formed
    LLRR: forms a cardiod, growing symmetrically
    RRLLLRLLLRRR: Forms an ever growing triangle
  • The CFP for devops days is everything as code. So I’ve taken it literally.
  • Let’s look at the pendulum:

    1. Show the simple pendulum (Galileo Galilei (1564–1642))
    2. Show the double pendulum

  • We had mentioned determinism in chaos theory- talking about how deterministic systems can be chaotic. What does that mean?
  • In this demo, run the ant, restart the ant, run the ant, restart the ant.

    RRLL
  • In this demo, run the Rangton’s Ant, open a new tab, start a new ant, open a new tab, restart a new ant.
  • Relativity handles the large and heavy and takes no account of electrical interactions. It deals with planets, stars, galaxies and so on.
    QFT handles the very small. It does not take into account gravity. It deals with atoms, electrons, quarks and so on.
    These theories are incompatible.
    Many problems cannot be dealt with if they are not all taken into account, such as the early universe (very small and very heavy).
  • In this demo, run the ant with different configurations, showing just how different the universe appears.
    – Configuration 1
    Configuration 2
    Configuration 3
  • Projectiles, Gravity, Pendulums, Thermodynamics, Prisms and light, magnetism, pulleys.

    All of these theories are practical theories, they deal with physical phenomena.
  • Einstein discovered the photoelectric electric effect, showing some weird things.
  • Radioative decay
    Two slits experiment
    Quantum tunneling
  • QED is just a theory, it doesn’t mean that this is genuinely how the universe works. But it does mean it is possible that there is randomness in the nature of the universe.
  • Non-determinism is surprisingly hard to deal with!
  • The CFP for devops days is everything as code. So I’ve taken it literally.
  • Don’t forget, I’m writing a book!

×