Chaitanya's Random Pages

January 30, 2014

The frequency of 40+ days in Melbourne

Filed under: climate and weather — ckrao @ 10:14 am

In a recent post I mentioned that Melbourne (the regional office weather station) has had 203 days of a maximum temperature of 40°C or more in the 159 years from 1855 to 2013. January 2014 alone has had 5 more such days, tying the record of instances in a month. There were two other times when Melbourne had 5 days reaching at least 40°C in a month: January 1905 and January 1908. The former of these had four of the hot days out of a string of five while the latter had all five in consecutive days. This year included a sequence of four consecutive instances above 41°C, the first time that has happened since records began.

The following plot, generated via the geom_smooth feature of ggplot2 in R, shows a dip in the frequency of these days in the mid 20th century, followed by an increasing frequency since 1980. (The year 2014, being incomplete to date, is not included.)

Frequency of 40 degree days in Melbourne

Interestingly the 10 years 1969-1978 only had 3 instances of 40+ degree days (including none during the four years 1969-1972). The table below shows the frequency per decade since records began, with the current period having the most. The most recent year Melbourne did not have a 40+ day was 2002.

Decade # 40+ °C days
1855-1864 12
1865-1874 11
1875-1884 13
1885-1884 6
1895-1904 21
1905-1914 22
1915-1924 11
1925-1934 6
1935-1944 15
1945-1954 10
1955-1964 8
1965-1974 8
1975-1984 14
1985-1994 10
1995-2004 16
2005-2014 27+

Melbourne has so far never had 7 days of 40°C in a year (6 times was reached in 1898 and 1900), and 2014 has a chance of at least equalling that record (edit: 2014 has set a record with its 7th day of 40+°C temperatures, the mark reached on Jan 14-17, 28 and Feb 8-9).

Advertisements

January 28, 2014

The validity of the index laws for real numbers

Filed under: mathematics — ckrao @ 12:51 pm

The fundamental index laws are given by

\begin{aligned} x^a x^b &= x^{a + b}\quad\quad &(1)\\(x^a)^b &= x^{ab}\quad \quad &(2)\\(xy)^a &= x^a y^a\quad\quad &(3)\end{aligned}

If these are true we can also deduce

\begin{aligned} x^0 &= 1 \ \text{ for }x \neq 0\quad \text{(setting } b = 0\text{ in (1))}\quad\quad\quad\quad&(4)\\1^a &= 1 \ \text{ for real numbers }a \quad \text{(setting } y = 1\text{ in (3))}\quad\quad\quad\quad&(5)\\x^{-a} &= 1/x^{a}\quad\text{(setting } b=-a \text{ in (1) and using (4))}\quad\quad&(6)\\x^{a}/x^{b} &= x^{a-b}\quad\text{(replacing } b \text{ with }-b \text{ in (1) and using (6))}\quad\quad&(7)\\(x/y)^a &= x^a/y^a \ \text{ where }y \neq 0\quad\text{(replacing }y \text{ with }1/y\text{ in (3))}\quad\quad&(8)\end{aligned}

In this post we discuss the following conditions under which these laws hold.

  • Case 1: The laws are true if x and y are positive real numbers and a, b are real numbers.
  • Case 2: If x or y is negative we require a and b to be rational with odd denominator for x^a or x^b to be defined (this includes a or b being integers as the denominator in this case is 1). All the laws except (2) hold in this case. For (2) to be true we require the denominators of a and ab in reduced form to be odd and that either (a) the numerators and denominators of a and b are all odd or (b) the numerator of ab in reduced form is even.
  • Case 3: The laws are mostly true if x = 0, except a,b need to be positive and laws (6), (7) do not apply.

Case 1: Positive bases

Let us seek to define x^a from first principles for arbitrary x positive and a real. We can be motivated by the continuity of the function x^t as a function of t (where x is fixed) and think of x^a as the limit of values x^r as rational numbers r approach a. To me it is easier to proceed via the logarithm function which may be defined as

