Coding, Computer Science, Good Reads, JavaScript, Milestones, Murderous Maths, Notes on everyday life, Set the beautiful mind free, Simon's Own Code, Simon's sketch book

Simon’s first steps in Stephen Wolfram’s Computational Universe

Simon has been enjoying Stephen Wolfram’s huge volume called A New Kind of Science and is generally growingly fascinated with Wolfram’s visionary ideas about the computational universe. We have been reading the 1500-page A New Kind of Science every night for several weeks now, Simon voraciously soaking up the behaviour of hundreds of simple programs like cellular automata.

Wolfram’s main message is that, contrary to our intuition, simple rules can result in complex and often seemingly random behaviour and since humanity now has the computer as a tool to study and simulate that behaviour, it could open a beautiful new alternative to the existing models used in science. According to Wolfram, we may soon realise that the mathematical models we are currently using, based on equations and constraints instead of simple rules, are merely a historical artefact. I’m amazed at how much this is in line with Simon’s own tentative thoughts he was sharing with me earlier this year, about how maths will be taken over by computer science and how algorithms are a more powerful tool than equations. When he came up with those ideas he hadn’t discovered Wolfram’s research and philosophy yet, he used to only know Wolfram as the creator of Wolfram Mathematica and the Wolfram language, both of which Simon greatly admires for being so advanced.

Last night, Simon was watching a TED talk Stephen Wolfram gave in 2010 about the possibilities of computing the much aspired theory of everything, but not in the traditional mathematical way. “It’s about the universe!” Simon whispered to me wide-eyed, when I came to the living room to fetch him. “Mom, and you know who was in the audience there? Benoit Mandelbrot!” (Simon knows Mandelbrot died the same year, he is intrigued by the fact that his and Mandelbrot’s lifetimes have actually overlapped by one year).

We have been informed by the World Science Scholars program that Stephen Wolfram will be one of the professors preparing a course for this year’s scholars cohort, so Simon will have the unique experience of taking that course and engaging in a live session with Stephen Wolfram. It is breathtaking, a chance to connect with someone who is much older, renowned and accomplished, and at the same time so like-minded, a soulmate.

Inspired by reading Stephen Wolfram, Simon has revisited the world of cellular automata and Turing machines, and created a few beautiful Langton’s Ants:

Link to Simon’s sketch on p5: https://editor.p5js.org/simontiger/sketches/sHa6d-AFf
Simon especially likes the last example in the video: “I think of it as triangular houses surrounding a flower garden!”

Simon has also watched a talk by Stephen Wolfram for MIT course 6.S099: Artificial General Intelligence. He said it had things in it about Wolfram Alpha that he didn’t know yet.

Coding, Milestones, Murderous Maths, Python, Simon teaching, Simon's Own Code, Simon's sketch book

The Van Eck Sequence

Simon explains that the Van Eck Sequence is and shows the patterns he has discovered in the sequence by programming it in Python and plotting it in Wolfram Mathematica. Simon’s project in Wolfram is online at: https://www.wolframcloud.com/objects/4066d93a-893b-4a99-9fdc-54e265d27888

He also shows Neil Sloane’s proof of why the sequence is not periodic and adds an extra bit to make the proof more complete.

This video is inspired by the Numberphile video about the Van Eck sequence.

Simon’s code in Python to generate the Van Eck sequence
Coding, Milestones, Murderous Maths, Simon's Own Code, Simon's sketch book

Multiplicative Persistence in Wolfram Mathematica

Simon has tried Matt Parker’s multiplicative persistence challenge on Numberphile: by multiplying all the digits in a large number, looking for the number of steps it takes to bring that large number to a single digit. Are there numbers that require 12 steps (have the multiplicative persistence of 12)?

Simon explaining the project

Simon has worked on this for two days, creating an interface in Wolfram Mathematica. He wrote the code to make the beautiful floral shapes above, they are actually graphs of how many steps three digit numbers take to get to single digit numbers (each ”flower” has the end result at its center).

What about the numbers with many more digits than three? Simon has tried writing code to look for the multiplicative persistence of really large numbers and also came up with some efficiencies, i.e. shortcuts in the search process. He did manage to find the persistence for 2^233 (the persistence was 2):


persistence for 2^233

However after he applied one of his efficiencies to the code to be able to search through many numbers at once, the code didn’t run anymore. You can read Simon’s page about this project and see his code here:

