PROJECT EULER · #0666
Polymorphic Bacteria
- Every minute, each individual will simultaneously undergo some kind of transformation.
- Each individual
of type will, independently, do one of the following (at random with equal probability):- clone itself, resulting in a new bacterium of type
(alongside who remains) - split into 3 new bacteria of type
(replacing )
- clone itself, resulting in a new bacterium of type
- Each individual
of type will, independently, do one of the following (at random with equal probability):- spawn a new bacterium of type
(alongside who remains) - die
- spawn a new bacterium of type
If a population starts with a single bacterium of type
Now consider another species of bacteria,
Every minute, for each
- If
, dies. - If
, clones itself, resulting in a new bacterium of type (alongside who remains). - If
, mutates, changing into type . - If
, splits into 3 new bacteria of type (replacing ). - If
, spawns a new bacterium of type (alongside who remains).
In fact, our original species was none other than
Let
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.