﻿ Scalar Matrix Multiplication
HOME Mathematics Computer Science
Scalar Matrix Multiplication
Prerequisites
Show All
Hide All
Matrices
Show/Hide
﻿
Definition
A matrix is a rectangular group of numbers (or symbols) with a given number of rows and columns.
Example

The following matrix has two rows and three columns, and is described as a "two by three" (2x3) matrix.

LaTeX
\begin{bmatrix}
3 & 6 & 2  \\
5 & 1 & 10
\end{bmatrix}

Notation
• There are a few different ways to represent a matrix. The easiest is with an bold uppercase letter: A
Code
A = [[3, 6, 2], [5, 1, 10]]

print(A)

Notes
• The plural of matrix is matrices.
• The size of a matrix is called its dimension or order. It is written with as rows x columns. A matrix with 2 rows and 3 columns is written as 2x3.
• Two matrices are considered equal if and only if:
• They have the same number of rows.
• They have the same number of columns.
• Each corresponding element is equal. i.e. x111 = x211
• The numpy.matrix is depreciated, in favour of regular arrays

Scalar Matrix Multiplication
﻿
Introduction
• There are two ways to multiply matrices; either by a number, or by another matrix.
• Scalar Multiplication is the the first of these, multiplying a matrix by a number.
• To multiply a matrix by a number, you multiply each element by that number.
Mathematical Definition
Example
Code
import numpy as np

a = [[3, 6, 2], [5, 1, 10]]

c = np.multiply(a, 4)
print(c)

Notes
• The resulting matrix of the multiplication is called a 'Scalar Multiple'.