Question: Q 3 . Create a NEW file with the name part 3 . Copy the content of the source file in Q 2 to
Q Create a NEW file with the name "part Copy the content of the source file in Q to this file. Modify the
program developed for Q to perform the following tasks:
Rewrite the function userMenu such that if the user enters fF ymxb where x
and y becomes functions of the input data pairs: time t or number of remaining particles N In other words,
transform equation so that y is linear on xymxb xft and
ygNxfN and ygt The process of fitting of a straight line to the set of transformed data is called
linear regression. You can easily compute m and b based on the following formulae to find this best fitting
straight line and then recover N and lambda from m and b :
mnsum xysum xsum ynsum xsum xbsum ymsum xn
n
where
sum x sum of values of xxxdotsxn
sum x sum of values of xxxdotsxn
sum y sum of values of yyydotsyn
sum xy sum of products xyxydotsxnyn
The sample outputs given below should be realised by your program on executing it inside Jupyter Notebook
or under any standard wellknown Python platform. Notice that the characters following : isare entered by
the user. The sample outputs given below should be realised by your program on executing it inside Jupyter Notebook or under any standard wellknown Python platform. Notice that the characters following : isare entered by the user.
l Find mean lifetime l Find mean lifetime
r Find remaining particles r Find remaining particles
h Find halflife
f Find best fitting curve from data
q Quit
Please enter your choice l r h f or q
to quit: f
Number of data points:
t:
N:
t:
N :
t:
N:
t:
N:
Initial particles
Decay constant
r Find remaining
f Find best fitting curve from data
q Quit
Please enter your choice l r h f or q
to quit: q
Thank you for using our system!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
