Question: Q 3 . Create a NEW file with the name part 3 . Copy the content of the source file in Q 2 to

Q3. Create a NEW file with the name "part3". Copy the content of the source file in Q2 to this file. Modify the
program developed for Q 2 to perform the following tasks:
Rewrite the function userMenu () such that if the user enters ' fF 'y=mx+b where x
and y becomes functions of the input data pairs: time t or number of remaining particles N. In other words,
transform equation (1) so that y is linear on xy=mx+b x=f(t) and
y=g(N)x=f(N) and y=g(t). 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_(0) and \lambda from m and b :
m=(n\sum xy-(\sum x)(\sum y))/(n\sum x^(2)-(\sum x)^(2)),b=(\sum y-m(\sum x))/(n)
n
where
\sum x= sum of values of x=x_(1)+x_(2)+dots+x_(n)
\sum x^(2)= sum of values of x^(2)=x_(1)^(2)+x_(2)^(2)+dots+x_(n)^(2)
\sum y= sum of values of y=y_(1)+y_(2)+dots+y_(n)
\sum xy= sum of products =x_(1)y_(1)+x_(2)y_(2)+dots+x_(n)y_(n)
The sample outputs given below should be realised by your program on executing it inside Jupyter Notebook
or under any standard well-known Python platform. Notice that the character(s) following ' : ' i(s)/(a)re 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 well-known Python platform. Notice that the character(s) following '\( : \)' is/are entered by the user.
```
[l] Find mean lifetime [[l] Find mean lifetime
[r] Find remaining particles [r] Find remaining particles
[h] Find half-life
[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: 4
t1: 1
N1: 5800
t2: 2
N2 : 2750
t3: 3
N3: 1300
t4: 3.5
N4: 900
Initial particles =12224
Decay constant =0.746
[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!
```
Q 3 . Create a NEW file with the name "part 3 " .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!