9 students have measured the half-life of a radioactive isotope. Create a PYTHON
ID: 3589303 • Letter: 9
Question
9 students have measured the half-life of a radioactive isotope. Create a PYTHON program that will read in the measured values and associated errors, then computes and prints out the best estimate of the true lifetime and its error based on the measurements.For the analysis, exclude any data as justifiable. then Explain your choice.) Student 1: 54.1 ± 0.9 Student 2: 54.7 ± 0.6 Student 3: 58.1 ± 2.3 Student 4: 63.1 ± 0.5 Student 5: 56.2 ± 0.9 Student 6: 56.3 ± 1.6 Student 7: 54.8 ± 1.3 Student 8: 54.9 ± 1.2 Student 9: 53.9 ± 1.8
note: the measurements are in miliseconds.
input file would be a straight text file with two column data consisting of (y,y)
Explanation / Answer
sum_value = 0.0
sum_error = 0.0
file = open("input53.txt","r")
count = 0
for line in file:
list = line.split(',')
sum_value = sum_value + float(list[0]);
sum_error = sum_error + float(list[1]);
count = count + 1
print(sum_value/count, "+/-" ,sum_error/count)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.