5 ms·
Your Python program is incomprehensible to me, probably due to the lack of meaningful variable names and double modulo: for a in range(2,22): total =
by jules 14y ago
Your Python program is incomprehensible to me, probably due to the lack of meaningful variable names and double modulo:
for a in range(2,22):
total = 0
for b in range(2,25):
for c in range(1,1000):
cc = c + start_value
if(a % ((cc % b)+1) == 0):
total += 1
In any case, my point was about the specific simulation on the web page you linked to. See above for my suggestion about how to change the starting offset in the original simulation, which clearly shows that the effect is reversed for different offsets.
Response to this edit:
> Wait, hold on. The problem is not with the theory, it's with your code. You're requiring a match between two values n and n+1 at once. That undermines the basic idea. To make your code work and imitate nature, you would need to take separate sums for n and n+1, not together as in your example, just as though there were two organisms, each trying to match up with the cicada's reproductive cycle. BTW my Python program sums values with an arbitrary change of starting point, but separately. Your code above has an obvious bug.
I am just setting the starting offset (not the starting year as I think you are doing in the Python program) between the cicada and the predators to something other than zero. Lets assume as an example that the cicada cycle is 4 years and the predator cycle is 3 years. At simulation year 0, there can be a variety of situations: at this year the cicada are mating, the next year the cicada are mating, in 2 years the cicada are mating, or in 3 years the cicada are mating. The same goes for the predators: at simulation year 0, the predators are coming, or the next year the predators are coming, or in 2 years the predators are coming. A proper simulation would consider all these possibilities. Your simulation arbitrarily assumes that at simulation year 0 both the cicada are mating and the predators are coming, i.e. the offset between the cicada mating year and the predator arrival year is 0 at the start of the simulation. By increasing the cicada cycle year by a fixed number, I am changing this arbitrary assumption to a different number of years to show that this assumption has a large effect on the outcome of the simulation. So while the change is minimal and perhaps not the most readable way to introduce this offset, the change I made does not introduce a bug.
> Well, I certainly got that wrong. I assumed without evidence that you were one of those who bridles at the thought of someone criticizing psychology.
No, I even think the problem is more widespread than psychology alone (though in psychology it is particularly severe), having seen first hand and heard second hand how science is conducted in other areas (especially those close to psychology).
- lutusp 14y ago> Your Python program is incomprehensible to me, probably due to the lack of meaningful variable names I agree with this criticism, so I replaced the program: https://www.dropbox.com/s/7m8hq9yzcu5nztx/prime_reproduction_test.py https://www.dropbox.com/s/7m8hq9yzcu5nztx/prime_reproduction... > I am just setting the starting offset (not the starting year!) between the cicada and the predators to something other than zero. But if you change the offset of the predator's cycle, you've changed nothing unless the total years of test is a very small number. This is an easy claim to verify using my Python program -- you can arbitrarily change the starting point for the predator reproductive cycle, or the year, or any number of combinations -- but it doesn't change the outcome. The reason is that what's being measured is the number of collisions between a particular predator reproductive cycle over time, and a valid result merits a long time (I usually use 1000 years). This fact prevents the starting point from influencing the outcome. Also, since the basic test is to count how often the predators hatch out in synchrony with the cicadas for a given cicada cycle number, and since that requires using modulo arithmetic, it's not obvious how you could change the result by adding an offset to either the chosen predator reproductive cycle or the year (or both) -- especially since I test the survival value of each cicada cycle against a large range of predator cycles. The basic idea is that the cicadas evolve toward prime-numbered reproductive cycles by being tested in an environment filled with predators that use any number of other cycles, so a fair test requires me to compare a given cicada cycle with all plausible predator cycles and sum the results. Because I'm summing results for all predator cycles, adding a bias value to the predator cycle doesn't really change anything. That was why I was so sure this idea wouldn't hold up, but I tested it anyway. > No, I even think the problem is more widespread than psychology alone (though in psychology it is particularly severe), having seen first hand how science is conducted in other areas. Of course I agree. My focusing on psychology is not because their "science" is better or worse than, say, sociology, only that psychologists have clinics and patients -- people who deserve treatment driven by science, not anecdote. I apologize for my tone earlier. I've been receiving a lot of rather emotional defenses of psychology lately, including a valiant effort by psychologists and fans of psychology to delete my Wikipedia page (an effort that will eventually probably succeed).
- jules 14y ago