## Coordinate Systems – 3D, part 2

Once again, if you want to locate a point in 3-dimensional space, you need 3 numbers. In my last post, the 2-D Cartesian coordinate system (sometimes called the rectangular coordinate system) was extended to 3-D by adding another axis that is perpendicular to the other two axes. A point is then located using the coordinates (x, y, z), (1,β2,3) for example. Here are two more ways to locate a 3-D point that uses the rectangular system as a backdrop.

## Spherical Coordinate System

If you remember in the 2-D scenario, polar coordinates used an angle (π) from the positive x-axis and a distance (r) from the origin to determine the location of a point. And equations to represent a plot of points that satisfied the relationship between these coordinates had r‘s and π’s in them. In 3-D, the spherical coordinate system extends this method.

There are different conventions here but they all use two angles and a distance. The mathematical convention is shown below:

Here, a point is located by an angle from the positive x-axis, π, (like in polar coordinates), an angle from the positive z-axis, π, and a distance, r, from the origin. A point in this system has coordinates (r, π, π). As with polar coordinates, there are curves that are more easily expressed in spherical coordinates. For example, a sphere of radius 4 centred at the origin can be easily expressed in spherical coordinates as r = 4:

There are other conventions for spherical coordinates, one of which you are very familiar with. Locating a point on the earth is typically done with two numbers, longitude and latitude. Longitude is the angle a location is from the agreed reference meridian that runs through Greenwich England, and latitude is its angle from the equator. If the origin is at the earth’s centre with the x-axis going through the reference meridian (called the prime meridian) and the z-axis going through the north pole, longitude is our π, latitude is 90Β° β π, and r is always the radius of the earth.

Another convention is used to locate earth satellites using angles right ascension (similar to longitude) and declination (similar to latitude) from an agreed earth centred coordinate system where the axes are fixed and do not rotate with the earth.

There are other variations of this coordinate system; these are just a few.

## Cylindrical Coordinate System

You can think of the cylindrical coordinate system as the 2D polar system with an added z coordinate:

Different letters/Greek symbols can be used, but they all represent the same system. If you look at the xy plane above, you see that this is just the polar coordinate system that was explained in a previous post. To add the third dimension, just move up z units to the desired point (r, π, z).

Cylindrical coordinates are useful in putting objects that are symmetrical with respect to the z-axis. For example, a cylinder of radius 4 can be easily described with the equation r = 4:

Another example is a cone: z = r:

Switching between rectangular, spherical, and cylindrical coordinates is a useful tool in calculus. An equation expressed in one of these systems may be unsolvable but solvable in a different system.

In my next post, I’ll describe a sneaky way to locate a point in 2 or 3-D with one number: parametric equations.

## Coordinate Systems – 3D, part 1

Since we live in a 3 dimensional world, many problems we encounter in fields such as science and engineering, as well as others, are modelled mathematically using 3 variables, hence, 3D.

The first coordinate system introduced to students to handle 3 variables is an extension of the 2D Cartesian coordinate system. If another number line is added to the 2D system that is 90Β° t0 the previous 2 axes, with the origin coinciding with the other two origins, you have the 3D system. The third axis is called the z-axis. So a point now needs 3 numbers to place it in 3D space: (x,y,z). Frequently, to draw a 3D grid on a 2D surface, the y and z axes are drawn in he plane of the surface and the x axis is drawn in perspective to show that it is perpendicular to the surface. So placing a point in a 3D Cartesian frame is an artistic challenge for me but drawing dashed lines parallel to the axes helps:

There are other orientations of the 3 axes when showing them in 2D, but this is a very common one.

As with the 2D Cartesian coordinate system, equations relating the variables x, y, and z can be plotted, showing all the values of x, y, and z that make the equation true.

In 2D, a general equation of a line is ax + by = c, where the a, b, and c are specific numbers. For example, the set of points that satisfy the equation 2x -3y = 7, plot as a straight line. By extension, in 3D, the general linear equation is ax + by + cz = d. Though this is called a linear equation, it plots as a plane in 3D:

