1
$\begingroup$

I am new to statistics so please bear with my question. There are some similar questions to mine but I didn't get the clear answer after reading them. I have a program that simulates the coin tossing situation. The user enters a guess and the program determines whether the user's guess is correct or not. Each user's guess will be considered as the null hypothesis. For example the user enters: the number of getting heads in 1000 coin flips is 400 if the probability of each single flip is 0.5. Then based on calculating the lower and upper critical values with the significance value of 0.05, the program informs the user whether their guess is correct or not. To code my program, I can think of the following way:

The program receives the number of flips from the user which is 1000 in this example and then does the 1000 flips for 100 separate times and after all experiments are done, the program calculates the mean of heads:

$mean = \frac{1}{100} \sum_{i=1}^{100} a_i$

where each a(i) is the number of heads in each 1000 flips. Eventually if the calculated mean is between lower and upper critical values, the user's guess is failed to reject, otherwise it is rejected.

Now I wonder if this way is the correct one?

Thanks.

$\endgroup$
2
  • 1
    $\begingroup$ You never accept the null hypothesis: you either reject it or fail to reject it. $\endgroup$ Commented Dec 19, 2019 at 4:27
  • $\begingroup$ @RobertIsrael Thanks... It is edited now. $\endgroup$ Commented Dec 19, 2019 at 5:38

1 Answer 1

0
$\begingroup$

Too long for a comment.

User's guess 400 Heads in 1000 coin tosses is not a null-hypothesis. Hypothesis testing tests parameter of a statistical model; in your case you model coin tosses by Bernoulli random variables, $\sim Ber(\theta)$, there $\theta$ is probability of getting Heads; or you can model number of Heads in 1000 tosses by Binomial random variable, it does not really matter what you model, because you are testing a value of $\theta$ again.

Possible null-hypotheses are $\theta=0.4$ or $\theta = 0.5$.

That said, please formulate what you want to do correctly. In hypothesis testing framework, you define null-hypothesis and significance level, and compute threshold values; then you run experiment ($100 \, 000$ coin tosses), and if the number of Heads is out of threshold values you reject null-hypothesis.

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.