3
$\begingroup$

Oky maybe I found the answer...

I wrote a little simulation, the simulation is written in C++.

I read a publication and they told me that I have a number of ERC in a cell, and every generation 95% are retained in the old cell.

now the first program I wrote:

tot_ERC *= 0.95; //(1) 

*Edit: I corrected the program, I forgot to convert a float, so now the graph look like this(which althogh is anyway different than using (2)): First method

then I have heard that every ERC has an independent probabilty of 95% to be retained:
so I changed the program like this:

int tot_ERC = cell.get_erc_count(); for (int erc = 0; erc < tot_ERC; ++erc){      if (get_random_number_between_0_1() > 0.95 && cell.erc_count > 0){           cell.erc_count -=1;//(2)      }  } 

second method

In the indipendent probability method, actually the real probability is different from the input. It can be seen in the second image were the real p6 (blue line, fig 2.) is way above the 0.6 that I gave as a input... I don't know the name of this behaviour but I hope is clear...

  • 2
    Still not a coherent question. Voting to close.2012-08-06

1 Answers 1

1

I assume for every cell in "tot_ERC" you want to keep it with a probability of 95%. The correct way to do this in a program would be

int temp = 0; for (int erc = 0; erc < tot_ERC; ++erc){      if (get_random_number_between_0_1() > 0.95) temp = temp + 1; } tot_ERC = temp; 

Your approach actually has a loop where it is not clear how long it will run, also you run it 1 step too long in any case.

  • 0
    I will update the post with some more data in the future... thx anyway2011-11-26