The 3D version of a circle in 2D is a sphere. The generic equation of a sphere of radius r centred at the origin is x2 + y2+ x2 = r2:

Very interesting shapes can be made using 3D graphs. Here are a few:

$z=5e^{-0.2(x^2+y^2)}\text{cos}(x^2+y^2)$
$z = \pm \sqrt{0.4^2-\left(2-\sqrt{x^2+y^2}\right)^2}$
$z=4 e^{-\frac{1}{4} y^2} \sin (2 x)$

As with 2D, there are other ways of locating points in 3D. I will present some of these in my next post.

## Coordinate Systems – 2D, part 2

In my last post, I talked about the Cartesian coordinate system where a point or a set of points can be located using the two numbers (x, y). There is another popular coordinate system that also locates a point in 2D space.

In the graph below, I have plotted the point (5, 3) in the Cartesian coordinate system we now know very well. I have added a line from the origin to that point and noted that the line makes an angle π with the x-axis and that the length of the line is r. I’ve also added perpendicular lines from the point to the x and y axes to show that similar right triangles are formed:

From this graph, you can see that the right triangles have sides of lengths 5 and 3 units. From the Pythagorean Theorem,

$r=\sqrt{3^2+5^2}\approx5.83$

And from trigonometry:

$\text{tan}(\theta)=\frac{3}{5}\Rightarrow\theta\approx30.96\text{Β°}$

Why did I do this? Another way to locate that same point is to 1) define a line (also called a ray) from the origin that is 30.96Β° from the x-axis then, 2) go along that line 5.83 units and stop. That is your point. Welcome to polar coordinates.

This system of locating a point in 2D is called “polar” because the origin is a “pole” from which all the rays that you can define radiate from. In the polar coordinate system, you also need two numbers to locate a point: r and π. Conventionally, a point in polar coordinates is given in the order (r, π).

The variable r is a point’s distance from the origin. π is the angle measured from the postive x-axis: anti-clockwise is + and clockwise is β. Because angles repeat every 360Β° or 2π radians, a particular (r, π) for a point is not unique. For example, (2, 25Β°) locates the same point as (2, 385Β°).

Graphing relations is usually done by plotting r as a function of π. Just as in Cartesian coordinates, the polar graph of an equation between r and π is a picture of all the points whose (r, π) coordinates satisfy the equation. For example, the graph below are all points that satisfy r = 2cos(2π):

Notice how a grid of concentric circles (possible r values) and rays (possible π values) is super-imposed on the x and y axes. This is a polar graph grid.

There are Cartesian graphs that are more easily expressed and plotted in polar coordinates (and vice-versa). One glaring example is a circle. In the Cartesian frame, the equation of a circle, centred at the origin, is

$x^2+y^2=r^2$

where r is the radius. For a circle of radius 2, the above equation would have 4 on the right side and the graph would be a circle of radius 2 centred at the origin. In polar coordinates, the same graph would be r = 2. This is a picture of all points that are 2 units away from the origin:

In orbital dynamics, polar plots are most useful plotting a 2-body orbit. What is meant by “2-body” will be the subject of another post. The path of most orbits of satellites around the earth, are approximated by the ellipse. In Cartesian coordinates, the equation of an ellipse is:

$\frac{x^2}{a^2}+\frac{y^2}{b^2}=1$

The parameters a and b determine the size and orientation (long side vertical or horizontal) of the ellipse. For example,

The problem with this plot is that the geometric centre of the ellipse is at the origin. The path of an earth satellite is not the path followed in this plot if the earth is at the origin. The earth is at one of two special points associated with an ellipse called foci (singular focus). It is more useful in orbital dynamics if the ellipse were plotted in polar coordinates. The polar equation of an ellipse (actually any conic shape which includes circles, parabolas, and hyperbolas) is

$r=\frac{p}{1+e\text{cos}(\theta)}$

