Jupyter notebook 2017-01-24-174717/Chapter 1 - Complex Numbers.ipynb
Chapter 1 - Complex Numbers
Section 1: Basic Definitions
Complex numbers have their origin in the theory of algebraic equations (or polynomials). It became apparent that in plenty of cases, no solution existed among the usual set of numbers (positive numbers, natural numbers, integers, rational numbers, real numbers). A simple example is below:
Indeed, any possible as we know it would be a positive number or zero. Since here we want to be -1, we are stuck!
One option would be to just give up on finding a solution! But failure is not an option at least for mathematicians. Before discussing the new system that mathematicians came up with, let's remind ourselves of the existing set of numbers,
Positive numbers:
Natural numbers:
Integers:
Rational numbers:
Real numbers:
None of these familiar systems have a solution for . In a desparate attempt to find a solution, we define a new number, denoted by (usually ) such that,
or
We know that such a number does not exist amongst real numbers and hence we call it an imaginary number. Aside from the strange behavior that square of is -1, it behaves like any regular number. Let's do some exercises:
Example 1.1
What is the value of ? We could do
Or we could do it in code as shown below
Exercise 1.1 (30 points)
Simplify these analytically and then verify with code
a. , , , , and
b. , , and
= 1
== == == 1
== == ==
== == == -1
== == == -
== == == == 1
== *
2 points per simplification done analytically and additional 1 point for verifying it with code.
We can also multiply with another number, for example . These numbers are called .
We can, in fact, add a real number and an imaginary number, for instance , and you get a number that is neither real nor imaginary. Such a "hybrid" number is called a .
Definition 1: Complex Number
A complex number is an expression , where a, b are two real numbers; a is called the real part of c, whereas b is its imaginary part. The set of all complex numbers will be denoted by . When the is understood, it is omitted from writing.
Example 1.2
Let and . We want to compute and
Exercise 1.2 (20 points)
Now instead of using builtin functions to add and multiply complex numbers, write your own functions. The functions must take as inputs two complex numbers.
Exercise 1.3 (16 points)
Calculate and using the functions you just created. Verify your results against the ones you get from builtin functions.
a. and
b. and
c. and
d. and
e. and
f. and
g. and
h. and
2 points each for computation and verification
Fundamental Theorem of Algebra
Every polynomial equation of one variable with complex coefficients has a complex solution
Exercise 1.4 (9 points)
Verify the following:
a. is a solution to the polynomial equation .
b. is a solution to the polynomial equation .
c. is a solution to polynomial equation .
Section 2. The Algebra of Complex Numbers
To understand complex numbers better we will soon discuss their geometrical interpretation. However, before we can do that, we'll write complex numbers as a tuple of values made up of two real numbers.
We know that is made up of a real part and an imaginary part . We can therefore redefine the complex number as an ordered pair of reals:
Therefore, ordinary real numbers can be identified with pairs . As a result,
whereas imaginary numbers will be pairs . In particular,
is rather obvious: it adds pairs componentwise:
is little trickier:
Let's see if the multiplication formula above works:
Using addition and multiplication, we can write any complex number in the usual form:
In summary, we have traded one oddity for another: was previously quite mysterious, whereas now it is just and we can essentially forget about .
Therefore, a complex number is nothing more than just an ordered pair of ordinary real numbers!
Example 2.1
Let and . Let us multiply them using the aforementioned rule:
Exercise 2.1 (15 + 4 points)
Write a function to multiply two complex numbers using the tuple format and give the result in a tuple format. Compute the product of,
a. and
b. and
c. and
d. and
15 points for the program and 1 point each for the computation
So far we have a set of numbers and two operations: addition and multiplication. Both operations are , meaning that for arbitrary complex numbers and ,
and
Both operations are also :
and
Exercise 2.2 (15 + 3 points)
Verify that multiplication of complex numbers is associative for the following:
a. , and
b. , and
c. , and
15 points for the program and 1 point each for the computation
Lastly, multiplication over addition: for all , we have,
Exercise 2.3 (15 + 3 points)
Verify the property that multiplication distributes over addition for the following,
a. , and
b. , and
c. , and
15 points for the program and 1 point each for the computation
Having discussed addition and multiplication, we now discuss their complementary operations: subtraction and division
is straight forward and defined componentwise:
is somewhat involved. We want to compute,
After some simple substitutions and computations we get,
and
Note that both and are calculated using the same denominator, namely, . We will discuss this quantity soon.
Example 2.2
Let and . We will compute . In this case, , , , and . Therefore,
The answer then is
Exercise 2.4 (15 + 3 points)
Write a function to calculate ,
a. and
b. and
c. and
15 points for the program and 1 point each for the computation
Let us go back to discuss the denominator of our division operation above.
Real numbers have a unary operation called the given by,
This operation is generalized in the complex domain as follows,
This quantity is known as the of a complex number.
Example 2.3
What is the modulus of ?
Exercise 2.5 (10 + 5 points)
Write a function to compute the modulus of the following,
a.
b.
c.
d.
e.
10 points for the program and 1 point each for the computation
Exercise 2.6 (15 points)
Write code to verify that given two arbitrary complex numbers and , the following equality always holds:
For a complex number , . Therefore, is called the additive identity.
For a complex number , . Therefore, is called the multiplicative identity.
In summary, we have defined a new set of number , with four operations and the following properties,
Additition is commutative and associative.
Multiplication is commutative and associative.
Addition has an identity: (0,0).
Multiplication has an identity: (1,0).
Multiplication distributes with respect to addition.
Subtraction (i.e. the inverse of addition) is defined everywhere.
Divistion (i.e. the inverse of multiplication) is defined everywhere, except when the divisor is zero.
A set of numbers satisfying all the above properties is called a . Therefore, is a field, just like , the field of real numbers.
Conjugation
Changing the sign of the imaginary part only is known as . If is an arbitrary complex number, then the conjugate of is . Two numbers related by conjugation are said to be of each other.
Exercise 2.7 (10 points)
Write a function to compute the complex conjugate of a complex number.
Exercise 2.8 (20 points)
Write code to verify the following properties of conjugation:
Note that . Therefore, the of a complex number can be obtained by multiplying the number with its conjugate. For example, .
Exercise 2.9 (15 points)
Write a function to compute modulus of a complex number using the above property.