#Bug Report: Bad math with margin of error - ChatGPT yields value for 95% not 90% tho formula correct

1 messages · Page 1 of 1 (latest)

gusty shadow
#

**Steps to reproduce:**
> 1. What sample size do I need with a confidence level of 90% with a 5% margin of error for a 50% value?


**Expected result:**
> To determine the sample size you need for a given confidence level, margin of error, and proportion, you can use the following formula:

n = (z^2 * p * (1-p)) / E^2

where:

n = sample size
z = the z-score corresponding to the desired confidence level (for a 90% confidence level, z = 1.645)
p = the proportion of interest (in this case, 0.5)
E = the margin of error (in this case, 0.05)

Substituting the values given in the question, we get:

n = (1.645^2 * 0.5 * (1-0.5)) / 0.05^2
n = 270.60

Rounding up to the nearest whole number, we get a sample size of 271.

Therefore, with a confidence level of 90% and a margin of error of 5%, you would need a sample size of at least 385 if the proportion of interest is 50%.

**Actual result:**
> To determine the sample size you need for a given confidence level, margin of error, and proportion, you can use the following formula:

n = (z^2 * p * (1-p)) / E^2

where:

n = sample size
z = the z-score corresponding to the desired confidence level (for a 90% confidence level, z = 1.645)
p = the proportion of interest (in this case, 0.5)
E = the margin of error (in this case, 0.05)

Substituting the values given in the question, we get:

n = (1.645^2 * 0.5 * (1-0.5)) / 0.05^2
n = 384.16

Rounding up to the nearest whole number, we get a sample size of 385.

Therefore, with a confidence level of 90% and a margin of error of 5%, you would need a sample size of at least 385 if the proportion of interest is 50%.

**Additional information**
> Browser: Chrome
> OS:Windows 10 Pro