where p and e are parameters that determine the size and the shape (circle, ellipse, parabola, or hyperbola) of the orbit. The parameter p is the y-intercept on a superimposed Cartesian frame and we will limit e to be strictly between 0 and 1 which makes the equation plot as an ellipse. This equation, by the way, is called the orbit equation because it accurately describes the shape of any orbit between two point masses without being perturbed by other masses. An example of an elliptical orbit around the earth with a satellite at a particular position is:

This polar plot is more useful to describe orbits because the earth is at the origin and it shows three of the parameters commonly used to describe a satellite’s position and orbit: p (called the semi-latus rectum), e (called the eccentricity), and π (called the true anomaly).

Polar plots can generate shapes that would be unwieldy to generate in the Cartesian frame:

There are other less popular 2D coordinate systems like the parabolic coordinate system. Here is what parabolic graph paper looks like:

I personally do not want to go there.

## Coordinate Systems – 2D, part 1

How do you locate a point on a two-dimensional (2D) surface. Since we are now in two dimensions, it will take a minimum of 2 numbers to locate a point. As in the case for 1D, the 2D surface used can be flat (which this post talks about) or curved: for example the surface of the Earth where the most common system to locate a point is the Geographic Coordinate System using latitude and longitude (again, two numbers to locate a point).

## Cartesian Coordinate System

The coordinate system most used by students of mathematics is the Cartesian Coordinate System. This was invented (and named after) RenΓ© Descartes in the 17th century. This system is used in 3D as well as higher dimensions, but this post is limited to 2D. As most people best learn and retain mathematical concepts visually, this system of plotting was, and still is, indispensable in algebra, calculus, geometry, trigonometry, and many more subjects. So what is the Cartesian Coordinate System?

If you take two 1D number lines, one horizontal and the other vertical so that they are at 90Β° to one another and that their origins intersect, voilΓ , you have a Cartesian Coordinate System:

The system above also has a superimposed grid so that we can more easily located a point.

Conventionally, the horizontal line is called the x-axis, and the vertical one the y-axis. Note the negative numbers are to the left and down. A point on a plane which has this system of location, is said to have coordinates (x, y). Note that x is always first. So a general point (x, y) will have a position such that it is x units left or right of the y-axis and y units above or below the x-axis. Here are some examples:

Analysing points and shapes plotted on a Cartesian coordinate system is called Coordinate Geometry. The lengths and midpoints of plotted lines with defined endpoints can be calculated. But the much more interesting use of a 2D coordinate system is plotting all the points that satisfy a relation between x and y values. This is called plotting an equation.

Suppose you have a relationship (equation) x2 + y2 = 4. What are the values of x and y that satisfy this equation? There are an infinite number of (x, y) pairs that will solve this equation. For example, (0, 2) solves this equation because 02 + 22 = 4. Even though there are infinite solutions, we can draw a picture of all the points that do solve the equation:

As you can see, the set of all points that solve this equation plots as a circle of radius 2. Plots of other equation can look quite strange:

But it is important to remember that the (x, y) coordinates of any point on the graph of a relation, makes the equation true when you substitute those values into it.

The Cartesian coordinate system is not the only way to locate a point in 2D. I will talk about another popular 2D coordinate sytstem in my next post.

## Coordinate Systems – 1D

Many of the posts I have written, had plots of functions or relations between two variables, usually x and y. Most of teaching algebra and calculus relies on graphs to illustrate concepts. These graphs are plots of all the points that satisfy an algebraic relation between the two (or more) variables. Behind these plots is the coordinate system used. This series of posts explores the different coordinate systems commonly used in maths. Let’s first look at a one dimension (1D) coordinate system.

1D means that one number is needed to locate a point. The most used 1D coordinate system is the number line:

