n = 10;
t = Table[RandomInteger[], n];
c = Counts[t]
c1 = c[[1]] - n/2
avg = c1/n // N
Basically I would like to produce a graph showing how increasing the number of trials causes the result to trend towards zero. I would like to iterate the above formulas over {n^i, {i,0,10}} and then graph the avg so the different number of trails can be compared, for n = 10, 100, 1000, etc. But I have a problem with c[[1]] takes the first position in the list and the first position is sometimes 0 and sometimes 1 and I would like to just look at “1”.
Starting i at 0 means there is a 50% chance that the count of 1 is 0 so Counts will return an empty Association and Part will fail. Also, ending it at 10 means the table will have 10^10 values.