there are 1000 valid results, but 1 is invalid. in other words, 99.9% of the results are valid. what is the error rate for this to be possible?(adsbygoogle = window.adsbygoogle || []).push({});

basically right now i have these facts -- if A has more than B, A wins. in order for a result to be considered "valid," A must have more wins than B. below is a code with 15% error rate. my question is how do i find the error rate for the above restraints?

Code (Text):

int main(){

int A = 0;

int B = 0;

int aWins = 0;

int errorPercent = 15; // errorPercent% of the time, the comparison will be incorrect

srand(time(0));

for (int j = 0; j < 1000; j++){

for (int i = 0; i < 1000000; i++){

if ((rand()%2) == 0)

if( (rand()%100) + 1 > errorPercent )

B++;

else

A++;

else

if( (rand()%100) + 1 > errorPercent )

A++;

else

B++;

}

if (A > B)

aWins++;

}

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Finding percent error

**Physics Forums | Science Articles, Homework Help, Discussion**