Professional Documents
Culture Documents
IntroductiontoScientificandEngineeringComputing FinalExam
Spring2010
2.8
0.2
x 2 sin x dx
1 ( ) 2n !x ( )
n=0
()
2n
.UseMatlabto
calculatecosh(2)withinanerrorof0.001. 3. FreshestFoodmarketisannouncinganewpromotion.TheirthemeisCuttingdownpricesasyoubuy!10% offeveryadditionalitemyoubuyafterpurchasetotals$20,and20%offafter$50!.WhenJulieseesthis promotionshenoticesthatitwouldbeagoodmovetoarrangegoodssothatthemostexpensiveitemswill beprocessedlastatcheckout.WhenshereachesthecounterJuliearrangeshergroceriesasfollows. Itemnumber 1 2 3 4 5 6 7 8 9 Unitprice 0.45 2.95 1.99 4.99 4.95 3.99 7.99 16.95 11.99 Numberofitems 1 1 2 1 1 2 2 1 2 HowmuchwillJuliepay?
BIL108E
IntroductiontoScientificandEngineeringComputing FinalExam
Spring2010
x 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 f 1.543 1.669 1.811 1.971 2.151 2.352 2.577 2.828 3.107 2. TheexplicitformofMaclaurinseriesexpansionfor ln 1 + x is, ln 1 + x = calculate ln 1 + x withinanerrorof0.001for
)
n=1
( 1)
n
n+1
x n .UseMatlabto
3. David deposits 1000 USD at Bank A and Mark deposits 1000 USD at Bank B. Bank A offers a 5% annual interest rate whereas Bank B offers 8.5%. Write a Matlab function that inputs Davids and Marks initial deposits,andinterestratesofferedbyBankAandBankB.Yourfunctionshouldreturnthenumberofyears forMarkssavingtobecomeatleasttwiceasmuchasDavids.
BIL108E
IntroductiontoScientificandEngineeringComputing FinalExam
Spring2010
SECTIONC
x 1. UseSimpsonsRuletointegrate f x = e cos 3x with24panelon 0 x 5 .Whatistheerror?
()
( )
()
()
n=0
x 2n+1 .Use 2n + 1 n!
2 1
( )
3. Amathematicalsequence,f,isdefinedthisway: f n = f n 1 + f n 1 . f n 2 for
f 1 = 1 and f 2 = 1. WriteanmfilethatinputsapositiveintegerNasinputandoutputsthefirstN
numbersinthissequenceasavector.Forexampleforaninputof4,theoutputshouldbe[1124].
()
()
()
) (
where
BIL108E
IntroductiontoScientificandEngineeringComputing FinalExam
Spring2010
SECTIOND
x 1. Obtaintheintegralof e cos 2x overtheinterval 0, / 4 withinanerrorof0.001. 1
( )
( / 2) withanerrorof0.001.Hint:YoucanuseMatlabbuiltinfunctionstocalculatethe
( x ) is tan ( x ) = 2n 1 x
1 n=1
( 1)
n+1
2n1
.UseMatlabto
actualvalue. 3. Elaineopensasavingaccountwitha6%interestrateanddeposits10000USD.Inthenext30yearsElaine doesthefollowing: i. Shedeposits10000USDatthebeginningofeveryyear. ii. In years when she has more than 100000 USD, she withdraws 10% of her total balance to buy mutualfunds. WriteaMatlabfunctionthatcalculatestheElainesaccountbalanceforendoftheeachyearoverthenext 30years.
BIL108E
IntroductiontoScientificandEngineeringComputing FinalExam
Spring2010
SECTIONE 1. Usethedatainthetabletofindtheintegralbetween x f 2. TheexplicitformofMaclaurinseriesexpansionfor is sinh x = 1 1.543 1.1 1.669 1.2 1.811 1.3 1.971 1.4 2.151 and 1.5 2.352 usingSimpsonsrulewith 1.6 2.577 1.7 2.828 1.8 3.107 .
calculate sinh 3 withanerrorof0.001.Hint:YoucanuseMatlabbuiltinfunctionstocalculatetheactual value. 3. Dr.Craneopensabankaccountwithaninitialdepositof2125USD.Hewillrecieve6.25%yearlyinterest. Right after he deposits the money he moves to Paris and stay there for 19 years. He does not make any deposits or withdrawals during this time. 19 years later he returns home and goes to collect the money fromhisaccount.Howmanydollarsininteresthashisaccountearnedoverthelast19years?(Interestis compoundedfourtimeseveryyear,whichyoucanassumethatforeverythreemonths6.25/4%interestis paidtoDr.Cranesaccount.)
()
() (
n=0
x 2n+1 .UseMatlabto 2n + 1 !