You are currently browsing the category archive for the ‘General’ category.

Talk delivered to the Conversations on Teaching and Learning Winter Programme 2018/19, organised by the Teaching & Learning Unit in CIT (click link for slides):

Contexts and Concepts: A Case Study of Mathematics Assessment for Civil & Environmental Engineering

I received the following email (extract) from a colleague:

With the birthday question the chances of 23 people having unique birthdays is less than ½ so probability of shared birthdays is greater than 1-in-2. 

Coincidentally on the day you sent out the paper, the following question/math fact was in my son’s 5th Class homework.

We are still debating the answer, hopefully you could clarify…

In a group of 368 people, how many should share the same birthday. There are 16×23 in 368 so there are 16 ways that 2 people should share same birthday (?) but my son pointed out, what about 3 people or 4 people etc.

I don’t think this is an easy problem at all.

First off we assume nobody is born on a leap day and the distribution of birthdays is uniform among the 365 possible birthdays. We also assume the birthdays are independent (so no twins and such).

They were probably going for 16 or 32 but that is wrong both for the reasons given by your son but also for the fact that people in different sets of 23 can also share birthdays.

The brute force way of calculating it is to call by X the random variable that is the number of people who share a birthday and then the question is more or less looking for the expected value of X, which is given by:

\displaystyle \mathbb{E}[X]=\sum_{i=2}^{368}i\cdot \mathbb{P}[X=i].

Already we have that \mathbb{P}[X=2]=\mathbb{P}[X=3]=0 (why), and \mathbb{P}[X=4] is (why) the probability that four people share one birthday and 364 have different birthdays. This probability isn’t too difficult to calculate (its about 10^{-165}) but then things get a lot harder.

For X=5, there are two possibilities:

  • 5 share a birthday, 363 different birthdays, OR
  • 2 share a birthday, 3 share a different birthday, and the remaining 363 have different birthdays

Then X=6 is already getting very complex:

  • 6 share a birthday, 362 different birthdays, OR
  • 3, 3, 362
  • 4, 2, 362
  • 2, 2, 2, 362

This problem is spiraling out of control.

 

There is another approach that takes advantage of the fact that expectation is linear, and the probability of an event E not happening is

\displaystyle\mathbb{P}[\text{not-}E]=1-\mathbb{P}[E].

Label the 368 people by i=1,\dots,368 and define a random variable S_i by

