# Computing - Vectors

> Source: https://ollybritton.com/notes/a-level/computing/topics/vectors/ · Updated: 2020-11-09 · Tags: computing, fundementals-of-data-structures

##### What is a vector an example of??
An Abstract Data Type

##### What set do all $2$-d vectors come from??
$$
\mathbb{R}^2
$$

##### What set do all $3$-d vectors come from??
$$
\mathbb{R}^3
$$

##### What's an example of where a $2$-d vector could be used??
To describe a path.

##### What does the notation $S \to \mathbb{R}$ mean??
$S$ maps to $\mathbb{R}$.

##### What is the notation $0 \to 1.5$ mean in terms of vectors??
$0$ maps to $1.5$.

##### What is the most common representation for a vector??
A list.

##### What would be the python code to represent the vector $[1, 2]$??
```
vec = [1,2]
```

##### How could you view a vector as a function??
It takes sequential input values like $0,1,2,3$ and converts them into other values like $-1.3, 3.4, 5.8, 4.2$.

##### Other than a list, how could you represent a vector??
* As a map
* As a function

##### What is the convex combination of two vectors??
The space bounded by the triangle formed by joining the vectors with a line.

##### If you have two vectors $u$ and $v$, how could you describe their conex combination??
$$
w = \alpha u + \beta v
$$

$$
\text{where} \quad \alpha, \beta >= 0 \quad \text{and} \quad \alpha + \beta = 1
$$

##### What is the dot product of two vectors??
The value formed by multipling all the matching elements of a vector and adding them.

##### How can you think of the dot product of two vectors??
The multiplication of a single row and a single column matrix.

##### What does $u \cdot v$??
The dot product of $u$ and $v$.

##### What are the 4 operations on a vector at A-level??
* Addition
* Multiplication
* Dot product
* Convex combination

---
Olly Britton — https://ollybritton.com. Machine-readable index: https://ollybritton.com/llms.txt
