\chapter{Variables and constants}

Often in mathematics, we are looking for a number that satisfies a problem that we have. For example, imagine you have 10 chocolates; you give 2 to your sister and you share the rest evenly amongst you and your 3 friends (so, amongst 4 people including yourself); how many chocolates did you keep?
Algebra gives not just a notation to describe these problems, but also methods to solve them. Before tackling such problems, we will develop the notatiof algebra; variables and constants.


\section{Variables}

Consider a room of people. It's impossible for there to be a negative amount of people in the room, and you cannot have a fractional amount of people in the room, so the amount of people in the room must be a nonnegative whole number. Without knowing the exact number of people in the room, one still knows that the number must nonnegative and whole; although it is dissapointing that we can't bring this quantity down to a solid number, it might be useful to have some way to refer to it. This is precisely the power that variables offer!


\begin{definition}[Variable]
A \emph{variable} is a symbol that represents number whose value is unknown.
\end{definition}

In the previous example, we could let $p$ be the amount of people in the room. Now that the power of variables has assigned a symbol to this quantity, some mathematical statements can be said about it, even though the number of people is unknown! For example, it is known that $p \geq 0$ since a negative amount of people is impossible.

If some 'gossip' revealing information about how many people are in the room comes to light, the power of variables may even allow for that number to be deduced!



\begin{example}
Let $n$ represent an integer.
Let $\theta$ represent an angle. 
\end{example}


To make variables easier to read, people often use a certain set of symbols for variables of certain types of numbers. There is nothing stopping you from using the symbol $#$ to represent an unknown integer, but conventionally authors tend to consistently use $n$, $m$ for integers so that any reader familiar with variable naming convention can get the 'feeling' of $n$ acting like an integer.

To see what variable naming conventions are used by mathematicians, check the following Wikipedia page:
\url{https://en.wikipedia.org/wiki/Variable_(mathematics)#Conventional_variable_names}




\section{Constants}

\begin{definition}
A \emph{constant} is a symbol that represent some fixed, known number.
\end{definition}

\begin{example}
'$6502$' is the constant for the 6502th number.
'$\pi$' is the constant for Archimedes' constant, the number  $3.141592653589...$, so $\pi=3.141592653589...$.
'$\gamma$' is the constant for the Euler-Mascheroni constant, the number $0.57721...$, so $\gamma=0.57721...$.
\end{example}

Let's make up our own random constant, it won't be universally recognized like the last 2 examples, but for the next 10 seconds while you read this example, it will mean something.

\begin{example}
I can make '$n$' a constant for my favourite number, $64$, in other words, $n=64$. This means $n+6=70$.
\end{example}


One can also think of a constant as a variable whose value has 'finally been found'. The convention for naming variables is the same as the convention for naming short terms constants, so if you have a fixed angle of $45\degree$ that constantly shows up in your work, perhaps you'll create the constant $\theta=45\degree$.

\section{Coefficients}

There is a particularly convenient notation for multiplication with variables and constants of non-numeric symbols.

Consider two variables $x,y$. To represent multiplying $x$ by $y$, one writes:
\begin{example}
$x$ multiplied by $y$ is $xy$ or $yx$.
$x$ multiplied by $2$ is $2x$.
$2$ multiplied by $\pi$ is $2\pi$.
\end{example}

Numeric symbols are conventionally written before non-numeric symbols (recall that the result of multiplication is irrespective of the order), so writing $x2$ and $\pi2$ is conventionally discouraged.

In the case of multiplying one variable with a constant, the variable is called the \emph{pronumeral} and the constant is the \emph{coefficient}.

\begin{example}
For $2x$, $2$ is the coefficient and $x$ is the variable.
For $2\pi n$, $2\pi$ is the coefficient and $n$ is the variable.
\end{example}

