One nice property of a Turing-complete language is that it can be used to write any program, up to and including the simulation of the entire Universe.
Your job is to do exactly that: write a program which simulates the Universe.
Note: although I don't doubt you'll be able to accomplish this task, nowadays I don't have enough spare time to verify whether all 1090 of the particles in your simulation do what they really should do. Therefore, solely to simplify testing and evaluation, it is enough if your universe simulator only works with a single starting particle. To keep things interesting, let's assume this particle is the recently discovered Higgs Boson.
Your universe starts with nothing but a single Higgs Boson of approximately 120 GeV in the middle of it. To not make the output too long, let's make this universe tick at only 10-25 seconds instead of its "usual clock rate" of 5.4×10−44 seconds..
This Higgs boson will decay sooner or later as it has a half-life of 1.6×10−22 seconds, so at every tick of the simulation, it has a 0.0433% chance of decaying. You can check here what it will decay into. To have a central and simplified requirement, I list the branching ratios you should use:
Running the simulation
At each tick of the simulation, the Higgs boson has a 0.0433% chance of decaying. If that happens, it will decay into the following particles, with the listed probabilities (you should use these names in the output):
- bottom quark + bottom antiquark (64.8%)
- 2 W bosons (14.1%)
- 2 gluons (8.82%)
- tau lepton + antitau lepton (7.04%)
- charm quark + charm antiquark (3.27%)
- 2 Z bosons (1.59%)
- 2 photons (0.223%)
- 1 Z boson + 1 photon (0.111%)
- muon + antimuon (0.0244%)
- top quark + top antiquark (0.0216%)
For a total of 100%.
Some of these particles will decay further.
W boson: half-life of 10-25 seconds, this means a 50% chance to decay at every tick into one of the following, with equal probabilities:
- positron + neutrino
- antimuon + neutrino
- antitau lepton + neutrino
Z boson: half-life of 10-25 seconds, this means a 50% chance to decay at every tick into one of the following:
- neutrino + antineutrino (20.6%)
- electron + positron (3.4%)
- muon + antimuon (3.4%)
- tau lepton + antitau lepton (3.4%)
- down quark + down antiquark (15.2%)
- strange quark + strange antiquark (15.2%)
- bottom quark + bottom antiquark (15.2%)
- up quark + up antiquark (11.8%)
- charm quark + charm antiquark (11.8%)
top quark: half-life of 5×10-25 seconds, this means a 12.95% chance to decay at every tick into the following, with equal probabilities:
- W boson + down quark
- W boson + strange quark
- W boson + bottom quark
Of course, the W boson will also soon decay...
The top antiquark behaves similarly to the top quark: it decay into a W boson and a d/s/b antiquark.
All other particles (so all except for the Z and W bosons and top quarks) have a half life many orders of magnitude longer, so to not clutter the output, they are all considered stable for our simulation.
As the universe is largely empty, all the particles will have enough space for themselves and will not interact with each other. Therefore all individual particles are independent from each other in every regard, including the probabilities of splitting.
Every tick of the simulation, you have to print the contents of the simulated universe into a new line. For example:
The universe contains 1 Higgs boson. The universe contains 1 Higgs boson. The universe contains 1 Higgs boson. The universe contains 1 Higgs boson. The universe contains 2 W bosons. The universe contains 2 W bosons. The universe contains 1 W boson, 1 positron and 1 neutrino. The universe contains 1 positron, 1 antitau lepton and 2 neutrinos. Simulation ended after 0.8 yoctoseconds.
The order of the particles in the line is not important. The formatting, however, must be exactly as in the example above, including punctuation and pluralization. If you simulate an entire (mini-) universe, it should look nice (And I wanted to eliminate the abusing of a not sufficiently strict output requirement)
Each line corresponds to 0.1 yoctoseconds, but you will be forgiven if it takes longer than that for your program to print the output.
The simulation ends when only "stable" particles remain.
Standard code golf rules apply.
The random number generator can be pseudo-random, but you must seed it if the language doesn't seed it by default. The probability distribution of your RNG must be uniform.
- You will get a bonus -10% to the code size if the program takes an integer as an input, and starts with that many Higgs bosons.
Exception for Turing machine enthusiasts.
For those who dare to try their luck with an actual Turing machine or a similar language (like Brainfuck), their task is made easier by the following rule changes (only applicable if the language is a Brainfuck-derivative or otherwise a very simplified Turing-machine, incapable of assignment, lacking an ALU, and values on the tape can only be incremented and decremented by one):
- The particle names are simplified to d, s, b, t, u, c for the quarks, v for the neutrino, T for tau lepton, m for muon, g for gluon, p for photon, Z, W and H for the bosons, - for the electron and + for the positron. At each tick, an input with the value of 0 or 1 are provided from the standard input, indicated whether the first unstable particle in the list decays or not.
The example output will therefore become
H H H H W W W W W + n + !T n n