Introduction to Programming Lecture # 43. Math Library Complex number Matrix Quadratic equation and their solution …………….…

Slides:



Advertisements
Similar presentations
Section 13-4: Matrix Multiplication
Advertisements

Matrices A matrix is a rectangular array of quantities (numbers, expressions or function), arranged in m rows and n columns x 3y.
Mathematics. Matrices and Determinants-1 Session.
Matrices & Systems of Linear Equations
Maths for Computer Graphics
Matrices. Special Matrices Matrix Addition and Subtraction Example.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 12 System of Linear Equations.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 14 Elimination Methods.
Chapter 2 Matrices Definition of a matrix.
Matrices and Determinants
Matrices The Basics Vocabulary and basic concepts.
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
CE 311 K - Introduction to Computer Methods Daene C. McKinney
Notes Over 5.4 Imaginary Numbers.
Algebra 2: Lesson 5 Using Matrices to Organize Data and Solve Problems.
Chapter 2 Solving Linear Systems Matrix Definitions –Matrix--- Rectangular array/ block of numbers. –The size/order/dimension of a matrix: (The numbers.
ECON 1150 Matrix Operations Special Matrices
Chapter 4 Matrices By: Matt Raimondi.
4.1 Matrix Operations What you should learn: Goal1 Goal2 Add and subtract matrices, multiply a matrix by a scalar, and solve the matrix equations. Use.
Matrices. A matrix, A, is a rectangular collection of numbers. A matrix with “m” rows and “n” columns is said to have order m x n. Each entry, or element,
Matrices Addition & Subtraction Scalar Multiplication & Multiplication Determinants Inverses Solving Systems – 2x2 & 3x3 Cramer’s Rule.
Matrix Arithmetic. A matrix M is an array of cell entries (m row,column ) and it must have rectangular dimensions (Rows x Columns). Example: 3x x.
Matrix Algebra and Regression a matrix is a rectangular array of elements m=#rows, n=#columns  m x n a single value is called a ‘scalar’ a single row.
Matrices A matrix is a table or array of numbers arranged in rows and columns The order of a matrix is given by stating its dimensions. This is known as.
AIM: How do we perform basic matrix operations? DO NOW:  Describe the steps for solving a system of Inequalities  How do you know which region is shaded?
Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”
Lesson 11-1 Matrix Basics and Augmented Matrices Objective: To learn to solve systems of linear equation using matrices.
Prepared by Deluar Jahan Moloy Lecturer Northern University Bangladesh
Chapter 6 Matrices and Determinants Copyright © 2014, 2010, 2007 Pearson Education, Inc Matrix Operations and Their Applications.
Meeting 18 Matrix Operations. Matrix If A is an m x n matrix - that is, a matrix with m rows and n columns – then the scalar entry in the i th row and.
Slide Copyright © 2009 Pearson Education, Inc. 7.3 Matrices.
3.4 Solution by Matrices. What is a Matrix? matrix A matrix is a rectangular array of numbers.
Unit 3 Matrix Arithmetic IT Disicipline ITD 1111 Discrete Mathematics & Statistics STDTLP 1 Unit 3 Matrix Arithmetic.
MT411 Robotic Engineering Asian Institution of Technology (AIT) Chapter 1 Introduction to Matrix Narong Aphiratsakun, D.Eng.
Copyright © Cengage Learning. All rights reserved. 2 SYSTEMS OF LINEAR EQUATIONS AND MATRICES.
Matrices Digital Lesson. Copyright © by Houghton Mifflin Company, Inc. All rights reserved. 2 A matrix is a rectangular array of real numbers. Each entry.
Matrices and Determinants
MATRIX A set of numbers arranged in rows and columns enclosed in round or square brackets is called a matrix. The order of a matrix gives the number of.
MULTI-DIMENSIONAL ARRAYS 1. Multi-dimensional Arrays The types of arrays discussed so far are all linear arrays. That is, they all dealt with a single.
Linear System of Simultaneous Equations Warm UP First precinct: 6 arrests last week equally divided between felonies and misdemeanors. Second precinct:
Do Now: Perform the indicated operation. 1.). Algebra II Elements 11.1: Matrix Operations HW: HW: p.590 (16-36 even, 37, 44, 46)
Where do you sit?. What is a matrix? How do you classify matrices? How do you identify elements of a matrix?
Designed by Victor Help you improve MATRICES Let Maths take you Further… Know how to write a Matrix, Know what is Order of Matrices,
Matrix Algebra Definitions Operations Matrix algebra is a means of making calculations upon arrays of numbers (or data). Most data sets are matrix-type.
§9-3 Matrix Operations. Matrix Notation The matrix has 2 rows and 3 columns.
Matrices. Variety of engineering problems lead to the need to solve systems of linear equations matrixcolumn vectors.
2.3 MODELING REAL WORLD DATA WITH MATRICES By the end of the section students will be able to add, subtract, and multiply matrices of various sizes. Students.
Matrices. Matrix A matrix is an ordered rectangular array of numbers. The entry in the i th row and j th column is denoted by a ij. Ex. 4 Columns 3 Rows.
Lesson 43: Working with Matrices: Multiplication
12-1 Organizing Data Using Matrices
Multiplying Matrices.
Matrix Operations Monday, August 06, 2018.
Matrix Operations.
Evaluating Determinants by Row Reduction
Matrix Operations SpringSemester 2017.
Warm Up Use scalar multiplication to evaluate the following:
Multiplying Matrices.
7.3 Matrices.
2.2 Introduction to Matrices
Multiplying Matrices.
1.8 Matrices.
Matrix Operations Ms. Olifer.
What is the dimension of the matrix below?
Matrix Operations SpringSemester 2017.
1.8 Matrices.
Multiplying Matrices.
3.5 Perform Basic Matrix Operations Algebra II.
Multiplying Matrices.
Introduction to Matrices
Multiplying Matrices.
Presentation transcript:

