I’m working on a program that involves (somewhat tangentially) a very simplified version of mutation. A new cell inherits its rules from the cells around it, and is more likely to inherit a rule of more cells have it, but can still mutate against the majority rule. Here is the relevant line of code:
a=cell’s mutation rate
b=number of cells that constitute the majority position
c=number in the minority
if Math.random()<((a*c/(b+c))+(1-a)*b/(b+c))
the cell has the majority rule
Now, if I want to have no mutation, it isn’t enough just to set the cell’s mutation rate at zero, because that just makes it harder. What formula can I use with the cell’s mutation rate that will make no difference if the rate is not zero, but ensure that inheritance is strictly deterministic if mutation is zero? In other words, I need f(0) to be 0, changing the left side to be less than the right (ensuring the majority rule), but f(x) 0<x<1 to be 1 (or any number, so long as they all produce the same one), so that it doesn’t increase the likelihood of mutation. Something like
Math.random()*mutation/mutation<etc.
, except that will produce a /0 error when mutation is 0.
Yes, I know, I can just write in a variable and explicitly define it with these characteristics, but I don’t want to mess with the code any more than I have to. Any takers?