Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please solave using python programming. 21. Radioactive DecayStrontium-90, a rad

ID: 3749780 • Letter: P

Question

Please solave using python programming.

21. Radioactive DecayStrontium-90, a radioactive element that is part of the fallout from nuclear explosions, has a half-life of 28 years. This means that a given quantity of strontium-90 will emit radioactive particles and decay to one-half its size every 28 years. How many years are required for 100 grams of strontium-90 to decay to less than 1 gram? See Fig. 3.33.

FIGURE 3.33 Outcome of Exercise 21.

23. Car LoanWhen you borrow money to buy a house or a car, the loan is paid off with a sequence of equal monthly payments with a stated annual interest rate compounded monthly. The amount borrowed is called the principal. If the annual interest rate is 6% (or .06), then the monthly interest rate is .06/12=.005..06/12=.005. At any time, the balance of the loan is the amount still owed. The balance at the end of each month is calculated as the balance at the end of the previous month, plus the interest due on that balance, and minus the monthly payment. For instance, with an annual interest rate of 6%,

    [new balance]=[previous balance]+.005[previous balance][monthly payment]  =1.005[previous balance][monthly payment].    [new balance]=[previous balance]+.005·[previous balance][monthly payment]  =1.005·[previous balance][monthly payment].

Suppose you borrow $15,000 to buy a new car at 6% interest compounded monthly and your monthly payment is $290.00. After how many months will the car be half paid off? That is, after how many months will the balance be less than half the amount borrowed? See Fig. 3.35 on the next page.

FIGURE 3.35 Outcome of Exercise 23.

25. AnnuityAn annuity is a sequence of equal periodic payments. For one type of ­annuity, a large amount of money is deposited into a bank account and then a fixed amount is withdrawn each month. Suppose you deposit $10,000 into such an account paying 3.6% interest compounded monthly, and then withdraw $600 at the end of each month. The monthly interest rate will be .036/12 or .003, and the balance in the ­account at the end of each month will be computed as

[balance at end of month]=(1.003)[balance at end of previous month]600.[balance at end of month]=(1.003)·[balance at end of previous month]600.

After how many months will the account contain less than $600, and what will be the amount in the account at that time? See Fig. 3.37.

FIGURE 3.37 Outcome of Exercise 25.

27. Same Birthday as YouSuppose you are in a large-lecture class with n other students. Determine how large n must be such that the probability that someone has the same birthday as you is greater than 50%? See Fig. 3.39. Note: Forgetting about leap years and so assuming 365 days in a year, the probability that no one has the same birthday as you is (364365)n.(364365)n.

FIGURE 3.39 Outcome of Exercise 27.

29. Population GrowthIn 2014 China’s population was about 1.37 billion and growing at the rate of .51% per year. In 2014 India’s population was about 1.26 billion and growing at the rate of 1.35% per year. Determine when India’s population will surpass China’s population. Assume that the 2014 growth rates will continue. See Fig. 3.41.

FIGURE 3.41 Outcome of Exercise 29.

31. Saving AccountWrite a menu-driven program that allows the user to make transactions to a savings account. Assume that the account initially has a balance of $1,000. See Fig. 3.43.

FIGURE 3.43 Possible outcome of Exercise 31.

Explanation / Answer

Solution:

21.

ress = 0
amount = 100
while amount>=1:
amount = amount/2
ress = ress+28
print("The deacy time is " + str(ress) + " years. ")

23.

p=15000 # principal
intr=6 # interest
month=290 # monthly payment
bal=p # initial balance
n=0 # no. of months
while(True):
   new_bal=1.005*bal-mon # new balance at the end of every month
   n=n+1 # month increments
   if(new_bal<=p/2): # condition
       break
   bal=new_bal # update balance

print('loan will be half paid off after '+str(n)+' months')

25.

amtDeposited = 10000
interest = 3.6
amountWithdrawn = 600
numOfMonths = 0
balanceAtMonthEnd = amtDeposited

# compute the compounded interest rate
interest = (interest/1200)

# run a loop until previou balance is greater than amountWithdrawn
while (balanceAtMonthEnd > amountWithdrawn):
# compute balance at each month after withdrawing amount
balanceAtMonthEnd = (1+interest)*(balanceAtMonthEnd) - amountWithdrawn
# increment number of months
numOfMonths = numOfMonths+1

#display after how many months amount will be less than amount to be withdrawn
print "Balance will be $",round(balanceAtMonthEnd,2)
print "after ", numOfMonths, " months."

27.

import random

classSize = 23
year = [0]*365

for i in range(classSize):
newBDay = random.randrange(365)
year[newBDay] = year[newBDay] + 1

print(year)
import random
classSize = 23
numTrials = 1000
dupeCount = 0

for trial in range(numTrials):
year = [0]*365

for i in range(classSize):
newBDay = random.randrange(365)
year[newBDay] = year[newBDay] + 1

foundDupe = False
for num in year:
if num > 1:
foundDupe = True

if foundDupe == True:
dupeCount = dupeCount + 1

prob = dupeCount / numTrials
print("The probability of a shared birthday in a class of ", classSize, " is ", prob)