Introduction to Programming Lecture # 43

Math Library Complex number Matrix Quadratic equation and their solution …………….…

Design Recipe To design a program properly, we must : To design a program properly, we must : –Analyze a problem statement, typically expressed as a word problem expressed as a word problem –Express its essence, abstractly and with examples examples –Formulate statements and comments in a precise language i.e. code precise language i.e. code –Evaluate and revise the activities in light of checks and tests and –PAY ATTENTION TO DETAIL

Matrix Matrix is nothing but a two dimensional array of numbers Normally, represented in the form of : Rows Columns

Example A = Three Rows Four Columns

i & j are two Integers i representing the Row number j representing the Column number

Operations Performed with Matrix Addition of two matrices. Addition of a scalar and a matrix Subtraction of two matrices Subtraction of a scalar from a matrix Multiplication of two matrices Multiplication of a scalar with a matrix Division of a scalar with a matrix Transpose of a matrix

Interface

Addition of two Matrices A ij + B C =

Size of two matrices must be same Number of rows and columns must be identical for the matrices to be addable Addition of two Matrices

Example = A ij - B C =

Ordinary number added to every element of the matrix Adding a Scalar to the Matrix

Ordinary number subtracted from every element of the matrix Subtracting a Scalar from a Matrix

Divide every element of Matrix by a scalar number Division of Matrix by a Scalar

Example Let : X be a Scalar number A be a Matrix A ij C = X

Multiplication of a scalar with a Matrix : Example Let : X is a Scalar number A is a Matrix A ij C = X * X * A

Multiply two Matrices = * ( 1 ) ( 2 ) + ( 2 ) ( 1 )( 1 ) ( 4 ) + ( 2 ) ( 2 ) ( 5 ) ( 2 ) + ( 6 ) ( 1 ) ( 5 ) ( 4 ) + ( 6 ) ( 2 )

Number of columns of the 1 st Matrix = Number of rows of the 2nd Matrix Rules Regarding Matrix Multiplication

Rules regarding Matrix Multiplication First matrix has First matrix has –M rows –N columns Second matrix has Second matrix has –N rows –P columns Resultant matrix will have Resultant matrix will have –M rows –P columns

Transpose of a Matrix Interchange of rows and columns

Transpose of a Matrix Example

Transpose of a Non Square Matrix A A T 3 ( Rows ) * 4 ( Columns ) Before 4 ( Rows ) * 3 ( Columns ) After Size of matrix change after transpose

Next Phase of Analysis Determine the Constants Memory Allocation What is it’s user interface

Interface

Interface Constructor : Parameters are Number of rows Number of rows Number of columns Number of columns Display function Plus operator : member operator of the class Subtraction operator : member operator of the class Plus operator : friend of the class Subtraction operator : friend of the class

Plus Operator A + X X + A

Subtraction Operator A - X X – A

*

Interface Multiplication Operator : Member of the Class Multiplication Operator : Friend of the Class Division Operator : Member of the Class Transpose Function : Member of the Class Assignment Operator : Member of the Class +=, -= : Members of the Class

Multiplication Operator A * X X * A

Assignment Operator A = BA = B ( Member Operator )

>> Extraction Operator : Friend Operator << Stream Insertion Operator : Friend Operator Interface

Copy Constructor

Copy Constructor Copy Constructor Assignment Operator Assignment Operator Memory Allocation Memory Allocation Memory Deallocation Memory Deallocation