\displaystyle \log(x) := \int_1^x \frac{1}{t}\ \text{d}t\quad x > 0.\quad\quad(9)

Being the area under a continuous positive-valued function, this function is continuous and monotonically increasing. It is also apparent that \log(1) = 0. From the definition the important identity \log (xy) = \log(x) + \log(y) (where x, y > 0) can be derived via a change of variable u=t/x as follows:

\begin{aligned} \log (xy) &= \int_1^{xy} \frac{1}{t}\ \text{d}t\\&=\int_1^{x} \frac{1}{t}\ \text{d}t + \int_x^{xy} \frac{1}{t}\ \text{d}t\\&= \int_1^{x} \frac{1}{t}\ \text{d}t + \int_1^{y} \frac{1}{ux}x\ \text{d}u\\&= \int_1^{x} \frac{1}{t}\ \text{d}t + \int_1^{y} \frac{1}{u}\ \text{d}u\\&=\log(x) + \log(y). \quad \quad (10)\end{aligned}

By repeated use of this rule, \log(x^n) = n \log(x) for positive integers n. As \log(2) > 0, \log(2^n) = n \log 2 grows without bound as n increases, which shows that the log function is unbounded above. It is also unbounded below due to the relationship \log(1/x) = -\log(x) (which follows from 0 = \log (1) = \log(x.(1/x)) = \log x + \log (1/x)). Hence the log function is monotonic, continuous and has range (-\infty, \infty). It thus has a continuous inverse which is how we may define the exponential function: \exp(x) is the unique positive value y satisfying

\displaystyle x = \int_1^y \frac{1}{t}\ \text{d}t.

From the relationship \log(uv) = \log(u) + \log(v) follows

\exp(x+y) = \exp(x) \exp(y) \quad\quad(11)

where x and y are real. Repeated use of this gives

\displaystyle \exp(nx) = \exp(x)^n \quad \quad (12)

for n a positive integer. Defining e:= \exp(1), we have the familiar form \exp(n) = e^n.

We can extend (12) to rational values of n. Let us recall what we mean by a rational power. For a > 0 and relatively prime positive integers p, q we define a^{p/q} to be the unique positive number y such that y^q = a^p. (That the q‘th root exists follows from the fact that the function x^q has an inverse for x > 0).

From (12) we then have

\displaystyle (\exp(x))^p = \exp(px) = \exp((px/q).q) = \exp(px/q)^q.

Setting \exp(x) to a and \exp(px/q) to y we have thus shown a^p = y^q, so \exp(x)^{p/q} = \exp(px/q). Therefore (12) is satisfied when n is positive rational. Finally we use \exp(-x) = 1/\exp(x) (which can be proved using (11)) to extend (12) to negative rationals:

\displaystyle \exp(nx) = 1/\exp(-nx) = 1/\exp(x)^{-n} = \exp(x)^n.

We are finally ready to define x^a for arbitrary x positive and a real relying on continuity. We simply extend (12) replacing \exp(x) with x (also replacing x with \log(x)) and n with real values a:

\displaystyle x^a := \exp(a \log(x)), \quad x > 0, a \in \mathbb{R}.\quad\quad(13)

From this definition it is quick to verify laws (1) and (2):

\begin{aligned} x^a x^b &= \exp(a \log(x))\exp(b \log (x))\\ &= \exp(a \log x + b\log x)\\ &= \exp((a+b)\log x)\\ &= x^{a+b}\quad\quad(14)\\\text{and }\ (x^a)^b &= \exp(b \log(x^a))\\ &= \exp(b a \log(x))\\ &= x^{ab}\quad\quad(15)\end{aligned}

Law (3) is immediate if either x or y is equal to 1. Otherwise, we can find c so that y = x^c (choose c = \log(y)/\log(x)) and then we have from (1) and (2) the following:

\begin{aligned} (xy)^a &= (x.x^c)^a\\ &= (x^{1+c})^a\\ &= x^{a + ac}\\ &= x^a x^{ac}\\ &= x^a (x^c)^a\\ &= x^a y^a.\quad\quad (16) \end{aligned}

