Lab 10 :Matrix Multiplication
[TOC]
Problem statement
Write a Python Program to implement Matrix Multiplication
Solution Key
CloudCoder Exercise
http://j.mp/matrixMultiplyCC
Pre-Lab Questions
How to initialize a matrix (5 by 5) so that all its entries are equal to the number 10? What is the one line code for this?
Write a program to test whether the given matrix is a square matrix or not.
Write a program to test whether the given two matrices (say
a
andb
), the matrix product operationa * b
is possible or not.
Post-lab Questions
Bonus 1
Fix the failing test case in the following cyberdojo session - http://j.mp/randomMatrixCD
Use the functions to write a
randomize_matrix
function to generate a square matrix of size 5Is the matrix creation the most efficient? Are you able to create a size of
22000 by 22000
before CyberDojo times out?
Bonus 2
Consider a two-dimensional matrix containing integer entries in which all rows and all columns are sorted in ascending order. For example:
Your task is to write a program that takes a matrix as describe above, and a target integer, and determines if the target integer is present in the matrix.
Related Material
CD Link
http://10.100.8.8/kata/edit/3A77017D5C?avatar=dolphin (Poongothai) http://cyberdojo1.kgfsl.com/kata/edit/F52E98217E?avatar=raccoon (Ashok)
Transpose a matrix
CloudCoder Problem: http://j.mp/stransposeCC and http://j.mp/transposeCC
The video key for it (using visualizer) - http://j.mp/transposeVideoKey
Last updated