Problem Statement Write a program that solves for Z = A*X + B, where A X and B are input matrices. The output is a matrix Z. Round your output to one decimal place.

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

hi! i am a newbie in python. please help me on this problem. also, please send a screenshot for a proof that the codes works. thanks~

 

78 9
Problem Statement
Write a program that solves for Z = A*X + B, where A X and B are input matrices. The output is a matrix Z. Round your output to one decimal place.
Hint
•
Python 3 has a buit-in function round that takes two numbers: the number to be rounded, and the number of decimal places to include. Use this function for rounding results.
When getting input per line, use the method split().Do not put any argument so that by default, the separator to be used will be any whitespace and empty strings from the
resulting list will be discarded.
Input
• Sze of matrix A. The format is m, n, where m is the number of rows and n is the number of columns of A.
followed by the values for matrix A. One row corresponds to one row in matrix A. Column values for each row are delimited by a whitespace.
Size of matrix X. The format is n, P. where n is the number of rows and p is the number of columns of X.
• followed by the values for matrix X. One row corresponds to one row in matrix X. Column values for each row are delimited by a whitespace.
• Sze of matrix B. The format is m, p, where m is the number of rows and p is the number of columns of B.
• followed by the values for matrix B. One row corresponds to one row in matrix B. Column values for each row are delimited by a whitespace.
Constraints
You can assume that the values are float. You can assume that the size of the matrices are valid for the matrix operation involved.
Output
• Values for matrix Z. One row corresponds to one row in matrix Z. Column values for each row are delimited by a whitespace.
Sample Input 1
Copy
2,3
123
45 6
3.3
3,3
3,3
7 8 9
10 11 12
13 14 15
2,3
53 2.1
11 2.3 1
Sample Output 1
Copy
71.0 75.0 8e.1
167.0 173.3 187.0
Sample Input 2
Copy
1,2
4 5
2,2
11
11
1,2
2 3.1
Sample Output 2
Соpy
11.0 12.1
Transcribed Image Text:78 9 Problem Statement Write a program that solves for Z = A*X + B, where A X and B are input matrices. The output is a matrix Z. Round your output to one decimal place. Hint • Python 3 has a buit-in function round that takes two numbers: the number to be rounded, and the number of decimal places to include. Use this function for rounding results. When getting input per line, use the method split().Do not put any argument so that by default, the separator to be used will be any whitespace and empty strings from the resulting list will be discarded. Input • Sze of matrix A. The format is m, n, where m is the number of rows and n is the number of columns of A. followed by the values for matrix A. One row corresponds to one row in matrix A. Column values for each row are delimited by a whitespace. Size of matrix X. The format is n, P. where n is the number of rows and p is the number of columns of X. • followed by the values for matrix X. One row corresponds to one row in matrix X. Column values for each row are delimited by a whitespace. • Sze of matrix B. The format is m, p, where m is the number of rows and p is the number of columns of B. • followed by the values for matrix B. One row corresponds to one row in matrix B. Column values for each row are delimited by a whitespace. Constraints You can assume that the values are float. You can assume that the size of the matrices are valid for the matrix operation involved. Output • Values for matrix Z. One row corresponds to one row in matrix Z. Column values for each row are delimited by a whitespace. Sample Input 1 Copy 2,3 123 45 6 3.3 3,3 3,3 7 8 9 10 11 12 13 14 15 2,3 53 2.1 11 2.3 1 Sample Output 1 Copy 71.0 75.0 8e.1 167.0 173.3 187.0 Sample Input 2 Copy 1,2 4 5 2,2 11 11 1,2 2 3.1 Sample Output 2 Соpy 11.0 12.1
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Array
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.
Similar questions
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