Number lines can be vertical or even curvy, for example, to show distance along a path. Usually though, the number line is a straight horizontal line. But they all have some things on common. First, they have to have a reference point: a point from which all other points obtain their position. This point here and in all coordinate systems is called the origin. And second, there is a scale: the distance between the tick marks that allow us to place a point. In the example above, the scale is 1 unit between tick marks. For example, if we want to plot the variable x = 5, the plot would be

There are an infinite number of points on this line: an infinite number of tick marks and an infinite number of points between each tick mark. What are the kinds of numbers that can be plotted?

Any number on the number line is called a real number. This is an actual mathematical term to distinguish these from other types of numbers used in maths such as imaginary numbers (despite the name, imaginary numbers have a real meaning in science and engineering). The set of real numbers is represented by the symbol β. There are several subsets of real numbers.

The first set of numbers you learned as a child were the natural numbers. These are the counting numbers 1, 2, 3, … but do not include 0. This set of numbers is given the symbol β.

Then you learned about 0 and negative integers. Integers are whole numbers (no decimals or fraction parts) and include the natural numbers, 0, and the negative integers. This set of numbers is given the symbol β€. Why not π? Because π is the symbol for imaginary numbers which are not real numbers and π is also sometimes used to refer to irrational numbers which I will talk about soon. Notice that β is a subset of β€ which is a subset of β.

The next type of real numbers is the set of rational numbers. These are numbers that can be put into the form p/q where p and q are integers. Any integer is a rational number like 2 since 2 can be written as 2/1. Any decimal number with a repeating pattern of decimals (even if that is a repeating 0) is a rational number. As β is already used for real numbers, this set of numbers is given the symbol β. This stands for quotient as p/q is a quotient (a maths term for division). All of the previous sets of numbers are subsets of β.

That leaves the set of irrational numbers: the numbers that cannot be put into the form p/q. Numbers like π or β2 are irrational and symbols like these are the only way to represent the exact values. They cannot be exactly represented as a decimal number as their decimal parts never repeat. There is no common symbol for these but β or π are sometimes used. There are few occasions where only irrational numbers are required, but a more common notation would be β\β which means “all real numbers except rational numbers”. Here is a nice picture of how all these types of real numbers are related:

It’s the irrational and some of the rational numbers that lie between the tick marks. So π would be approximately

Plotting single points on the number line is rather boring. But it can also be used to indicate intervals of numbers like all the numbers between β6 and 2. This is shown as β6 < x < 2 where the endpoints are not included or β6 β€ x β€ 2 if both endpoints are included or a combination. When plotting these, an open circle means that the endpoint is not included and a filled in circle means that it is included. So β6 < x β€ 2 would plotted

There’s not much else we can do when using the 1D number line, but we have a lot more options when expanding to 2D: to be continued.

## Statistics – Combinations (Selections)

In my last post, I described how you can find all the ways to arrange x things from a group of n things. Here, order matters, and the equation to calculate this is

$P\left(n,x\right)=\frac{n!}{\left(n-x\right)!}$

If this looks strange, please read my last post. Now let’s talk about counting things where order does not matter, for example, picking a team of players.

The math term for this is combinations. Let’s introduce this with an example. How may ways can you arrange the letters A, B, and C? From my last post, you know that this is 3! = 6. ABC and CBA are two different arrangements. Now how many ways can you select all 3 letters? Well, there is only one way that can be done. ABC and CBA are the same selection so are only counted once. Notice that for a given n and x, there are fewer selections than arrangements. In this example, there are 3! = 6 times more arrangements than selections.

Now let’s modify this example. Suppose we want to select 3 letters from ABCDE. For any 3 of the letters chosen, there will be 3! times more arrangements than selections, which means that if we use the permutation formula above to answer this question, the answer would be 3! times too large. Generalising this, there are x! times more arrangements than selections for a given n and x. This allows us to modify the formula above by dividing it by x! to get the combinations formula

$C\left(n,x\right)=nCx=\left(\begin{matrix}n\\x\\\end{matrix}\right)=\frac{n!}{x!\left(n-x\right)!}$