https://www.wolframcloud.com/objects/monajune0/Published/persistence.nb

Simon writes:

277777788888899 is the smallest number with a persistence of 11.
The largest known is 77777733332222222222222222222:

This code works with a few efficiencies:
1. They’ve already checked up to 10^233, so we don’t have to check those again.
2. We can rearrange the digits, and the multiplication will be the same. So we don’t have to check any of the rearrangements of any of the numbers we’ve already checked.
3 
3a. We should never put in a 0 (a digit of the number). Because then you would be multiplying by 0, which would result in 0 in 1 step!
3b. We should also never put in a 5 and an even number. Because, in the next step, the number would be divisible both by 5 and by 2, so it’s also divisible by 10. That would put a 0 in the answer, which we saw we should never do!
3c. With similar reasoning (assuming we want to find the smallest number of the type we want), we’ll see we should never put in:
– Two 5s
– A 5 and a 7
– When we put in a… (- means anything, the order doesn’t matter):
1,- , remove the 1
2,2, put 4 instead
2,3, put 6 instead
2,4, put 8 instead
3,3, put 9 instead
So, we can reduce the search space and time collossaly, with just some logic!

Coding, Logic, Machine Learning, Milestones, Murderous Maths, Notes on everyday life, Simon's Own Code

Domain Coloring with Complex Functions in Wolfram Mathematica

Simon has been completely carried away by Wolfram Mathematica. He keeps starting new projects, just to try something out. After working on his Knot Theory book for days, and making beautiful illustrations in Wolfram, he switched over to domain coloring. The images below are some impressions of his experimenting with the color function. He hasn’t applied the complex function yet.

Another new project he started has been Poisson disc sampling.

“Wolfram is the most advanced language! It has most built-in stuff in it! At Wolfram, they are working so hard, that the knowledge base is changing every second!” Simon screams out as he pauses the Elementary Introduction to Wolfram Language book (he was reading it at first and now binge watches it as a series of video tutorials). Simon has been especially blown away by the free-form linguistic input: “From plane English it somehow computes the results and maybe even native Mathematica Syntax!” Wolfram also “has an entire section which is machine learning!”

Simon has started a free trial about a week ago, but I guess we’re buying a subscription.

Starting out
Only brightness left to do
Color function done
Coding, Crafty, Java, Murderous Maths

Cellular Automata

Simon’s new take on cellular automata:

Wolfram CA 9 Dec 2017

Some results would make fancy knitting patters!

In case you wonder, what on earth are cellular automata:

A cellular automaton (pl. cellular automata, abbrev. CA) is studied in computer science, mathematics, physics, theoretical biology and microstructure modeling.

A cellular automaton consists of a regular grid of cells, each in one of a finite number of states, such as on and off . The grid can be in any finite number of dimensions. For each cell, a set of cells called its neighborhood is defined relative to the specified cell. An initial state (time t = 0) is selected by assigning a state for each cell. A new generation is created (advancing t by 1), according to some fixed rule (generally, a mathematical function) that determines the new state of each cell in terms of the current state of the cell and the states of the cells in its neighborhood.

The concept was originally discovered in the 1940s by Stanislaw Ulam and John von Neumann while they were contemporaries at Los Alamos National Laboratory. While studied by some throughout the 1950s and 1960s, it was not until the 1970s and Conway’s Game of Life, a two-dimensional cellular automaton, that interest in the subject expanded beyond academia. In the 1980s, Stephen Wolfram engaged in a systematic study of one-dimensional cellular automata, or what he calls elementary cellular automata; his research assistant Matthew Cook showed that one of these rules is Turing-complete. Wolfram published A New Kind of Science in 2002, claiming that cellular automata have applications in many fields of science. These include computer processors and cryptography. (Wikipedia)

Coding, RaspberryPi

Wolfram in RaspberryPi 

Simon tried out a new language Wolfram on his RaspberryPi. Wolfram is a programming language that can be used to program 3D print sketches. “With different functions and constants you can do it exactly the way you want”, Simon says. In the video below he used Wolfram in a simple terminal.

Simon later also used Wolfram in Mathematica, a text editor pre-installed on RaspberryPi.

wp-image-1173566453jpg.jpeg

Wolfram can be used to program objects for 3D printing.