can anyone help me understand the following project specs? it is supposed to be relatively simply to code, but i can't even figure out what exactly i'm supposed to do.(adsbygoogle = window.adsbygoogle || []).push({});

there are 1000000 people choosing A or B. the process repeats 1000 times. 520000 chose A while 480000 chose B. but there was a 15% error in which B was mistaken for A or A was mistaken for B. is the 15% rate enough to make the results invalid? find the acceptable error rate.

this is what i have so far. i'm not sure how to take into account the error or number of people who actually choose A or B.

Code (Text):

int main(){

int A = 0;

int B = 0;

int aWins = 0;

srand(time(0));

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

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

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

B++;

else

A++;

}

if (A > B)

aWins++;

}

cout << aWins << endl;

cout << (double)(aWins*100)/1000<< endl;

}

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

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

# Homework Help: Probability program

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