Posts

Fuzzy dict access

At the time I wrote this little snippet I was often working with dictionaries in python and struggling to remember the exact keys that would be required to access the fields I wanted. This is long before starting this blog and was one of the mini-projects that has helped push me to start typing up the side projects and wonderings that I have. The premise is that you have some idea of the path to the desired element in the dictionary but not all of it. Given a dictionary, this program should return the first object in the dictionary tree which matches that path.

Do colliding black holes destroy information?

Image
I must premise this post with the fact that my formal physics education ended at sixth form and that these topics are gathered from online articles, discussion with friends and a lot of youtube videos. I hope that if there are errors, they are with my axioms and not my logic but the statements I make and sources I reference should be taken with a pinch of salt. I have recently been reading about the entropic theory of gravity and the idea that gravity could be an emergent property is fascinating! I have thought for a long time, talking about it at school, that there might be some fundamental logical underlying physics. What I mean by that is that if you look deep enough into maths you can derive the laws of physics. That the constants have to be that way because they are derived from mathematical laws rather than observation. This is my version of the “ Mathematical Universe Hypothesis ”. That the universe isn’t just described by mathematics it is mathematics. I don’t believe thi...

An infinite set of things called Al

Image
I love that you can use generators to represent infinite lists. There is something about representing things that it feels like you shouldn’t be able to represent in a finite machine that excites me. Language has incredible representative power, so large that it is easy to create contradictory sentences such as the sentence. “This sentence is false” You can use language to talk about things you can’t imagine such as when talking about infinity. You can define it by saying: “The number that is bigger than any other number.” Or a more accurate description of the aleph-null infinity, (because there are different kinds of infinity!) “The size of the set of natural numbers” You can go further and say that there is this thing which is: “The thing you can’t represent using words” Which similarly to “This sentence is false” is contradictory. If the thing truly can’t be represented using words then the sentence “The things that can’t be represented using words” can’t rep...

Artful code

Image
One of the things I want to achieve through the blog is the ability to compose a small project in an evening. Rather than just have ideas that never get implemented into even the most basic of MVP, the blog would encourage that I move to build my ideas quickly. Moving back to javascript has helped with that as the setup required to be able to get something visual working on an HTML5 canvas is much smaller than the equivalent elsewhere. Javascript was the language I started learning when I first learnt to code. It was the easiest to run because every computer already had a browser and notepad.exe. One of the things I like to do is create something akin to computational art and that is what I would argue I have done in this week's post. Artificial intelligence has been a long time interest of mine and one element of that is the interaction of agents. In this post, I have created a system of creatures which live in a world inspired by agar.io . If you are not familiar with the game i...

Speeding up life

Image
 Exploring ideas for speeding up the computation of Conway's game of life. Conway's game of life is a zero player game devised by the late John Conway in 1970. It is the first widely publicised example of the emergence of lifelike "creatures" from simple laws. The game is played on an infinite grid, where each cell of the grid can either be alive or dead. The following rules then define how the game is played going forward: Any live cell with two or three live neighbours survives. Any dead cell with three live neighbours becomes a live cell. All other live cells die in the next generation. Similarly, all other dead cells stay dead. Following these simple laws and given some live cells to start, strange patterns emerge. Creatures seem to crawl across the grid, other objects oscillate in peculiar ways.  The natural implementation and indeed the one that is used in most implementations is a boolean array in which each element of the array represents a single s...

The invincible 20 year olds

Image
It is often said that people age 20 think of themselves as if they’re invincible. It’s an attribute most commonly given to young men in general.  The idea of immortality is one which comes up in mythology a lot and sometimes it comes up within scientific circles. Bacon spent his life in search of finding ways to become immortal until, in perhaps an ironic way, his search killed him. When immortality is spoken about the concept of ageing is often also brought up, Tithonus comes to mind. Solving the problem of ageing through does not lead to immortality, although it may seem to be that way. Each year you live your chance of dying that year increases. This is how the ageing process manifests itself in this side of the numbers, growing from a low of 0.01% age 5 up to almost 40% age 100. What if instead, this didn’t rise. What if every year you had the same chance of dying as wh...

The twelve fold way

Image
I really struggle to remember the combinatorial rules. Do I need to use choose or do I need to use permute? How do I calculate each of them? Is this a case of stars and bars or is this something else? One of the things I want to add to my chatbot program is a way to ask which of the many systems should I be using? I did once try to build a javascript tool although I don’t think it ever really made itself into a useful state. I recently found a paper called “The twelvefold way” which explains all the different ways you put balls in boxes (or urns as is used in the paper). It really helped me to understand, at least a little better, how to calculate the different permutations of the problem. With this newfound understanding, I once again had a go at producing a program to calculate each, with a simple form-based input. One of the things that I wanted to extend this to doing was informing me of what the calculation method was. I really like the way google now lends a hand when you ask it...