## Description

Consider the matrix

(1)The rows of A form a basis for $\mathbb{R}^3$, but not an orthogonal basis. We can use the rows of $A$ to generate an orthogonal basis using the `gram_schmidt()` method. The method returns a tuple containing two matrices $G$ and $M$: G is a matrix where each row is an element in the orthogonal set generated by the process, and M is a matrix where each row is the coefficients of the linear combination of the rows of the first matrix to generate the corresponding row in $A$. In other words, $MG = A$

## Sage Cell

#### Code

```
A = matrix(QQ, [[1, 2, 3], [4, 5, 6], [7, 8, 10]])
A.gram_schmidt()
```

## Options

#### Creating an Orthonormal Basis

The method has an option for creating an orthonormal basis instead of a simply orthogonal one. To accomplish this, we simply set the `orthonormal` argument to `True` when calling the method. Since this procedure usually involves irrational square roots, we'll define the matrix $A$ to be over `RDF`, Sage's double precision real number field.

#### Code

```
A = matrix(RDF, [[1, 2, 3], [4, 5, 6], [7, 8, 10]])
A.gram_schmidt(orthonormal=True)
```

## Tags

Primary Tags:

Secondary Tags:

A list of possible tags can be found at The WeBWorK Open Problem Library. For linear algebra tags see the Curated Courses Project.

## Related Cells

Any related cells go here. Provide a link to the page containing the information about the cell.

## Attribute

Permalink:

Author:

Date: 12 Jun 2020 17:16

Submitted by: Zane Corbiere