PIXELBANKv8.2.1
Menu

Verify Eigenvector

Implement a function to verify if a given vector is an eigenvector of a matrix with a specified eigenvalue. This concept is crucial in linear algebra as eigenvectors represent directions in which a matrix transformation scales a vector by a factor, known as the eigenvalue. The equation Av=λvA\mathbf{v} = \lambda\mathbf{v} represents this relationship, where AA is the matrix, v\mathbf{v} is the eigenvector, and λ\lambda is the eigenvalue.

To verify if v\mathbf{v} is an eigenvector of AA with eigenvalue λ\lambda, we need to check if the matrix AA transforms v\mathbf{v} into a scaled version of itself. Here are the steps:

  1. Compute the product of AA and v\mathbf{v}.
  2. Compute the product of λ\lambda and v\mathbf{v}.
  3. Compare the results to determine if they are equal.
Av=λvA\mathbf{v} = \lambda\mathbf{v}

This technique is widely used in computer vision for image compression and dimensionality reduction.

Example:

Input:
is_eigenvector([[2, 0], [0, 3]], [1, 0], 2)
Output:
True
Reasoning:

A @ [1, 0] = [2, 0] = 2 × [1, 0]

Constraints:

  • A is a square matrix (n×n) where 1 ≤ n ≤ 10
  • v is a non-zero vector of length n
  • λ is a scalar
  • Use tolerance of 1e-6 for floating-point comparison
Editor

Test Results

0/0
Run code to see test results.