If you're having trouble viewing large code files on GitHub, you may find it helpful to download a ZIP file containing the entire repository. To do so, follow these steps:
- Click on the green "Code" button on the repository page.
- Select "Download ZIP" from the dropdown menu.
- Save the ZIP file to your computer.
This can be particularly useful if you're experiencing issues with GitHub's web interface or if you need to access the repository without an internet connection. If you have any questions or concerns, please don't hesitate to contact us.
In this report, we will discuss the simulation of temperature distribution, probability of error, and expected cost for a thermometer risk cost analysis. The project aims to analyze the risk involved in using a thermometer to measure the temperature of a certain object. The temperature distribution is simulated using the numpy and matplotlib libraries in Python, and the probability of error and expected cost are calculated using a set of randomly generated probabilities and costs for each temperature.
The simulation of temperature distribution involves generating a set of random normal distributions for each temperature between 0 and 39. The mean of the normal distribution is set to the temperature value, and the standard deviation is randomly generated between 0.2 and 0.4. The generated data is then plotted using the matplotlib library. We plotted the distribution of 15, 30, 19, 14.5, and 9 in the graph, which is shown above. From the graph, we can observe that the temperature distributions are centered around the expected temperature values.
The probability of error is calculated by comparing the simulated temperature values with the expected temperature values. A temperature measurement is considered to be an error if it deviates from the expected temperature value by more than 0.3 degrees. The probability of error is calculated for each temperature using the generated data, and a histogram is plotted using the matplotlib library. The histogram of the probability of error is shown in the graph above. From the graph, we can observe that the probability of error is highest for temperatures that are far from the expected temperature values.
The expected cost is calculated by multiplying the probability of error with the cost of error for each temperature. The cost of error is randomly generated for each temperature, and the cost varies based on the probability distribution of the temperature. The expected cost is calculated for each temperature, and the total expected cost is obtained by summing up the expected costs for all temperatures. The calculated expected cost is shown in the output.
In conclusion, the simulation of temperature distribution, probability of error, and expected cost for a thermometer risk cost analysis was performed using Python libraries. The generated data for the temperature distribution was used to calculate the probability of error, and the cost of error was randomly generated for each temperature. The results obtained from the simulation can be used to analyse the risk involved in using a thermometer to measure the temperature of an object. The expected cost can also be used to evaluate the cost-benefit of using a thermometer with the given set of probabilities and costs.