• provide a basic menu system to allow the user to: - Enter and store the data for a 3 x 3 matrix - Find and display the sum of two 3 x 3 matrices - Find and display the scalar product of a 3 x 3 matrix - Find and display the product of two 3 × 3 matrices - Exit the program in a controlled manner • all code must be appropriately commented

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

First image is introduction,second is task

Matrix Multiplication
Besides adding matrices, there are many situations where we need to find the product of a matrix. We
will look at two types of matrix multiplication, scalar multiplication of a matrix and the product of two
matrices.
Scalar Multiplication
The process of scalar multiplication involves multiplying each entry in a matrix by a constant, called a
scalar. A scalar is a real number quantity that has magnitude but not direction, e.g. time, temperature
and distance are all examples of scalar quantities.
Scalar multiplication can be performed with a matrix of any dimension as each individual item in the
matrix is multiplied by the scalar value.
General Case:
Multiply the matrix A by the scalar value x:
A =
a2,1 a2,2
x.a1,1 x.a1,2
|x.а21 х.а22
х.А —
Product of two matrices
Finding the product of two matrices involves multiplying one matrix by another matrix.
It is only possible when the number of columns in the first matrix is equal to the number of rows in the
second matrix, nĄ = mg.
General Case:
a1,1 a1,2
b1,1 b1,2
A =
B =
а2,1 а2,2
b2,1 b22
a1,1.b1,1 + a1,2.b2,1 a1,1.b1,2 + a1,2.b2,2
a2,1.b1.1 + a22.b2,1 a2,1.b1,2 + a2,2.b2,2
AB =
Transcribed Image Text:Matrix Multiplication Besides adding matrices, there are many situations where we need to find the product of a matrix. We will look at two types of matrix multiplication, scalar multiplication of a matrix and the product of two matrices. Scalar Multiplication The process of scalar multiplication involves multiplying each entry in a matrix by a constant, called a scalar. A scalar is a real number quantity that has magnitude but not direction, e.g. time, temperature and distance are all examples of scalar quantities. Scalar multiplication can be performed with a matrix of any dimension as each individual item in the matrix is multiplied by the scalar value. General Case: Multiply the matrix A by the scalar value x: A = a2,1 a2,2 x.a1,1 x.a1,2 |x.а21 х.а22 х.А — Product of two matrices Finding the product of two matrices involves multiplying one matrix by another matrix. It is only possible when the number of columns in the first matrix is equal to the number of rows in the second matrix, nĄ = mg. General Case: a1,1 a1,2 b1,1 b1,2 A = B = а2,1 а2,2 b2,1 b22 a1,1.b1,1 + a1,2.b2,1 a1,1.b1,2 + a1,2.b2,2 a2,1.b1.1 + a22.b2,1 a2,1.b1,2 + a2,2.b2,2 AB =
Your Task
Create structured, commented Python 3 code to implement the matrix operations above for any
3 x 3 matrix.
Additionally, the minimum specification below must be met:
• be console/text-based
• use nested lists and loops
• include user defined functions
• provide a basic menu system to allow the user to:
- Enter and store the data for a 3 x 3 matrix
- Find and display the sum of two 3 x 3 matrices
- Find and display the scalar product of a 3 x 3 matrix
- Find and display the product of two 3 x 3 matrices
- Exit the program in a controlled manner
• all code must be appropriately commented
The task can be broken down as follows:
1. Create structured, commented Python 3 code to implement the matrix operation algorithms to
the given specification.
2. Conduct appropriate testing to ensure your code works for any 3 x 3 matrix.
3. Write a technical document using the LaTeX template provided, which explains the operation of
your code, and which includes your code listing as an appendix.
Transcribed Image Text:Your Task Create structured, commented Python 3 code to implement the matrix operations above for any 3 x 3 matrix. Additionally, the minimum specification below must be met: • be console/text-based • use nested lists and loops • include user defined functions • provide a basic menu system to allow the user to: - Enter and store the data for a 3 x 3 matrix - Find and display the sum of two 3 x 3 matrices - Find and display the scalar product of a 3 x 3 matrix - Find and display the product of two 3 x 3 matrices - Exit the program in a controlled manner • all code must be appropriately commented The task can be broken down as follows: 1. Create structured, commented Python 3 code to implement the matrix operation algorithms to the given specification. 2. Conduct appropriate testing to ensure your code works for any 3 x 3 matrix. 3. Write a technical document using the LaTeX template provided, which explains the operation of your code, and which includes your code listing as an appendix.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Rendering
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education