Case 2: Negative bases

When the base x is negative we can define x^a by the real number (-1)^a(-x)^a provided (-1)^a exists. This will be the case if a is rational and has odd-valued denominator (square roots of -1 are not real-valued nor are irrational powers of -1). Writing a = p/q where p and q are relatively prime (q odd), we then have (-1)^{p/q} = (-1)^p. Since odd denominators are preserved under addition, law (1) can be shown to hold.

To check law (3) we consider the cases of both x,y being negative or only one (say y) being negative.

a) If x and y are both negative:

\begin{aligned} (xy)^{p/q} &= ((-x)(-y))^{p/q}\\&= (-x)^{p/q} (-y)^{p/q}\\ &= (-1)^{2p/q}(-x)^{p/q} (-y)^{p/q}\\&= (-1)^{p/q}(-x)^{p/q}(-1)^{p/q}(-y)^{p/q}\\&= x^{p/q}y^{p/q}\end{aligned}

b) If x is positive and y is negative:

\begin{aligned} (xy)^{p/q} &= (-1)^{p/q}(x(-y))^{p/q}\\&= (-1)^{p/q}(x)^{p/q} (-y)^{p/q}\\&= x^{p/q}y^{p/q}\end{aligned}

However rule (2) is a little more complicated. For example, (x^2)^{1/2} \neq x if x <0 so we cannot say

\displaystyle 1 = 1^{1/2} = ((-1)^2)^{1/2} = (-1)^{2/2} = (-1)^1 = -1.

Issues arise when even denominators in the exponents appear because positive square roots will be taken when negative numbers may be required. It is also possible that (x^a)^b = x^{ab} but for x^b not to be real-valued (e.g. (x^4)^{1/2} = x^2 but x^{1/2} is not real-valued).

For (x^a)^b = x^{ab} to make sense when x < 0 we require that the left and right sides are defined and are equal in the equality ((-1)^a)^b = (-1)^{ab}. Hence:

  • for the left side to exist, a must have odd denominator and if (-1)^a <0 then b must also have odd denominator
  • for the right side to exist, ab in reduced form must have odd denominator

Also:

  • (a) the left side is negative iff a,b both have odd numerators and denominators and the same is true for the right side.
  • (b) the left side is positive iff either of a,b has even numerator and the right side is positive iff ab has even numerator and odd denominator in reduced form.

We conclude that (2) holds when either (a) the numerators and denominators of a and b are all odd (in which case the result is negative) or (b) the product ab has even numerator and odd denominator in reduced form (in which case the product is positive).

This allows the possibility of an even numerator cropping up such as (x^{2/3})^3 = x^2. It is interesting to see that (x^{4/3})^{1/2} = x^{2/3} is valid but (x^{2/3})^{1/2} = x^{1/3} is not for x < 0.

Also, reduced form (cancelling out even factors) is important to avoid erroneous calculations such as (-1)^{2/4} = ((-1)^2)^{1/4} = 1.

Finally we remark that for negative bases we lose continuity: for example (-1)^q switches between +1 and -1 depending on whether the numerator of q is odd or even.

Case 3: Base 0

Note that 0^a is 0 for positive a (again defined firstly for rationals then extended to positive reals by continuity). However it is undefined for a negative which is why the laws only hold for positive indices and neither (5) nor (6) apply. In the discrete world it is common to define 0^0 to be 1 for convenience but the function x^y fails to be continuous at (x,y) = (0,0) for any choice of value of 0^0.

Postscript

I’ll end this post with a cool-looking exponential of logarithm identity that is not as well known as it perhaps ought to be. For x,y >0 we have

\displaystyle x^{\log y} = y^{\log x}.

(The logarithm of both sides is \log y \log x = \log x \log y!)

For example, 4^{\log_2 9} = 9^{\log_2 4} = 9^2 = 81.

Create a free website or blog at WordPress.com.

%d bloggers like this: