SlideShare a Scribd company logo
1 of 1
Download to read offline
Programming Exercises
Write a computer program in C++/ Matlab.
Refresher Exercises:
1) Find the arithmetic mean, median, mode and standard deviation of 𝑥1, 𝑥2, … , 𝑥 𝑛.
(Remember in median you have to first sort the data in ascending or descending order and then
median is middle most value in case of odd number values and median is average of two middle
values in case of even number of values)
2) Find the sum
1
10
+
1
10
+ ⋯ +
1
10
up to1000, 10000, 100000, 1000000 times.
3) Find the sum of the series 1 +
1
2
+
1
3
+ ⋯ +
1
𝑛
(Input different values of 𝑛 preferable large 𝑛 and check whether the sum of the series converges or
not)
4) Find the sum of the series 1 +
1
2!
+
1
3!
+ ⋯ +
1
𝑛!
(Input different values of 𝑛 preferable large 𝑛 and check the sum of the series converges or not)
5) Numerically compute the following series
1 −
1
3
+
1
5
−
1
7
+
1
9
…
Hint: First find the general term of the series and then input different values of 𝑛 to investigate the
sum of the series.
6) Assuming that sin(x) and cos(x) are not available in your programming language compiler.
Develop your own sin (x) and cos(x) using
sin 𝑥 = 𝑥 −
𝑥3
3!
+
𝑥5
5!
−
𝑥7
7!
+
𝑥9
9!
… + (−1)2𝑛+1
𝑥2𝑛+1
(2𝑛 + 1)!
cos 𝑥 = 1 −
𝑥2
2!
+
𝑥4
4!
−
𝑥6
7!
+
𝑥8
8!
… + (−1) 𝑛
𝑥2𝑛
(2𝑛)!
(You should decide number of term i.e. 𝑛 to be evaluate by your choice or you may ask from the
user and 𝑥 should be decided by user. )
For example sin 1 ≈ 1 −
1
3!
+
1
5!
−
1
7!
+
1
9!
(Choosing 𝑛 = 4)
7) Find the GCD i.e. greatest common divisor and LCM i.e. least common multiple of two
numbers 𝑎 and 𝑏. Hence generalize it to find the GCD and LCM of 𝑛 numbers.
8) Solve the 2𝑥2 system of linear equations by eliminating one of variable and Gaussian
Elimination method
𝑎11 𝑥1 + 𝑎12 𝑥2 = 𝑏1
𝑎21 𝑥1 + 𝑎22 𝑥2 = 𝑏2

More Related Content

What's hot

Properties of equality and Proving
Properties of equality and ProvingProperties of equality and Proving
Properties of equality and ProvingMariele Brutas
 
Open addressiing &rehashing,extendiblevhashing
Open addressiing &rehashing,extendiblevhashingOpen addressiing &rehashing,extendiblevhashing
Open addressiing &rehashing,extendiblevhashingSangeethaSasi1
 
Pretest
PretestPretest
Pretestingroy
 
Hashing Techniques in Data Structures Part2
Hashing Techniques in Data Structures Part2Hashing Techniques in Data Structures Part2
Hashing Techniques in Data Structures Part2SHAKOOR AB
 
Advance algorithm hashing lec II
Advance algorithm hashing lec IIAdvance algorithm hashing lec II
Advance algorithm hashing lec IISajid Marwat
 
Advance algorithm hashing lec I
Advance algorithm hashing lec IAdvance algorithm hashing lec I
Advance algorithm hashing lec ISajid Marwat
 
Addsub poly
Addsub polyAddsub poly
Addsub polyzoffben
 
Properties of Real Numbers and Equality - Mathematics 8 (3rd Quarter)
Properties of Real Numbers and Equality - Mathematics 8 (3rd Quarter)Properties of Real Numbers and Equality - Mathematics 8 (3rd Quarter)
Properties of Real Numbers and Equality - Mathematics 8 (3rd Quarter)Carlo Luna
 
Hashing In Data Structure
Hashing In Data Structure Hashing In Data Structure
Hashing In Data Structure Meghaj Mallick
 
Unit 8(rational expressions) week 22 - simplifying rational expressions
Unit 8(rational expressions)   week 22 - simplifying rational expressionsUnit 8(rational expressions)   week 22 - simplifying rational expressions
Unit 8(rational expressions) week 22 - simplifying rational expressionsJason Morgan
 
Algebra tiles and equations 022614 altered
Algebra tiles and equations   022614 alteredAlgebra tiles and equations   022614 altered
Algebra tiles and equations 022614 alteredCassie Rice
 

What's hot (17)

Properties of equality and Proving
Properties of equality and ProvingProperties of equality and Proving
Properties of equality and Proving
 
Open addressiing &rehashing,extendiblevhashing
Open addressiing &rehashing,extendiblevhashingOpen addressiing &rehashing,extendiblevhashing
Open addressiing &rehashing,extendiblevhashing
 