The left side are some of the different notations used and the right side is the actual formula. As with permutations, you can use a CAS calculator to do this calculation with the nCr function. Selecting 3 letters from 5, there are

$C\left(5,\ 3\right)=\frac{5!}{3!\left(5-3\right)!}=10$

ways to do that. This would also answer the questions: how many ways can you select a team of 3 people from 5 people or how many 3-card hands can be dealt from a deck of 5 cards?

Speaking of cards, how many 5-card poker hands can be dealt from a standard deck of 52 cards?

$C\left(52,\ 5\right)=\frac{52!}{5!\left(52-5\right)!}=2,598,960$

Now let’s put this in practice. There are many lotto games around based on picking 6 numbers out of 45. Let’s first calculate how many ways you can select 6 numbers out of 45:

$C\left(45,\ 6\right)=\frac{45!}{6!\left(45-6\right)!}=8,145,060$

From my post on basic probability, the probability of your lotto ticket with a single set of 6 numbers winning is

$\text{probabilty of winning}=\frac{1}{8145060}=0.000000123=0.0000123\text{%}$

Now if you buy a block of 50 numbers, how much does that improve your chances of winning? This is a binomial distribution problem which is beyond the scope of this post, but to calculate that, it uses the probability calculated above to get 0.000614% chance that at least one of the numbers wins. That’s a 1 out of 162,902 chances to win with a 50 pick lotto card. In Australia, there is a 1 in 12,000 chance of being hit by lightning. Just make sure you’re not standing outside when you buy your ticket.

## Statistics – Permutations (Arrangements)

I will discuss counting two types of picking a group of items from a large number of items. These two types are called permutations (also called arrangements) and combinations (also called selections).

Combinations are when the order of the picking does not matter. For example, when picking 5 cards from a 52 card deck, the order does not matter: Ace, 2, 3, 4, 5 is the same hand as 5, 4, 3, 2, Ace (assuming the suits are the same). Or another example is how many 5 player teams can be made from 30 people. I will discuss combinations in a subsequent post. This post is about permutations, where the order of things picked does matter.

An example of a permutation problem is how many ways can you arrange 5 guests on a table from a group of 50 people. Here, order matters: Adam, Betty, Charlie, David, Eddie arranged in that order is different from Eddie, David, Charlie, Betty, Adam.

Let’s look at a simple example and extrapolate from that.

From 5 people, how many ways can we seat 3 of them? There are 5 ways to pick the first person. Now there are only 4 people left, so there are 4 ways to pick the next person. Now there are 3 people left so we only have 3 ways to pick the last person. So the number of ways is the 5 ways to pick the first times the 4 ways to pick the second times the 3 ways to pick the last person: 5 Γ 4 Γ 3 = 60 ways to arrange 3 people from a group of 5. If you follow this pattern, you can arrange 5 people from a group of 10, 10 Γ 9 Γ 8 Γ 7 Γ 6 = 30,240 ways.

This can be generalised: how many ways can you arrange x things from n things. Before I show the formula for this, I need to explain new notation.

Using a “!” after a number has a meaning in maths. This is called a factorial. As an example, 5! = 5 Γ 4 Γ 3 Γ 2 Γ 1 = 120. So a factorial is successively multiplying one less number. Factorials increase quickly. 40! is a number slightly greater than 8 followed by 47 zeroes. Factorials are used in maths formulas frequently and in order to make these consistent, 0! is defined as 1. Doesn’t look right but this must defined this way as we will see.

Looking at the examples above, we have partial factorials: instead of 5 Γ 4 Γ3 Γ 2 Γ 1, we have 5 Γ 4 Γ 3, or instead of 10 Γ 9 Γ 8 Γ 7 Γ 6 Γ 5 Γ 4 Γ 3 Γ 2 Γ 1 we have 10 Γ 9 Γ 8 Γ 7 Γ 6. Notice that 5! can be thought of as 5 Γ 3 Γ 4 Γ 2! and 10! can be 10 Γ 9 Γ 8 Γ 7 Γ 6 Γ 5!. In the first example, the “2” is 5 – 3, that is the number of people minus the number in the arrangement. In the second, the “5” is 10 – 5, that is the number of people minus the number in the arrangement. If we let n be the number of total things and x the number of the things to be arranged, then the formula to compute this in general is:

