WalzoneInterview Prep
📞 Interviewing soon? Practice with a realistic AI mock phone interview — it calls you, then scores you. First 15 min FREE →

Wall Street Quant · Linear Algebra · question 74 of 155

What is a tensor and how is it different from a matrix?

📕 Buy this interview preparation book: 155 Wall Street Quant questions & answers — PDF + EPUB for $5

A tensor is a mathematical object that is a generalization of scalars, vectors, and matrices. It is defined as an arrangement of numbers in multiple dimensions, organized based on its order (or rank). The order of a tensor reflects the number of indices needed to specify an element within it.

Let’s break down the different orders of tensors.

- Scalar: A scalar is a single number, which is considered as a rank-0 tensor.

- Vector: A vector is an array of numbers, where each number has one index position. Vectors are considered rank-1 tensors.

- Matrix: A matrix is a 2D array of numbers, organized in rows and columns. Each element in the matrix has two indices (row index and column index). A matrix is a rank-2 tensor.

As we go to higher dimensions, we get higher-order tensors. A rank-3 tensor would be a 3D array of numbers, where each element would have three indices (e.g., a 3D matrix of size n x m x k). A rank-4 tensor would have four indices, and so on.

The main difference between a matrix (rank-2 tensor) and a more general tensor is the number of indices required to access their elements. A matrix only needs two indices (row and column), whereas a higher-order tensor requires more indices, based on its rank.

In terms of notation, matrices are usually denoted using capital letters (like A, B, C), and tensors are denoted using capital letter and a higher-order index, like Tijk for a rank-3 tensor. The elements of a matrix are typically denoted by lowercase letters with two indices, like aij, while the elements of a higher-order tensor would have more indices depending on its rank, such as tijk for a rank-3 tensor.

The mathematical operations involving tensors are more complex, as they include higher-order generalizations of matrix operations like the summations, products, contractions, and more.

It’s important to note that tensors can also be used to represent linear transformations of a vector space. In the case of a matrix (a rank-2 tensor), it can represent a linear transformation between two vector spaces. For example, if A is an m x n matrix, it can transform vectors from Rn (column space) to Rm (row space) using the matrix-vector product.

In summary, a tensor is a generalization of scalars, vectors, and matrices, whose main difference lies in their additional indices and flexibility to represent higher-dimensional data and transformations.

Reading is step one. Saying it out loud is the interview. Our AI interviewer calls your phone and runs a realistic Wall Street Quant interview — then scores it.
📞 Practice Wall Street Quant — free 15 min
📕 Buy this interview preparation book: 155 Wall Street Quant questions & answers — PDF + EPUB for $5

All 155 Wall Street Quant questions · All topics