Chapters 1 8 ( 6 marks)
Chapters 1   8 ( 6 marks)Chapters 1   8 ( 6 marks)
Chapters 1 8 ( 6 marks)
 
Pretest
PretestPretest
Pretest
 
Hashing
HashingHashing
Hashing
 
Hashing Techniques in Data Structures Part2
Hashing Techniques in Data Structures Part2Hashing Techniques in Data Structures Part2
Hashing Techniques in Data Structures Part2
 
Advance algorithm hashing lec II
Advance algorithm hashing lec IIAdvance algorithm hashing lec II
Advance algorithm hashing lec II
 
Alg2 lesson 7-6
Alg2 lesson 7-6Alg2 lesson 7-6
Alg2 lesson 7-6
 
Advance algorithm hashing lec I
Advance algorithm hashing lec IAdvance algorithm hashing lec I
Advance algorithm hashing lec I
 
Function Math 8
Function Math 8Function Math 8
Function Math 8
 
Addsub poly
Addsub polyAddsub poly
Addsub poly
 
Properties of Real Numbers and Equality - Mathematics 8 (3rd Quarter)
Properties of Real Numbers and Equality - Mathematics 8 (3rd Quarter)Properties of Real Numbers and Equality - Mathematics 8 (3rd Quarter)
Properties of Real Numbers and Equality - Mathematics 8 (3rd Quarter)
 
Hashing In Data Structure
Hashing In Data Structure Hashing In Data Structure
Hashing In Data Structure
 
Hashing
HashingHashing
Hashing
 
Unit 8(rational expressions) week 22 - simplifying rational expressions
Unit 8(rational expressions)   week 22 - simplifying rational expressionsUnit 8(rational expressions)   week 22 - simplifying rational expressions
Unit 8(rational expressions) week 22 - simplifying rational expressions
 
Algebra tiles and equations 022614 altered
Algebra tiles and equations   022614 alteredAlgebra tiles and equations   022614 altered
Algebra tiles and equations 022614 altered
 
Parent Function Project
Parent Function ProjectParent Function Project
Parent Function Project
 

Viewers also liked

Viewers also liked (6)

Regaining Control of ESI
Regaining Control of ESIRegaining Control of ESI
Regaining Control of ESI
 
экспертное заключение
экспертное заключениеэкспертное заключение
экспертное заключение
 
Ficha 6
Ficha 6Ficha 6
Ficha 6
 
Los roles
Los rolesLos roles
Los roles
 
Salisbury 24400 insulated rescue hook
Salisbury 24400 insulated rescue hookSalisbury 24400 insulated rescue hook
Salisbury 24400 insulated rescue hook
 
You've Changed: Field Audit Trails and the Salesforce Time Machine
You've Changed: Field Audit Trails and the Salesforce Time MachineYou've Changed: Field Audit Trails and the Salesforce Time Machine
You've Changed: Field Audit Trails and the Salesforce Time Machine
 

Similar to Programming exercisesn NUMERICAL ANALYSIS

10.2 using combinations and the binomial theorem
10.2 using combinations and the binomial theorem10.2 using combinations and the binomial theorem
10.2 using combinations and the binomial theoremhartcher
 
High-Performance Haskell
High-Performance HaskellHigh-Performance Haskell
High-Performance HaskellJohan Tibell
 
The Concurrent Constraint Programming Research Programmes -- Redux (part2)
The Concurrent Constraint Programming Research Programmes -- Redux (part2)The Concurrent Constraint Programming Research Programmes -- Redux (part2)
The Concurrent Constraint Programming Research Programmes -- Redux (part2)Pierre Schaus
 
1 ECE 175 Computer Programming for Engineering Applica.docx
1  ECE 175 Computer Programming for Engineering Applica.docx1  ECE 175 Computer Programming for Engineering Applica.docx
1 ECE 175 Computer Programming for Engineering Applica.docxoswald1horne84988
 
1 Assignment #2 MAC 1140 – Spring 2020 – Due Apr.docx
1  Assignment #2 MAC 1140 – Spring 2020 – Due Apr.docx1  Assignment #2 MAC 1140 – Spring 2020 – Due Apr.docx
1 Assignment #2 MAC 1140 – Spring 2020 – Due Apr.docxkarisariddell
 
Integral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewerIntegral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewerJoshuaAgcopra
 
ISI MSQE Entrance Question Paper (2005)
ISI MSQE Entrance Question Paper (2005)ISI MSQE Entrance Question Paper (2005)
ISI MSQE Entrance Question Paper (2005)CrackDSE
 
Stack squeues lists
Stack squeues listsStack squeues lists
Stack squeues listsJames Wong
 
Stacksqueueslists
StacksqueueslistsStacksqueueslists
StacksqueueslistsFraboni Ec
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues listsTony Nguyen
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues listsHarry Potter
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues listsYoung Alista
 