$P\left(n,x\right)={^n}P_x=P_x^n=nPx=\frac{n!}{\left(n-x\right)!}$

The formula is the far right expression, the notations on the left are the common notations used in different places that mean the same thing. So applying this to our two examples:

$P(5,3)=\frac{5!}{\left(5-3\right)!}=\frac{5\times4\times3\times2!}{2!}=5\times4\times3=60$ $P\left(10,5\right)=\frac{10!}{\left(10-5\right)!}=\frac{10\times9\times8\times7\times6\times5!}{5!}=10\times9\times8\times7\times6=30,240$

The 2! and the 5! cancel out in the fractions and we get the result we want. If we wanted to arrange 5 things from a group of 5, we use the definition that 0! = 1:

$P\left(5,5\right)=\frac{5!}{\left(5-5\right)!}=\frac{5!}{0!}=\frac{5!}{1}=5\times4\times3\times2\times1=120$

Because of how large factorials grow, if calculating this formula by hand, it is better to first cancel the (nx)! part from the numerator, then calculate the result.

If you are fortunate to own a CAS calculator, using the permutation function nPr gets the same result with less work: nPr(10,5) = 30,240.

Now this does not directly answer questions about picks where order does not matter, like the number of poker hands. That is a combination question and I will talk about that in my next post.

## Statistics – Probability of Conditional Events

This is about the probability of an event given some information. What follows assumes you know how to calculate basic probabilities (two posts ago) and the probability of an intersection of events (my last post).

Let’s start with an example. What is the probability of rolling a 6 on the roll of a die? From basic probability, we know that it is the number of ways to roll a 6 (only 1 way) divided by the number of total things that can happen (6). So the probability is 1/6. Now what if the die is rolled and a friend cheats by telling you that the number rolled is odd. Intuitively, you would say that the probability is 0 as 6 is an even number, so the additional information tells you that a 6 is not possible. The probability of a 6 and an odd number is 0 because the number of ways you can roll a 6 and an odd number is 0.

Now if the die is rolled and your friend says that the number rolled is even, what is the probability that a 6 was rolled? Intuitively, knowing that the number is even should increase the chances that a 6 was rolled. We can answer this using the basic probability formula: the number of ways to roll a 6 and an even number divided by the number of even numbers. Knowing that the number is even reduces the number of total things that can happen from 6 to 3. And the number of ways you can roll a 6 and an even number is 1. So the new probability, thanks to your friend, is 1/3.

As always, maths has notation for this. Let A and B be two events. Then the notation for “the probability of event A given (or on condition that) B occurred” is P(A|B). From the examples above, if A is the event of rolling a 6, and B is the event of rolling an odd number or it’s the event of rolling an even number, then the equation to calculate this is

$P\left(A\middle|B\right)=\frac{n\left(A\cap B\right)}{n\left(B\right)}$

From my last two posts, remember that n(something) means the number of ways that something can occur, and the symbol β© means intersection or “and”.

This equation can be shown to be equivalent to

$P\left(A\middle|B\right)=\frac{P\left(A\cap B\right)}{P\left(B\right)}$

where the probabilities are used instead of the numbers. This can be rearranged to give what is called the multiplication rule of probability

$P\left(A\cap B\right)=P\left(A\middle|B\right)P\left(B\right)$

So if P(A β© B) = 0.3 and P(B) = 0.7, then

$P\left(A\middle|B\right)=\frac{P\left(A\cap B\right)}{P\left(B\right)}=\frac{0.3}{0.7}=\frac{3}{7}$

Another example that shows conditional probability and the multiplication rule of probability in action is the following:

