<jupyter_start><jupyter_text>One sample t test Case 1 two tailed t testStudents' academic performance is related to the teaching methods of teachers. A teacher at a school adopted a new and effective teaching method. After one academic year of teaching, six students' test scores were randomly selected from the class taught by the teacher, which were 48.5, 49.0, 53.5, 49.5, 56.0, and 52.5, respectively. The score is 52.0. Try to analyze whether there is a significant difference in the scores of students who use this teaching method and those who do not use the new teaching method (known test results obey normal distribution, take α = 0.05) H0 : μ ＝ μ0H1 : μ ≠  μ0μ0 = 52.0, S = 2.98, $\bar{X}$ = 51.5, n = 6t = $\frac{\bar{X}-\mu_0}{S \over \sqrt n}$ = $\frac{51.5-52}{2.98 \over \sqrt 6}$<jupyter_code>import math
t = (51.5 - 52) / (2.98/math.sqrt(6))
print(t)<jupyter_output>-0.41098821187637213<jupyter_text>α/2 = 0.025, look up table $t_{\alpha/2}(5)$ = 2.571$\lfloor t\lfloor$ = $\lfloor -0.41\lfloor$ = 0.41 < 2.571, so accept H0  Case 2 one tailed t testAn automobile manufacturer claims that the average life span of a tire of a certain grade is more than 40000 km under certain vehicle weight and normal driving conditions, for 120 wheels. The mean and standard deviation of the random samples were x = 41000 and S = 5000. The kilometers of the known tire life approximately follow the normal distribution. Does the manufacturer's product conform to the standard he said? (alpha =0.05) H0 : μ ≤ μ0H1 : μ > μ0μ0 = 40000, s = 5000, $\bar{X}$ = 41000, n = 120t = $\frac{\bar{X}-\mu_0}{s \over \sqrt n}$ = $\frac{41000-40000}{5000 \over \sqrt 120}$<jupyter_code>import math
t = (41000 - 40000) / (5000/math.sqrt(120))
print(t)<jupyter_output>2.1908902300206643<jupyter_text>α = 0.05, look up table $t_{\alpha}(119)$ = 1.658t = 2.19 > 1.658, so reject H0 and accept H1, we believe that the average life of tyres is significantly longer than 40000 km  Case 3 two tailed t test(the sample size is 168, approximate to z-test)The result of mathematics competition in a province shows that the distribution of scores is not normal, and the total average score is 43.5. Among them, 168 students participated in the competition in a county, x = 45.1, s = 18.7. Is there a significant difference between the average score of the county and that of the whole province? (α = 0.05) H0 : μ ＝ μ0H1 : μ ≠  μ0μ0 = 43.5, S = 18.7, $\bar{X}$ = 45.1, n = 168t = $\frac{\bar{X}-\mu_0}{S \over \sqrt n}$ = $\frac{45.1-43.5}{18.7 \over \sqrt 168}$<jupyter_code>import math
t = (45.1 - 43.5) / (18.7/math.sqrt(168))
print(t)<jupyter_output>1.1090037558772818
{'fraction_non_alphanumeric': 0.11749149981110692, 'fraction_numerical': 0.1118247072157159, 'mean_word_length': 3.9495327102803737, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '563864', 'license': 'MIT', 'n_tokens_mistral': 1082, 'n_tokens_neox': 872, 'n_words': 374, 'path': 'hypothesis-testing/t-test/one-sample-t-test/one-tailed-test/python/one-sample-t-test.ipynb', 'repo_name': 'fuguixing/statistics', 'size': '2647'}