Similar to Programming exercisesn NUMERICAL ANALYSIS (20)

1.2 matlab numerical data
1.2  matlab numerical data1.2  matlab numerical data
1.2 matlab numerical data
 
10.2 using combinations and the binomial theorem
10.2 using combinations and the binomial theorem10.2 using combinations and the binomial theorem
10.2 using combinations and the binomial theorem
 
High-Performance Haskell
High-Performance HaskellHigh-Performance Haskell
High-Performance Haskell
 
The Concurrent Constraint Programming Research Programmes -- Redux (part2)
The Concurrent Constraint Programming Research Programmes -- Redux (part2)The Concurrent Constraint Programming Research Programmes -- Redux (part2)
The Concurrent Constraint Programming Research Programmes -- Redux (part2)
 
A01
A01A01
A01
 
1 ECE 175 Computer Programming for Engineering Applica.docx
1  ECE 175 Computer Programming for Engineering Applica.docx1  ECE 175 Computer Programming for Engineering Applica.docx
1 ECE 175 Computer Programming for Engineering Applica.docx
 
1 Assignment #2 MAC 1140 – Spring 2020 – Due Apr.docx
1  Assignment #2 MAC 1140 – Spring 2020 – Due Apr.docx1  Assignment #2 MAC 1140 – Spring 2020 – Due Apr.docx
1 Assignment #2 MAC 1140 – Spring 2020 – Due Apr.docx
 
Math 116 pres. 5
Math 116 pres. 5Math 116 pres. 5
Math 116 pres. 5
 
Integral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewerIntegral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewer
 
ISI MSQE Entrance Question Paper (2005)
ISI MSQE Entrance Question Paper (2005)ISI MSQE Entrance Question Paper (2005)
ISI MSQE Entrance Question Paper (2005)
 
Factoring
FactoringFactoring
Factoring
 
Introduction to r
Introduction to rIntroduction to r
Introduction to r
 
Stack squeues lists
Stack squeues listsStack squeues lists
Stack squeues lists
 
Stacksqueueslists
StacksqueueslistsStacksqueueslists
Stacksqueueslists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Algorithm Assignment Help
Algorithm Assignment HelpAlgorithm Assignment Help
Algorithm Assignment Help
 
Lec5
Lec5Lec5
Lec5
 

Recently uploaded

Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 

Recently uploaded (20)

Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 

Programming exercisesn NUMERICAL ANALYSIS

  • 1. Programming Exercises Write a computer program in C++/ Matlab. Refresher Exercises: 1) Find the arithmetic mean, median, mode and standard deviation of 𝑥1, 𝑥2, … , 𝑥 𝑛. (Remember in median you have to first sort the data in ascending or descending order and then median is middle most value in case of odd number values and median is average of two middle values in case of even number of values) 2) Find the sum 1 10 + 1 10 + ⋯ + 1 10 up to1000, 10000, 100000, 1000000 times. 3) Find the sum of the series 1 + 1 2 + 1 3 + ⋯ + 1 𝑛 (Input different values of 𝑛 preferable large 𝑛 and check whether the sum of the series converges or not) 4) Find the sum of the series 1 + 1 2! + 1 3! + ⋯ + 1 𝑛! (Input different values of 𝑛 preferable large 𝑛 and check the sum of the series converges or not) 5) Numerically compute the following series 1 − 1 3 + 1 5 − 1 7 + 1 9 … Hint: First find the general term of the series and then input different values of 𝑛 to investigate the sum of the series. 6) Assuming that sin(x) and cos(x) are not available in your programming language compiler. Develop your own sin (x) and cos(x) using sin 𝑥 = 𝑥 − 𝑥3 3! + 𝑥5 5! − 𝑥7 7! + 𝑥9 9! … + (−1)2𝑛+1 𝑥2𝑛+1 (2𝑛 + 1)! cos 𝑥 = 1 − 𝑥2 2! + 𝑥4 4! − 𝑥6 7! + 𝑥8 8! … + (−1) 𝑛 𝑥2𝑛 (2𝑛)! (You should decide number of term i.e. 𝑛 to be evaluate by your choice or you may ask from the user and 𝑥 should be decided by user. ) For example sin 1 ≈ 1 − 1 3! + 1 5! − 1 7! + 1 9! (Choosing 𝑛 = 4) 7) Find the GCD i.e. greatest common divisor and LCM i.e. least common multiple of two numbers 𝑎 and 𝑏. Hence generalize it to find the GCD and LCM of 𝑛 numbers. 8) Solve the 2𝑥2 system of linear equations by eliminating one of variable and Gaussian Elimination method 𝑎11 𝑥1 + 𝑎12 𝑥2 = 𝑏1 𝑎21 𝑥1 + 𝑎22 𝑥2 = 𝑏2