There is a bag with 10 marbles in it: 4 red and 6 blue ones. Two marbles are picked from the bag without replacing the first ball picked. “Without replacing” is important because the probability of picking the second ball’s color is affected by the first ball picked. If the first ball was replaced, the probability of the second ball’s color would not depend in the first ball’s color, that is, the two picks would be independent of each other.

So let’s look at some of the probabilities in this experiment. The probability that the first ball is red is P(Rβ) =4/10 = 2/5. Now the probability of the second ball picked is dependent on that as there is 1 less red ball and 1 less ball in total. So the probability that the second ball is red is P(Rβ|Rβ) = 3/9 = 1/3 because there are only 3 red balls left out of the 9 balls left. Likewise, P(Bβ|Rβ) =6/9 = 2/3. For simple experiments like this, tree diagrams are often used to get a complete picture of all the possibilities:

The last column of combination probabilities uses the multiplication rule previously stated. Using tree diagrams like this, you can answer many questions about the experiment by adding these probabilities:

1. What is the probability of picking just one red marble?
$P\left({B_2\cap R}_1\right)+P\left({R_2\cap B}_1\right)=\frac{4}{15}+\frac{4}{15}=\frac{8}{15}$

2. What is the probability of picking two marbles of the same color?

$P\left({R_2\cap R}_1\right)+\ P\left({B_2\cap B}_1\right)=\frac{2}{15}+\frac{1}{3}=\frac{7}{15}$

3. What is the probability of picking at least one red marble?

$P\left({R_2\cap R}_1\right)+P\left({B_2\cap R}_1\right)+P\left({R_2\cap B}_1\right)=\frac{2}{15}+\frac{4}{15}+\frac{4}{15}=\frac{10}{15}=\frac{2}{3}$

Note that since the last column includes all the possible ways this experiment can go, all of these probabilities add up to 1. So to answer question 3, a more efficient way to calculate the answer is to subtract the one possibility excluded from 1:

$1-P\left({B_2\cap B}_1\right)=1-\frac{1}{3}=\frac{2}{3}$

Counting the number of ways an event can happen in simple experiments like this is easy to do in your head. But what about questions like “how many poker hands (5 cards) can be made from a standard deck of 52 cards?”. Not so easy. So next time, I will talk about how we can “count” large possibilities like this.

## Statistics – Probability of Combined Events

I ended my last post showing the probability of picking a type of card from a standard deck of 52 cards. For example, if the event of interest, A, is picking a Jack, then the probability of picking a Jack from a shuffled deck of cards is

$P\left(A\right)=\frac{4}{52}=\frac{1}{13}$

because there are 4 ways to pick a Jack out of 52 cards. Now let’s consider probabilities of events like “picking a Jack or a Heart” or “a face card and a Heart”.

If we let events A be picking a Jack, B be picking a Heart, and C be picking a face card (Jack, Queen, or King), then the maths notation for these statements are

$P\left(A\cup B\right)=\mathrm{probability\ of\ picking\ a\ Jack\ or\ a\ Heart}$ $P\left(B\cap C\right)=\mathrm{probability\ of\ picking\ a\ face\ card\ and\ a\ Heart}$

The symbol “βͺ” stands for the union of two events, but in English, you can use the word “or”: A βͺ B = “A union B” or “A or B“. The symbol “β©” stands for the intersection of two events, but in English, you can use the word “and”: B β© C = “B intersection C” or “B and C“. These concepts are easily seen in a Venn diagram:

Circle A is the set of all Jacks and circle B is the set of all Hearts. Now the probability of picking a card from set A is 4/52. The probability of picking a card from set B is 13/52. You may be tempted so say that the probability of A or B is the sum of the two individual probabilities. But both of these probabilities include the Jack of Hearts so it is used twice. We have to subtract out this intersection of the two probabilities, so in maths notation:

$P\left(A\cup B\right)=P\left(A\right)+P\left(B\right)-P\left(A\cap B\right)$