\displaystyle S_i=\left\{\begin{array}{cc}1&\text{ if person i shares a birthday with someone else} \\ 0 & \text{ if person i does not share a birthday}\end{array}\right.

Then X, the number of people who share a birthday, is given by:

\displaystyle X=S_1+S_2+\cdots+S_{368},

and we can calculate, using the linearity of expectation.

\mathbb{E}[X]=\mathbb{E}[S_1]+\cdots \mathbb{E}[S_{368}].

The S_i are not independent but the linearity of expectation holds even when the addend random variables are not independent… and each of the S_i has the same expectation. Let p be the probability that person i does not share a birthday with anyone else; then

\displaystyle\mathbb{E}[S_i]=0\times\mathbb{P}[S_i=0]+1\times \mathbb{P}[S_i=1],

but \displaystyle\mathbb{P}[S_i=0]=\mathbb{P}[\text{ person i does not share a birthday}]=p, and

\displaystyle \mathbb{P}[S_i=1]=\mathbb{P}[\text{not-}(S_i=0)]=1-\mathbb{P}[S_i=0]=1-p,

and so

\displaystyle\mathbb{E}[S_i]=1-p.

All of the 368 S_i have this same expectation and so

\displaystyle\mathbb{E}[X]=368\cdot (1-p).

Now, what is the probability that nobody shares person i‘s birthday?

We need persons 1\rightarrow i-1 and i+1\rightarrow 368 — 367 persons — to have different birthdays to person i, and for each there is 364/365 ways of this happening, and we do have independence here (person 1 not sharing person i‘s birthday doesn’t change the probability of person 2 not sharing person i‘s birthday), and so \mathbb{P}[\text{(person k not sharing) AND (person k not sharing)}] is the product of the probabilities.

So we have that

\displaystyle p=\left(\frac{364}{365}\right)^{367},

and so the answer to the question is:

\displaystyle\mathbb{E}[X]=368\cdot \left(1-\left(\frac{364}{365}\right)^{367}\right)\approx 233.54\approx 234.

There is possibly another way of answering this using the fact that with 368 people there are

\displaystyle \binom{368}{2}=67528

pairs of people.

 

 

This strategy is by no means optimal nor exhaustive. It is for students who are struggling with basic integration and anti-differentiation and need something to help them start calculating straightforward integrals and finding anti-derivatives. 

TL;DR: The strategy to antidifferentiate a function f that I present is as follows:

  1. Direct
  2. Manipulation
  3. u-Substitution
  4. Parts

Read the rest of this entry »

The purpose of this post is to briefly discuss parallelism and perpendicularity of lines in both a geometric and algebraic setting.

Lines

What is a line? In Euclidean Geometry we usually don’t define a line and instead call it a primitive object (the properties of lines are then determined by the axioms which refer to them). If instead points and line segments – defined by pairs of points P,Q [PQ] are taken as the primitive objects, the following might define lines:

Geometric Definition Candidate

line, \ell, is a set of points with the property that for each pair of points in the line, P,Q\in \ell,

[PQ]\cap \ell=[PQ].

In terms of a picture this just says that when you have a line, that if you take two points in the line (the language in comes from set theory), that the line segment is a subset of the line:

line

Exercise:

Why is this objectively not a good definition of a line.

Once we move into Cartesian\Coordinate Geometry we can perhaps do a similar trick. We can use line segments, and their lengths to define slope, (slope = rise over run) and then define a line as follows:

Algebraic Definition Candidate

A line, \ell, is a set of points such that for all pairs of distinct points P,Q\in\ell, the slope is a constant.

This means that if you take two pairs of distinct points in a line \ell, and then calculate the slopes between them, you get the same answer, and therefore it makes sense to talk about the slope of a line, m.

line2

This definition, however, has exactly the same problem as the previous. The definition we use isn’t too important but I do want to use a definition that considers the line a set of points.

The Equation of a Line

We can use such a definition to derive the equation of a line ‘formula’ for a line of slope m containing a point (x_1,y_1).

Suppose first of all that we have an x\text{-}y axis and a point P(x_1,y_1) in the line. What does it take for a second point Q(x,y) to be in the line?

line4

Read the rest of this entry »

“Straight-Line-Graph-Through-The-Origin”

The words of Mr Michael Twomey, physics teacher, in Coláiste an Spioraid Naoimh, I can still hear them.

There were two main reasons to produce this straight-line-graph-through-the-origin:

  • to measure some quantity (e.g. acceleration due to gravity, speed of sound, etc.)
  • to demonstrate some law of nature (e.g. Newton’s Second Law, Ohm’s Law, etc.)

We were correct to draw this straight-line-graph-through-the origin for measurement, but not always, perhaps, in my opinion, for the demonstration of laws of nature.

The purpose of this piece is to explore this in detail.

Direct Proportion

Two variables P and Q are in direct proportion when there is some (real number) constant k such that P=k\cdot Q.

Read the rest of this entry »

Occasionally, it might be useful to do as the title here suggests.

Two examples that spring to mind include:

  • solving a\cdot\cos\theta\pm b\cdot\sin\theta=c for \theta (relative velocity example with - below)
  • maximising a\cdot\cos\theta\pm b\cdot\sin\theta without the use of calculus

a\cdot \cos\theta- b\cdot\sin\theta

Note first of all the similarity between:

\displaystyle a\cdot \cos\theta-b\cdot \sin \theta\sim \sin\phi\cos\theta-\cos\phi\sin\theta.

This identity is in the Department of Education formula booklet.

The only problem is that a and b are not necessarily sines and cosines respectively. Consider them, however, as opposites and adjacents to an angle in a right-angled-triangle as shown:

triangle

Using Pythagoras Theorem, the hypotenuse is \sqrt{a^2+b^2} and so if we multiply our expression by \displaystyle \frac{\sqrt{a^2+b^2}}{\sqrt{a^2+b^2}} then we have something:

\displaystyle \frac{\sqrt{a^2+b^2}}{\sqrt{a^2+b^2}}\cdot \left(a\cdot \cos\theta- b\cdot\sin\theta\right)

\displaystyle=\sqrt{a^2+b^2}\cdot \left(\frac{a}{\sqrt{a^2+b^2}}\cos\theta-\frac{b}{\sqrt{a^2+b^2}}\sin\theta\right)

=\sqrt{a^2+b^2}\cdot \left(\sin\phi\cos\theta-\cos\phi\sin\theta\right)=\sqrt{a^2+b^2}\sin(\phi-\theta).

Similarly, we have

a\cdot\cos\theta+b\cdot \sin\theta=\sqrt{a^2+b^2}\sin(\phi+\theta),

where \displaystyle\sin\phi=\frac{a}{\sqrt{a^2+b^2}}.

Read the rest of this entry »

Last semester, teaching some maths to engineers, I decided to play (via email) the Guess 2/3 of the Average game. Two players won (with guesses of 22) and so I needed a tie breaker.

I came up with a hybrid of Monty Hall, not too dissimilar to the game below (the prize was €5).

Rules

In this game, the host presents four doors to the players Alice and Bob:

monty

Behind three of the doors is an empty box, and behind one of the doors is €100.

The host flips a coin and asks the Alice would she like heads or tails. If she is correct, she gets to choose whether to go first or second.

The player that goes first picks a door, then the second player gets a turn, picking a different door.

Then the host opens a door revealing an empty box.

Now the first player has a choice to stay or switch.

The second player then has a choice to stay or switch (the second player can go to where the first player was if the first player switches).

Questions: 

  1. What is the best strategy for the player who goes second:
    • if the first player switches?
    • if the first player stays?
  2. Should the person who wins the toss choose to go first or second? What assumptions did you make?
  3. How much would you pay to play this game? What assumptions did you make?
  4. If there is a bonus for playing second, how much should the bonus be such that the answer to question 1. is “it doesn’t matter”.

 

Correlation does not imply causation is a mantra of modern data science. It is probably worthwhile at this point to define the terms correlation, imply, and (harder) causation.

Correlation

For the purposes of this piece, it is sufficient to say that if we measure and record values of variables x and y, and they appear to have a straight-line relationship, then the correlation is a measure of how close the data is to being on a straight line. For example, consider the following data:

graph14

The variables y and x have a strong correlation. 

Causation

Causality is a deep philosophical notion, but, for the purposes of this piece, if there is a relationship between variables y and x such that for each value of x there is a single value of y, then we say that y is a function of x: x is the cause and y is the effect.

In this case, we write y=f(x), said y is a function of x. This is a causal relationship between x and y. (As an example which shows why this definition is only useful for the purposes of this piece, is the relationship between sales t days after January 1, and the sales, S, on that day: for each value of t there is a single value of S: indeed S is a function of t, but t does not cause S).

Read the rest of this entry »

This follows on from this post.

Recall the Doubling Mapping D:[0,1)\rightarrow [0,1) given by:

\displaystyle D(x)=\begin{cases} 2x & \text{ if }x<1/2 \\ 2x-1 & \text{ if }x\geq 1/2 \end{cases}

At the end of the last post we showed that this dynamical system displays sensitivity to initial conditions. Now we show that it displays topological mixing (a chaotic orbit) and density of periodic points.

First we must talk about periodic points.

Periodic Points

Consider, for example, the initial state \displaystyle x_0=\frac{1}{9}. The orbit of x_0 is given by:

\displaystyle \text{orb}(x_0)=\left\{\frac{1}{9},\frac29,\frac49,\frac89,\frac79,\frac59,\frac19,\frac29,\dots\right\}

Here we see \frac19 repeats itself and so gets ‘stuck’ in a repeating pattern:

graph1

The orbit of x_0=1/9.

The orbit of any fraction, e.g. \displaystyle x_0=\frac{4}{243}, must be periodic, because \displaystyle D\left(\frac{i}{243}\right) is either equal to \displaystyle \frac{2i}{243} of \displaystyle \frac{2i-243}{243} and so the orbit consists only of states of the form:

\displaystyle \frac{i}{243},

and there are only 243 of these and so after 244 iterations, some state must be repeated and so we get locked into a periodic cycle.

If we accept the following:

Proposition

A fraction \frac{p}{q} has a recurring binary expansion:

\displaystyle \frac{p}{q}=0.b_1\dots b_m\overline{a_1a_2\dots a_n}_2,

then this is another way to see that fractions are (eventually) periodic. Take for example,

\displaystyle x_0=0.101,101,101,101,\dots_2=0.\overline{101}_2=\frac{5}{7}.

Read the rest of this entry »

Dynamical Systems

A dynamical system is a set of states S together with an iterator function f:S\rightarrow S which is used to determine the next state of a system in terms of the previous state. For example, if x_0\in S is the initial state, the subsequent states are given by:

x_1=f(x_0),

x_2=f(x_1)=f(f(x_0))=(f\circ f)(x_0)=:f^2(x_0)

x_3=f(x_2)=f(f^2(x_0))=f^3(x_0),

and in general, the next state is got by applying the iterator function:

x_{i}=f(x_{i-1})=f^i(x_0).

The sequence of states

\{x_0,x_1,x_2,\dots\}

is known as the orbit of x_0 and the x_i are known as the iterates.

Such dynamical systems are completely deterministic: if you know the state at any time you know it at all subsequent times. Also, if a state is repeated, for example:

\text{orb}(x_0)=\{x_0,x_1,x_2,x_3,x_4=x_2,x_5\dots,\}

then the orbit is destined to repeated forever because

x_5=f(x_4)=f(x_2)=x_3,

x_6=f(x_5)=f(x_3)=x_4=x_2, etc:

\Rightarrow \text{orb}(x_0)=\{x_0,x_1,x_2,x_3,x_2,x_3,x_2,\dots\}

Example: Savings

Suppose you save in a bank, where monthly you receive 0.1\%=0.001 interest and you throw in 50 per month, starting on the day you open the account.

This can be modeled as a dynamical system.

Let S=\mathbb{R} be the set of euro amounts. The initial amount of savings is x_0=50. After one month you get interest on this: 0.001\times50, you still have your original 50 and you are depositing a further €50, so the state of your savings, after one month, is given by:

x_1=50+0.001\times 50+50=(1+0.001)50+50.

Now, in the second month, there is interest on all this:

interest in second month 0.001\times((1+0.001)50+50)=0.001x_1,

we also have the x_1=(1+0.001)50+50 from the previous month and we are throwing in an extra €50 so now the state of your savings, after two months, is:

x_2=x_1+0.001x_1+50=(1+0.001)x_1+50,

and it shouldn’t be too difficult to see that how you get from x_i\longrightarrow x_{i+1} is by applying the function:

f(x)=(1+0.001)x+50.

Exercise

Use geometric series to find a formula for x_n.

Weather

If quantum effects are neglected, then weather is a deterministic system. This means that if we know the exact state of the weather at a certain instant (we can even think of the state of the universe – variations in the sun affecting the weather, etc), then we can calculate the state of the weather at all subsequent times.

This means that if we know everything about the state of the weather today at 12 noon, then we know what the weather will be at 12 noon tomorrow…

Read the rest of this entry »

%d bloggers like this: