SlideShare ist ein Scribd-Unternehmen logo
1 von 1
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

Andere mochten auch (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
 

Ähnlich wie 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 listsYoung Alista
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues listsTony Nguyen
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues listsHarry Potter
 

Ähnlich wie 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
 

Kürzlich hochgeladen

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
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
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
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
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
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Kürzlich hochgeladen (20)

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
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
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 )
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
★ 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
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
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
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 

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