見出し画像

手書きとAIの力で統計学を解明:ChatGPTの実践ガイド

今回も前回の続きで、生成AIに出してもらった統計学の問題を解いていきます。

生成AIによる問題

Ultimate Question: Automotive Engineering Statistical Analysis
You are an automotive engineer tasked with analyzing the performance and reliability of different steel types used in manufacturing car chassis. Your goal is to determine the most suitable steel type based on various statistical analyses.

Data Sources
You have collected data from the following sources:

Public Statistics: Industry standards and material databases such as MatWeb and ASM International.
Field Studies: Real-world data collected from car chassis tested under various conditions.
Data Collected
The data includes tensile strength, yield strength, and ductility for three types of steel (Steel A, Steel B, and Steel C). You also have frequency distributions for the number of defects found in cars using each steel type after one year of use.

Data Summary
Steel Type	Tensile Strength (MPa)	Yield Strength (MPa)	Ductility (%)	Number of Defects (per 100 cars)
Steel A	800	600	15	10
Steel B	1000 850 10	5
Steel C	600	400	20	15

Problem Statement
Data Distribution:

#1
Create a bar graph showing the tensile strength, yield strength, and ductility for each steel type.
Draw a histogram of the number of defects for each steel type.
Measures of Central Tendency:

#2
Calculate the mean, median, and mode for the tensile strength of the three steel types.
Determine the range, variance, and standard deviation for the yield strength of the steel types.
Scatterplot and Correlation:

#3
Create a scatterplot showing the relationship between tensile strength and ductility for the three steel types.
Calculate the correlation coefficient between tensile strength and ductility.
Regression Analysis:

#4
Perform a simple linear regression to predict the number of defects based on tensile strength. Provide the regression equation and interpret the slope.
Hypothesis Testing:

#5
Conduct a hypothesis test to determine if there is a significant difference in the mean number of defects between Steel A and Steel B. Use a 5% significance level and state the null and alternative hypotheses, test statistic, p-value, and conclusion.
Confidence Intervals:

#6
Calculate the 95% confidence interval for the mean tensile strength of Steel B.
Decision Making:

Based on your analyses, recommend the best steel type for manufacturing car chassis, considering both performance (tensile strength, yield strength, ductility) and reliability (number of defects).

問6を解く

今回は問6、鋼Bの引張強さの95%信頼区間の計算に取り組みます。

まずは問題を理解し、鋼Bの引張強さのデータを確認します。もともとの問題では標本が一つしかないことになっていたので,10個の標本データを用意してもらいました↓

データ表

| 鋼の種類 | 引張強さ (MPa) |
|---------|----------------|
| 鋼B 1 | 1000 |
| 鋼B 2 | 980 |
| 鋼B 3 | 1020 |
| 鋼B 4 | 990 |
| 鋼B 5 | 1010 |
| 鋼B 6 | 1005 |
| 鋼B 7 | 995 |
| 鋼B 8 | 1008 |
| 鋼B 9 | 992 |
| 鋼B 10 | 1003 |

引張強さのデータを複数用意し、標本のばらつきを考慮して分析を進めていきます。

95%信頼区間の計算

以下は計算の過程です↓

計算過程(iPadのGoodnoteに書きました)

不偏分散の計算はめんどうだったのでchatgptにやってもらいました...

結果の検証

この結果が正しいかどうかを確認するため、まずは画像を読み込ませて回答を確認してもらいました.

#先程の計算過程のノートの画像 or PDFを添付する
This note is an answer to Q6. Please read this note and tell me if it is the correct answer.

#6 Confidence Intervals:
Calculate the 95% confidence interval for the mean tensile strength of Steel B.

すると計算過程をたどってくれて,正しい答えだと教えてくれました.

とはいえ,本当にあっているのか?という疑念があったのでPythonを使って同じ計算を行わせました。

Solve this problem step by step by python.

#6 Confidence Intervals:
Calculate the 95% confidence interval for the mean tensile strength of Steel B.

以下はPythonコードを使用した計算結果です。

import numpy as np
import scipy.stats as stats

data = [1000, 980, 1020, 990, 1010, 1005, 995, 1008, 992, 1003]
mean = np.mean(data)
std_dev = np.std(data, ddof=1)
confidence_interval = stats.t.interval(0.95, len(data)-1, loc=mean, scale=std_dev/np.sqrt(len(data)))

print("95% Confidence Interval: ", confidence_interval)
#出力結果
Sample Standard Deviation: 6.036555309114628
Critical t-value: 2.2621571627409915
Margin of Error: 4.318291528539813
95% Confidence Interval: (995.6817084714602, 1004.3182915285398)

この結果、同じ信頼区間が得られました。これにより、計算が正しいことを確認できました。

結論

今回は生成AIから出題された統計の問題をノートで解き、その回答をAIに確認してもらいました。文字認識技術の進歩を改めて実感し、これをさらに活用する方法を考えていきたいと思いました。

手書きの内容を生成AIと連携させることで、新しい学びの形を創造できるかもしれません。

この記事が気に入ったらサポートをしてみませんか?