This equation can be rearranged to show that the probability of the intersection of the two events is equal to the sum of the individual probabilities minus the probability of the union:

$P\left(A\cap B\right)=P\left(A\right)+P\left(B\right)-P\left(A\cup B\right)$

These two equations are different forms of what is called the addition rule of probability.

So P(A βͺ B) = 4/52 +13/52 – 1/52 = 16/52, because P(A β© B) is the probability of a Jack and a Heart. Only one card satisfies this, the Jack of Hearts, so the probability of that is 1/52.

Now let’s define event D as picking a Diamond and consider the probability of picking a Heart and a Diamond, P(B β© D). This is clearly 0 as a card cannot be both suits. The associated Venn diagram looks like:

Events like this are called mutually exclusive, that is, you can pick one or the other, the picked card cannot be both. For mutually exclusive events:

$P\left(B\cup D\right)=P\left(B\right)+P\left(D\right)\ \mathrm{and}\ P\left(B\cap D\right) =0$

In my next post, I will discuss what is called conditional probabilities and explore the probability of picking a Jack given that the card is a Heart.

## Statistics – Basic Probability

As I am covering this topic now with many of my students, let’s start a series on statistics.

The first concept taught when introducing statistics to students is that of probability. Let’s start with the experiment of rolling a die. I italicise experiment because it is a formal term in statistics. I will italicise other terms in this post.

If we are interested in the outcome or the event of rolling a “3”, what is the probability of that occurring? As there are six possible outcomes, all equally likely, and “3” is just one of them, then the probability is 1/6 or 1 out of 6. As maths likes to use shorthand notation to represent concepts, lets notationise (my word) this.

Let A represent the event of rolling a “3”. The probability of this is represented by P(A). The probability of rolling a “3” is the number of ways a “3” can occur (one way) divided by the total number of things that can occur (six). So to generalise this, for experiments where all outcomes are equally likely, the probability of an event A is

$P\left(A\right)=\frac{\mathrm{number\ of\ ways}\ A\ \mathrm{can\ occur}\ }{\mathrm{total\ number\ of\ things\ that\ can\ occur}}=\frac{n\left(A\right)}{n\left(\xi\right)}$

Now I’ve introduced some new notation here. n(A) is notation that means “number of ways A can occur”. The Greek letter xi, ????, is the set of all the things that can happen. In this case, ???? ={1, 2, 3, 4, 5, 6}. This is also called the sample space of the experiment. So n(????) = 6. In our experiment and the event of interest (rolling a “3”), n(A) = 1 and n(????) = 6 so P(A) = 1/6.

So what is the probability of rolling an even number? Here, A = “rolling an even number”. As there are three even numbers, or three ways, that this can occur, then P(A) = 3/6 = 1/2.

Let me say a few general things about probability. The probability of an event is always a number between 0 and 1 including 0 and 1. At the extreme ends, if P(A) = 0, then event A has no chance of occurring. So in our experiment, if A is the event of rolling a “7”, then P(A) = 0. If P(A) = 1, then the event is a certainty to happen. If A is the event of rolling an odd or even number, then P(A) = 1.

Now let’s look at a slightly more complex experiment: picking a card from a standard deck of cards. A standard deck of 52 cards has four suits (hearts, clubs, diamonds, spades) of 13 cards each. Each suit consists of an Ace, Jack, Queen, King, and numbered cards 2 to 10. The Jack, Queen, and King cards are called face cards. So this experiment is choosing one card out of a shuffled deck of cards.

If A = choosing a Heart, then P(A) = 13/52 = 1/4 because there are 13 ways to pick a Heart out of 52 ways any card can be picked. Now let A = choosing a Jack. Here P(A) = 4/52 = 1/13 as there are 4 Jacks in a deck of cards. Now let A = picking a face card. Then P(A) = 12/52 =3/13 as there are 12 face cards in a deck.

In my next post, we’ll explore how to handle more complex events like choosing a Queen or a Heart.