%
% 235
%
\chapter{The Gamma Function}

\Section{12}{1}{Definitions of the Gamma- function. The Weierstrassian product.}

Historically, the Gamma-function* V z) was first defined by Euler as
the limit of a product \hardsubsectionref{12}{1}{1}) from which can be derived the
infinite integral

1 i ~ e~ dt; but in developing the theory of the function, it is more
con- Jo

venient to define it by means of an infinite product of Weierstrass'
canonical

form.

Consider the product ze fl -I ( 1 -H -

e

where 7= lim ]-+--f-...-l- log ?/i[ =0-5772157....

[The constant y is known as Euler's or Mascheroni's constant; to
prove that it exists we observe tliat, if

u = I -. .a<= - log - -,

[ dt \ "

u IS positive and less than / -, = -,; therefore 2 w converges, and Jo
n 'i n=l

,. n 1 1, 1,. ( "', m + l\ *

hm J- + -+...+ logwl= hm < 2 ?< + log \= 2 .

The value of y has been calculated by J. C. Adams to 260 places of
decimals.]

The product under consideration represents an analytic function of z,
for

all values of z; for, if N be an integer such that \ z\ \ iV, we
havef, if n > N,

1 2- 1 Z'

1

2n'-' Sn' '"

z z z n- 1 n n-

-

IN \ \ 1 1 1 1 '

 4 r' 2 + 2' +---) 2 n '

00

Since the series 2 [N' l 2n?)] converges, it follows that, when \ z\ \
N,

n = N+l

* The notation V (z) was introduced by Legendre iu 1814. t Taking the
principal value of log (1 + z/?().

%
% 236
%

S ]log(l + - is an absolutely and uniformly convergent series

of analytic functions, and so it is an analytic function \hardsectionref{5}{3});
con- sequently its exponential 11 ( l+-]e~nl is an analytic function,
and

so zey n ! ( 1 + - J e ~ [ is an analytic function when \ z\ \ N,
where N is any integer; that is to say, the product is analytic for
all finite values of z. The Gamma-function was defined by Weierstrass*
by the equation

,= -T- = zey U ( l+-]e ~n[-

from this equation it is apparent that T (z) is analytic except at the
points z=0, - 1, - 2, . . ., where it has simple poles.

Proofs have been published by Holder t, Moore J, and Bai-nes§ of a
theorem known to Weierstrass that the Gamma-function does not satisfy
any differential equation with rational coefficients.

Example 1. Prove that

r(i) = i, r'(i)=-y,

where y is Euler's constant.

[Justify differentiating logarithmically the equation

~ = zey''n ( l+ -)e~ri\ Viz) 1 IV nJ I

by \hardsectionref{4}{7}, and put z = l after the differentiations have been
performed.]

Example 2. Shew that

,11 1 P 1

2 3 n Jo

t and hence that Euler's constant y is given by||

-(1-""*,

lim

[/: '-04)" ?-/:(-r.)"T']'

Example 3. Shew that

e> r(g + l)

T z-x + ) '

n = \ \ \ Z + n) J

* Journal filr Math. li. (1856). This formula for F(z) had been
obtained from Euler's formula \hardsubsectionref{12}{1}{1}) in 1848 by F. W. Newman,
Cambridge and Dublin Math. Journal, iii. (1848), p. 60. t Math. Ann.
sxvm. (1887), pp. 1-13. + Math. Ann. xlviii. (1897), pp. 70-74. §
Messenger of Math. xxix. (1900), pp. 122-128. li The reader will see
later \hardsectionref{12}{2} example 4) that this limit may be written

%
% 237
%

\Subsection{12}{1}{1}{Euler's TODO formula for the Gamma-function.}

By the definition of an
infinite product we have

TODO

Hence T (.) = - H j(l + -j (l +,;j | .

This formula is due to Euler*; it is valid except when = 0, - 1, - 2,
....

Example. Prove that

,,,. 1.2...(n-l)

r (2) = hm, .,. 7- - - . n\

\addexamplecitation{Euler.}

VlVl. The difference equation satisfied by the Gamma-function.

We shall now shew that the function F (z) satisfies the difference
equation

T z -l) = zT z). For, by Euler's formula, if z is not a negative
integer,

FU + 1)/F(.) = -

lim n

;h -* X = 1

(1 +

V n

ly+r

1 +

z+ 1

1 lim n ii

m-*---c ? =1

1 +

1 J

= - lim II,

  + 1, -*x = 1 I + ?i +

, . m + 1

= z hm = z.

 i x 2: + Wi + 1

This is one of the most important properties of the Gamma-function.
Since F (1) = 1, it follows that, if 2: is a positive integer, F (2 )
= (2 - 1) !.

It was given in 1729 in a letter to Goldbacb, printed in Fuss'
Corresp. Math.

%
% 238
%

Example. Prove that

[Consider the expression

111 1

z z z- ) 2(s + l)(2 + 2) z z + l)... z+m)

in d

It can be expressed in partial fractions in the form 2 -, where

\ (-) / \ \ 1 1 ]\ (-)" f °° 1

"=1 e "'( -)"!( =" 11

Noting that 2 -,<-, itt-t, prove that 2 - .- \ 2 -;h- 0 as

r=m-ri+\ r\ m-n + l)\ n=o n\ z + n [r=m-n+irl]

m- <X) when z is not a negative integer.]

\Subsection{12}{1}{3}{The evaluation of a general class of infinite products.}

By means of the Gamma-function, it is possible to evaluate the general
class of infinite products of the form

n Un,

7t = l

where Un is any rational function of the index n.

For, resolving m into its factors, we can Avrite the product in the
form

* f (n -a )(n-a2) ...(n- ak) ]

n=i[ (n-b,).: n-bi) I'

and it is supposed that no factor in the denominator vanishes.

In order that this product may converge, the number of factors in the
numerator must clearly be the same as the number of factors in the
denominator, and also A 1; for, otherwise, the general factor of the
product would not tend to the value unity as n tends to infinity.

We have therefore k= I, and, denoting the product by P, we may \ vrite

 =i ] n-b ) ... n-bk)i ' The general term in this product can be
written

(- (- )(-r-(-r

a + a + ... +ak-b,- ...-bk . = 1 - - h Jin

n

where 4 is (h~-) when n is large.

In order that the infinite product may be absolutely convergent, it is
therefore necessary further \hardsectionref{2}{7}) that

tti + . . . + Ojk - 1 -   - /fc = 0.

%
% 239
%

We can therefore introduce the factor

exp /i-i ( ! + ... +ak-b,- ... - hk)

into the general factor of the product, without altering its value;
and thus we have

p= n

(i\ ), (i\ )e"...(i- *)."

"=N (- )--(- )-

But it is obvious from the Weierstrassian definition of the Gamma-
function that

,"|('" )''"]"- r(- )e-T''

and so P = r(- 6,)6,r(-6 (- .) TJ l-K) . a T -CH)...akV -ak), =
ir(l-a )

a formula which expresses the general infinite product P in terms of
the Gamma-function.

Example 1. Prove that

 " (a-i-6 + ) \ r(a + l)r (6-1-1) s=i (a+ ) (6-l-s) T a + b + ) '

Example 2. Shew that, if a = cos (27r/n) + i sin 27r jn\ then

/ \ / \ - -

 (i- j(i-|;)... = -r(-x )r(-aa- )...r(-a"-i:r ) -'.

\Subsection{12}{1}{4}{Connexion between the Gamma-function and the circular functions.}

We now proceed to establish another most important property of the
Gamma-function, expressed by the equation

r( )r(i-. )= .- .

sm TTZ We have, by the definition of Weierstrass \hardsectionref{12}{1}),

r(.)r(-.)=-in (i+i)r rnj(i-i);"

Z Sin TTZ

by \hardsectionref{7}{5} example 1. Since, by \hardsubsectionref{12}{1}{2},

r(i-z) = -zr(-z)

we have the result stated.

%
% 240
%

Corollary 1. If we assign to z the value \, this formula gives r( ) 2
= 7r; since, by the formula of Weierstrass, r ( ) is positive, we
have

Corollary "l. If r/.(s) = r'(s)/r(2), then i/ (1 -z)-- /r (0) = 7r cot
tts.

\Subsection{12}{1}{5}{The multiplication-theorem of Gauss* and Legendre.}
We shall next obtain the result

r(.)r(. + )r(. + )...r(. + 'i ) = (2.)n -. - -rM.

n) \ n For let ( (.) = iT;; \ .

Then we have, by Euler's formnla \hardsubsectionref{12}{1}{1} example),

 - 1 .2...(m- l).m - /'*

n'"- n lim

 (Z)

,. 1 . 2 ... (m - 1) . (nm)'*

n lim

\ im - 1)! m

nz (nz + 1 ) . . . (71Z + n7n - 1)

 n'ln - 1) ! nm)'" i(m- 1) !j wi" 'n

m oo (wm-1)!

It is evident from this last equation that <p (z) is independent of z.
Thus (j) (z) is equal to the value which it has when z = -; and so

Therefore < (z)Y = n| | T ( -) T (l -;:)|

tt' -i (27r)"-

. TT . 27r . (?i- l)7r

sm - sm - ... sm

n n n

Thus, since cj) (n~ ) is positive,

<,W = (2,r)4<"-'' -*,

i.e. r (.) r (. + ) . . . r (. + '-i i) = - (2,r)4 < - '> r ( .).

Corollary. Taking n = 2, we have

2 -ir(.)r( +i)=,r4r(24

This is called the duplication formula.

* Werke, iii. p. 149. The case in which n - 2 was given by Legendre.

%
% 241
%

Example. If (, o) = EMlM

shew that

D(p,,)b p + \ q)...B(p ',q) B (np, no) = a ~ i \ n /

\Subsection{12}{1}{6}{Expansions for the logarithmic derivates of the Gamma-function.}

We have r (2+l) -J = '>' n /("l + -") e~ ]- .

DifiFerentiating logarithmically \hardsectionref{4}{7}), this gives

l gJ iiiLi)= \ + !\ + --,,

rfs ''' 1 (2 + 1) '*"2(2 + 2) " 3(2 + 3) ""

Therefore, since log r (s + 1 ) = log 2 + r (2), we have

Iogr(2)=-y--.+ 2 2

dz ° ' z n=in(2 + n)'

d-. \,,. (f

Differentiating again,,logr(.+ l) = + 2 (2 + 2) + -

1 1

 (2+l>' (2 + 2)2 ""

These expansions are occasionally used in ai)plications of the theory.
\Section{12}{2}{Elder s expression of T z) as an injinite integral.}

The infinite integral I e~H ~ dt represents an analytic function of z
when*

Jo

the real part of z is positive \hardsubsectionref{5}{3}{2}); it is called the Eulerian
Integral of the Second Kindf. It will now be shewn that, when li z)>0,
the integral is equal to F (z). Denoting the real part of z by x, we
have x > 0. Now, if J

n(z,n)=j'Ul-yJ\'- dt,

we have U (z, n) = n l (1 - TyW-'hlr,

J )

if we write t= nr; it is easily shewn by repeated integrations by
parts that, when a; > and n is a positive integer,

f n 1 n; !

 1 - t)"t - dr = - T- (1 - Tf + - (I - Tf-'T'dr Jo \ J Jo S'.

n(n-l)...l fi,

z(5 + l)...( + n-l)Jo '* '

J n / \ 1 . 2 . . . ?i

and so 11 (2, n) = -. - n

z z ) ... z -n)

Hence, by the example of \hardsubsectionref{12}{1}{1}, 11 z, n) r( ) as /i -* x .

* If the real part of z is not positive the integral does not converge
on account of the singu- larity of the integrand at f = 0.

t The name was given by Legendre; see \hardsectionref{12}{4} for the Eulerian
Integral of the First Kind.

t The many-valued function < ~i is made precise by the equation *~i =
c(*-i)'°s', log r being purely real.

W. M. A. 16'

%
% 242
%

Consequently F ( ) = lim (1 ) t-~ dt.

And so, if T, (2) = I e-H'-'dt,

J (\ we have

ri( )-r( )= lim r ie-'-(l- y\ t'-'dt+j e-H'-'dt .

Now lim I e'U'-'dt = 0,

since I e~H ~ dt converges.

.'0

To shew that zero is the limit of the first of the two integrals in
the formula for Fj z) - F(z) we observe that

[To establish these inequalities, we proceed as follows : when < y <
1, from the series for e and (1 - 3/)" Writing tjn for y, we have

1 + - e-'

n

HJ-

and so 0 e- -fl--

71

= e-Ml-eM 1

<e-Ml- 1

-1)1

Now, if O-Sa l, (1 - a)" l - na by induction when ?ia<l and obviously
when 7ia 1; and, writing t /n for a, we get

and so* 0 e-*-(l--) %e-H ln,

which is the required result.]

From the inequalities, it follows at once that

r' - f 1 - - j ) t'-'dt ' I n-'e-ff'- 'dt

<n-'j e-H' - 'dt O, Jo

as n - X, since the last integral converges.

* This analysis is a modification of that given by Schloinilch,
Compendium der hoheren Analysis, ii. p. 243. A simple method of
obtaining a less precise inequality (which is sufficient for the
object required) is given by Bromwich, Infinite Series, p. 459.

%
% 243
%

Consequently Fi 2)= V (z) when the integral, by which Tj (z) is
defined, converges; that is to say that, when the real part of z is
positive,

J n And so, when the real part of z is positive, F (z) may be defined
either by this integral or by the Weierstrassian product. Example 1,
Prove that, when R (z) is positive,

Example 2. Prove that, if li z) > and R (s) > 0,

/ e-"=x -'cla.-= . Jo z

Example 3. Prove that, if R z)>Q and R is) > 1,

Example 4. From :; 12'1 example 2, by using the inequality

0%e- -( X fie- ln,

deduce that

l\ e- \ e-i/<

-at.

<

t

\Subsection{12}{2}{1}{Extension of the infinite integral to the case
  in which the argument of the Gamma-function is negative.}

The formula of the last article is ni> longer applicable when the real
part of z is negative. Cauchy* and Saalschiitzt have shewn, however,
that, for negative arguments, an analogous theorem exists. This can be
obtained in the following way.

Consider the function

r, z)=j\'- (e-'-\ + t-, + ... + -)>'- dt,

where k is the integer so chosen that -k>x>-k-l, x being the real part
of z. By partial integration we have, when s < - 1,

r,(.)=[f(.-.-n.<-il + ...+(-r.,)];

+.'j7''( -'-i+'--+(-''(j )*

The integrated part tends to zero at each limit, since x+k is negative
and x + k + l is positive : so we have

r, z) = lT, z+i).

The same proof applies when x lies between and -1, and leads to the
result

r z+i)=zr2 z) (0>.r>-i).

The last equation shews that, between the values and -1 of a*,

To z) = r(z).

* Exercices de Math. u. (1827), pp. 01-92.

t Zeitschrift fur Math, und Phys. xxxii. (1887), xxxiii. (1888).

16-2

%
% 244
%

The preceding equation then shews that To z) is the same as T (2) for
all negative values of Ji z) less than -1. Thus, for all negative
values of R(z), we have the result of Cauchy and Saalschiitz

where k is the integer next less than - B (z).

Example. If a function P (ft) be such that for positive values of /x
we have

J

- 1 -x

e~'-' dx,

and if for negative values of /x we define Pj (fi) by the equation

dx.

Pi(;u)=|\ i'--i(e- -l + .r-... + (-)*- + i,)

where k is the integer next less than - ju, shew that

/',W./'W-l + -... + (-)'--.-,. \addexamplecitation{Saalschiitz.}

\Subsection{12}{2}{2}{Hankers expression of TODO as a contour integral.}

The integrals obtained for T z) in
\hardsectionref{12}{2}, \hardsubsectionref{12}{2}{1} %TODO:cite multiple
are members of a
large class of definite integrals by which the Gamma-function can be
defined. The most general integral of the class in question is due to
Hankel*; this integral will now be investigated.

Let D be a contour which starts from a point p on the real axis,
encircles the origin once counter-clockwise and returns to p.

Consider 1 (-t)~~ e~hlt, when the real part of z is positive and z is
not an integer.

The many-valued function (- ty~ is to be made definite by the
convention that (- ty~ = e' ~ ' ° '"*' and log (- t) is purely real
when t is on the negative part of the real axis, so that, on D, - ir %
arg (- t) % it.

The integrand is not analytic inside D, but, by \hardsectionref{5}{2} corollary 1, the
path of integration may be deformed (without affecting the value of
the integral) into the path of integration which starts from p,
proceeds along the real axis to h, describes a circle of radius h
counter-clockwise round the origin and returns to p along the real
axis.

On the real axis in the first part of this new path we have arg (- ) =
- tt, so that - ty~' - e~ '' ~ H ~ (where log i is purely real); and
on the last part of the new path (- ty- = e " ' - ' t ' .

On the circle we write - i = 8e*; then we get

f -ty-'e-Ht-= \ e-'-(--i) '-ie-'f? +f"(8e' )--ie (cose+;sm< )gg,ej 7

+ ''e' ' -' H'-' e' dt = - 2i sin -jTz) j t'-' e-hit + ih' I " e<>e+
(cose+tsine) \

* Zeitschrift filr Math, und Phys. ix. (1864), p. 7.

%
% 245
%

This is true for all positive values of S p; now make S; then 8' and
I gize+s (COS 0+isin e 0 j ize iQ [ \ \ q integrand tends to its limit

J - TT J -IT

uniformly.

We consequently infer that

[ (-ty-'e-'dt = -21 sin 7r2)[''t'-'e-*dt.

J B Jo

This is true for all positive values of p; make p x, and let C be
the limit of the contour D.

Then f (- ty-'e- dt = - 2i sin ttz) f t'-'e- dt.

J c Jo

Therefore T ( ) = - r 4 I (- tf-'e-'dt.

'2i sm TTzJ c

Now, since the contour C does not pass through the point t = 0, there
is no need longer to stipulate that the real part of 2 is positive;
and

I (-ty~ e~ dt is a one-valued analytic function of z for all values of
2.

J c

Hence, by \hardsectionref{5}{5}, the equation, just proved when the real part 0/2 is
positive, persists for all values of z with the exception of the
values 0, ±1, +2

Consequently, for all except integer values of,

r(0) = -\ J - I -ty-'e-'dt.

This is Hankel's formula; if we write 1 - 2 for z and make use of
\hardsubsectionref{12}{1}{4}, we get the further result that

We shall write / for \, meaning thereby that the path of inte-

1 re C

gration starts at 'infinity' on the real axis, encircles the origin in
the positive direction and returns to the starting point.

Example 1. Shew that, if the real part of z be positive and if a be
any positive

constant, l - t)~ e~ dt tends to zero as p -ao, when the path of
integration is either of

the quadrants of circles of radius p + a with centres at - a, the end
points of one quadrant being p and - a + 1 (p -|- a), and of the other
p and -a - i p- a).

V

' (0 + )

%
% 246
%

Deduce that lim I " ' t)-' e- dt= lim I -t)-'e- dt,

p-*xy-a + 'P p- y J C

and hence, by writing t= -a-iu, shew that

\ \ ['

--- = -- I e "*- " (a + <)"* f M- r (s) ztt y \ x

[This formula was given by Laplace, Theorie Analytique des
Prohahilites (1812), p. 134, and it is substantially equivalent to
Hankel's formula involving a contour integral.]

Example 2, By taking a = 1, and putting t= -\ + i tan B in example 1,
shew that -J- = - ( "" cos (tan (9 - 2(9) cos - 2 (9c?<9.

r (2) 77 Jo

Example 3. By taking as contour of integration a parabola whose focus
is the origin, shew that, if a > 0, then

Y z)=-. - - e- ''(l + -) -Jcos 2a + (22-l)arctani; (/i!. sin nz J

\addexamplecitation{Bourguet, Acta Math, i.}

Example 4. Investigate the values of x for which the integral

2 r*

 - sin tdt

TT J

converges; for such values of x express it in terms of
Gamma-functions, and thence shew that it is equal to

\addexamplecitation{St John's, 1902.}

Example 5. Prove that I (log t)" ' dt converges when m > 0, and, bv
means

Jot

of example 4, evaluate it when m=l and when m = 2.
\addexamplecitation{St John's, 1902.}

\Section{12}{3}{Gauss' expression for the logarithmic derivate of the
  Gamma-function as an infinite integral*TODO.}

We shall now express the function -7- log V (z) = as an infinite

integral when the real part of z is positive; the function in
question is frequently written yjr (z). We first need a new formula
for 7.

Take the formula \hardsectionref{12}{2} example 4)

  Jo i J\ i 5 0 Us J t / a olJA J\& t J'

where A = l-e- since | - = log .- O as 8-*-0.

./a l-e"

 Yriting = 1 -e~" in the first of these integrals and then replacing u
by t we have

y= lim I r,dt- r '- dt] = r \ j~,-]] e- dt.

5-*o Us l-e Js t J Jo U-e ' t)

This is the formula for y which was required.

* Wtr'ke, HI, p. 159.

%
% 247
%

To get Gauss' formula, take the equation \hardsubsectionref{12}{1}{6})

r'( ) 1 .. /I 1 \

T z) ' z acm=iVm z-vm)

1 r

and write = e-'( +'">rf;

z - m Jo

this is permissible when m = 0, 1, 2, ... if the real part of z is
positive.

It follows that

 '=-7- I e- ? + lim S (e-""-e-(' + )')f <

.0 rt\rightarrow \inftyJowi = l

r( )

-7+ lim = -I dt

1-

V 1 - e-'

W - lim 1 -e-(''+ '(/t

1-e-

Now, when < < 1, i is a bounded function of t whose limit as - [0 is
6nite;

I 1 - e 'I

and when t 1, - | < - J- < - .

Therefore we can find a number A' independent of t such that, on the
path of integration,

I 1 - ' I

andso I r\ zl~,-K ' Vdt\ < K[ e-i"*')' rf = /r(H + l)-' 0 as /i- -x .

I jo 1-e-' ./o

We have thus proved the formula

t< ) = s'" ' *'->=.C(T-r ')'"-

which is Gauss' expression of - z) as an infinite integral. It may be
remarked that this is the first integral which we have encountered
connected with the Gamma-function in which the integrand is a
single-valued function.

Writing <=log (1 -f-.i') in Gauss' result, we get, if A=(J - 1,

 -if=limf t'-,,U.

since < I - dt < j y =log - g- 0 as 8 0.

T'(z),. / " f 11 rf.r

Hence \ = uaj |,-.\ \ \ \ |\,

sothat ''<=)=rM/J e-'-(, §',

an equation due to Dirichlet*.

Werke, i. p. 275.

%
% 248
%

Example 1 . Prove that, if the real part of z is positive,

Example ± Shew that y=\ l -t)-' -e- ]t-' dt. \addexamplecitation{Dirichlet.}

\Subsection{12}{3}{1}{Binet's first expression for TODO in terms of an infinite integral.}

Binet* has given two expressions for logr( ) which are of
great

importance as shewing the way in which log V z) behaves as ] 2 j -* oo
. To

obtain the first of these expressions, we observe that, when the real
part of

z is positive,

r' /'-r \ L 1 \ r* (o-t o-tz ]

dt,

r( + i) Jo [ e -i

writing z + \ for 2 in \hardsectionref{12}{3}.

Now, by \hardsubsubsectionref{6}{2}{2}{2} example 6, we have

log2=) - r~ '

f" 1 and so, since (22 )" = e~ dt,

'Jo

we have

dz

logr(. + l) = l + log.-/"g-;+ - Je-*.

The integrand in the last integral is continuous as i -; and since

- - - + -f - z. is bounded as - 00, it follows without difficulty
that the

integral converges uniformly when the real part of z is posijiive; we
may consequently integrate from 1 to under the sign of integration
(\hardsubsectionref{4}{4}{4}) and we get-f-

iogr(.+i) = (. + |)iog.-.H-i+/;g- + p-- -

dt.

Since - - + - - i 7 continuous as i - by \hardsectionref{7}{2}, and since

log r (z + 1) = log + log r (z),

have

/ 1\ (" CI 1 1 ) e-*

iogr(.) = (.-2)iog.-. + i.-j |--- + - \ -- |- .

J (2 t e' - l)t

* Journal de I'Ecole Poly technique, xvi. (1839), pp. 123-143.

t Logr(2 + l) meaus the sum of the principal values of the logarithms
in the factors of the Weierstrassian product.

%
% 249
%

To evaluate the second of these integrals, let*

so that, taking z = in the last expression for logr(2:), we get

i log 7r = i + t/-/.

( + - ) - - dt, we have

t

r ' 1 \ dt

-jo V t e'- ) t

=/:r- '-HT

~jo 1 c/ V t ) t ' '2tj

* - rf<

t

= 2 + Uogi Consequently /=1- log(27r).

We therefore have Binet's result that, when the real part of z is
positive,

3-tZ

 -dt.

log r( ) = [z- \ ogz-z + \ log(27r) + J G ~ 7 + "'-t)

li z = x- iy, we see that, if the upper bound of ( ~ 7 " t \ i ) 7 ' *
' values of is K, then

logr( )-( -i)log + -|log(27r)'<i(:| "'"

so that, when x is large, the terms (z - \ og z - z \ o (2'jr) furnish
an

approximate expression for log V (z).

Example I. Prove that, when A' (a) > 0,

logr(.-)= r *i4.1-r+( -l) "j 7- \addexamplecitation{Malmsten.}

Example 2. Prove that, when R (z) > 0,

* This artifice is due to Priagsheim, Math. Ann. xxxi. (1888), p. 473.

%
% 250
%

Example 3. From the formula of \hardsubsectionref{12}{1}{4}, shew that, if <;r < 1,

2logrW-log.+logsin..-=/; |-' Ui=fl-'-(l-2.).-. f .

\addexamplecitation{Kummer.}

Example 4. By expanding sinh (| - .v) and 1 - 2x' in Fourier sine
series, shew from example 3 that, if < .v < 1,

00

log r (.p) = i log TT - - log sin -nx + 2 2 a,i sin 2?i7r,

, / " r 2?i7r e-n dt

" jo V + 4wV2 27rJ i! Deduce from example 2 of \hardsubsectionref{12}{3} that

"*" "" 2 " "*" 2"" + * g ''* )

(Kummer, Journal fiir Math. xxxv. (1847), p. 1.)

\Subsection{12}{3}{2}{Binet's second expression for log V z) in terms of an infinite integral.}

Consider the application of example 7 of Chapter vii (p. 145) to the
equation \hardsubsectionref{12}{1}{6})

The conditions there stated as sufficient for the transformation of a
series into integrals are obviously satisfied by the function ( )= -
r-, if the real part of z be positive; and we have

Since !5'(, + /i) I is easily seen to be less than K t/n, where Ki is
inde- pendent of t and n, it follows that the limit of the last
integral is 'zero.

Hence V;: log F ( ) = 2,- -I i - -, - -.

dz 2z- z Jo z + t'f e- - 1

I 2 I Since ~ - - does not exceed K (where K depends only on 8) when
the

I I*

real part of z exceeds 8, the integral converges uniformly and we may
integrate under the integral sign \hardsubsectionref{4}{4}{4}) from 1 to z.

We get

-I log r (.) = -;+ log . + - 2 /; . JL,

where C is a constant. Integrating again,

log r (.) = (. - 1) log . + (c - 1) . + c + 2/; '- dt.

where 6" is a constant.

%
% 251
%

Now, if z is real, arc tan tjz \$ tlz,

and so

logrW-( -i)log -(C-l).-C"|<?/" d(.

But it has been shewn in \hardsubsectionref{12}{3}{1} that

\ \ % z)-[z-- \ ogz- z- \ og 1'K) -0,

as 2 -* X through real values. Comparing these results we see that C =
0, 6"=ilog(27r).

Hence for all values of z whose real part is positive,

logrW = (.-l)log.-. + llog(2.) + 2|; -I rf*.

where arc tan u is defined by the equation

arc tan xi = |,

.'o l+<-

in which the path of integration is a straight line.

This is Binet's second expression for log V z).

Example. Justify differentiating with regard to z under the sign of
integration, so as to get the equation

12 33. The asymptotic expansion of the logarithm of the Gamma-
function (Stirling's series).

We can now obtain an expansion which represents the function log F z)
asymptotically \hardsectionref{8}{2}) for large values of \ z\, and which is used in
the calculation of the Gamma-function.

Let us assume that, if = x -f iy, then a-' S >; and we have, by
Binet's second formula,

log r ( ) = ( - ) log - + - log (27r) + </) ( ),

where (.) = 2/; c/.

Now

(\ )n-i 2,1-1 (\ y rt u n

arc

,,,,, t It' It' (\ )n-i 2n-i (\ )H rt

u + z' Substituting and remembering \hardsectionref{7}{2}) that

Jo e' ' -l ~4w'

%
% 252
%

where Bi, Bo, ... are Bernoulli's numbers, we have

  / X V (-)' "' Br 2 (-)'* r " f f U' ' du \ dt

.=1 2r (2?- - 1) '--l 271-1 j \ [ ! () 2 2 + 2 j g2,r< \ I

Let the upper bound * of - 1 for positive values of u be K,

j w + j

Then

ftl

f u' 'du] dt 1 r, I, r" 1 r, ) (

uow + ' j e-' '-li" ' ' Jo [Jo \ e'-'-l

Ji-z n+1

 4(n+l)(2M+l)| |2" Hence

2(-y r ( f* u l \ d KA+

z "-' Jo Vou' + z e -l 2 n + l) 2n + l)\ z p +i '

and it is obvious that this tends to zero uniformly as | | - oo if I
arg | tt - A, where tt > A > 0, so that K cosec 2 A.

Also it is clear that if ] arg r | Itt (so that Kz = l) the error in
taking the first 71 terms of the series

I (-y-'Br 1

rti 2r (2r - 1) z -' as an approximation to <f) (z) is numerically
less than the (n + l)th term. Since, if | arg z\ \ 7r - A,

-,211-1

!</> ( ) - i Z ' \ I < cosec 2 A .,

r r=i 2r(2r-l)l; 2(n + l)(2,

2(n + l)(2n + l)

-0,

as 00, it is clear that

B, B, B,

1.2.2 3. 4. 2=* ' 5.6.2 "* is the asymptotic expansion f \hardsectionref{8}{2}) of
(2). We see therefore that the series

is the asymptotic expansion of log V z) when | arg | tt - A.

-Kj 18 the lower bound of -!, .j and is consequentlj' equal to

4 2y2,

, 9, .n o or 1 as x2<m2 or x >y . t The development is asymptotic;
for if it converged when | 2 | p, by \hardsectionref{2}{6} we could find K, such that
B <(2;i-l)2nA>2"; and then the series 2 ~ "~' " " would define an
integral function; this is contrary to \hardsectionref{7}{2}.

%
% 253
%

This is generally known as Stirling s series. In \hardsectionref{13}{6} it will be
estab- lished over the extended range | arg tt - A.

In particular when z is positive (= x), we have

r u? du'] dt Bn+.

Jo Uo w + j e ' '-l

w + je ' '-l 2 n + l) 2n + l)af

Hence, when x>0, the value of < )(oc) always lies between the sm7i of
n terms and the sum ofn + 1 terms of the series for all values of n.

D g

In particular < (f> (x) < - -, so that <f> (./) = y where < < 1.

Hence T x) = x'- - e'' i2'rrf e ' 'l

Also, taking the exponential of Stirling's series, we get

\ x .r-, a f 1 1 139 571 /'I

r ix) = e X ~ (27r) -,1 - 288 ~ 51840 ~ 2488320 "*" V

This is an asymptotic formula for the Gamma-function. In conjunction
with the formula T x + l) = xr x), it is very useful for the purpose
of com- puting the numerical value of the function for real values of
x.

Tables of the function logioT (. ), correct to 12 decimal places, for
values of .v between 1 and 2, were constructed in this way by
Legendre, and published in his Exercices de Calcul Integral, ii. p.
85, in 1817, and his Traite des fonctions elliptiques (1826), p. 489.

It may be observed that V (x) has one minimum for positive values of
.>;, when .r= 1-4616321..., the value of log,or(.r) then being
1-9472391....

Example. Obtain the expansion, convergent when R z) > 0,

\ og,T z) = z-l)\ og, z- z+ \ og, 27r) + J (z),

where in which

- W- 5 |, + | + 2 (- +1) (. + 2) 3 (.-+1) (.- + 2) z + S) -

and generally

c = r (x+l) x + 2) ... x + n- ) 2x - ) xdx. \addexamplecitation{Binet.}

J

\Section{12}{4}{The Eulenan Integral of the First Kind.}

The name Eulerian Integral of the First Kind was given by Legendre to
the integral

B (p, q) = f xP-' (1 - x)'i-' dec,

J

which was first studied by Euler and Legendre*. In this integral, the
real parts of p and q are supposed to be positive; and xp~, (1 - x) ~
are to be understood to mean those values of e( ~ ) °°* and
e('v-i)'°e(i- =) which correspond to the real determinations of the
logarithms.

* Euler, Nov. Comvi. Petrop. xvi. (1772); Legendre, Exercices, i. p.
221.

%
% 254
%

With these stipulations, it is easily seen that B (p, q) exists, as a
(possibly improper) integral \hardsectionref{4}{5} example 2).

We have, on writing (1 - *) for w,

B p,q) = B q,p).

Also, integrating by parts,

Jo L i Jo PJo

so that B p,q + l) = B p+l,q).

Example 1. Shew that

B p,q)= £ip + l,q) + B p,q + l).

Example 2. Deduce from example 1 that

B P,<l + )= B p,q).

Example 3. Prove that if n is a positive integei*,

,,, 1 . 2 ... M

B p,n + ) = -

p p + l)... p + n)\ Example 4. Prove that

Example 5. Prove that

r (2) = lim n B z, n).

\Subsection{12}{4}{1}{Expression of the Eulerian Integral of the First
  Kind in terms of the Gamma function.}

We shall now establish the important theorem that

R/.,, x\ r(m)r(n)

First let the real parts of m and n exceed |; then

r (m) r (n) = e-* '"-i c a; x g-?' if'- dy. Jo Jo

On writing a;'- for .t, and y for y, this gives

fR rR

V (m) r (n) = 4 lim e"*' x'-""-' dx x g-?/' /-"-i dy

= 4 lim e-( '+2'') 2m-iy2n-i( ( \

Now, for the values of m and n under consideration, the integrand is
continuous over the range of integration, and so the integral may be
con- sidered as a double integral taken over a square Sji. Calling the
integrand

%
% 255
%

f x, y), and calling Qg the quadrant with centre at the origin and
radius R, we have, if Tji be the part of S, outside Qb,,

I f(x, y) dxdy - f oc,y) dxdy JJsr JJqr I

= 1 f(a:,y)dxdy

 JJ Tr

i \ f >y)ida dy-\ \ \ f,y)dxdy\

JJSr JJ Sir

  . ., .,

- 0 as R X,

since 1 1 |/(;, y) \ dxdy converges to a limit, namely

JJ Sr

Therefore

Imi

2 I e- '-, x""-' idxx2\ e' \ y-''-' \ dy. Jo' Jo

I f(x,y)dxdy= lim // f x,y)dxdy.

Changing to polar* coordinates x = rcos 0, y = r sin 6), we have f x,
y) dxdy = |

Oh

Hence

1 1 f x, y) dxdy = ( \ e-"" (r cos 0) '"-' (r sin 0)-''-' rdrd0.

J J Or J J

r (w) r ( ) = 4 e-r' r-('"+")-i dr cos=" -i sin ' - c? Jo Jo

= 2r ( i + ?z) cos '"-' sin ''- <9c? .

Jo

Writing cos- = u we at once get

r (m) r (?i) = r (?u + ) . z (w, ?i).

This has only been proved when the real parts of ni and n exceed |;
but it can obviously be deduced when these are less than | by TODO
example 2.

This result, discovered by Euler, connects the Eulerian Integral of
the First Kind with the Gamma-function.

Example 1. Shew that

[' (l-f-A-)' -i(l-.r) -i( =2P + 9-i Mli2).

  -I ' ' ip+q)

  * It is easily proved by the methods of \hardsubsectionref{4}{1}{1} that the areas A /x of
  \hardsectionref{4}{3} need not be rect- angles provided only that their greatest
diameters can be made arbitrarily small by taking the number of areas
sufficiently large; so the areas may be taken to be the regions
bounded by radii vectores and circular arcs.

%
% 256
%

Example 2. Shew that, if

j\ isj .v x + 1 2! .r + 2 3! .r + d

then

f x,y)=f y + \,x-\ \

where and y have such vakies that the series are convergent. (Jesus,
1901.)

Example 3. Prove that

j'J'j xy) l-xT- y> i yr- dxdy = - > 'j

\addexamplecitation{Math. Trip. 1894.}

\Subsection{12}{4}{2}{Evaluation of trigonometrical integrals in terms of the Gamma-function.}

We can now evaluate the integral cos" ~ x sm' ~ xdx, where m and n

Jo

are not restricted to be integers, but have their real parts positive.
For, writing cos o; = t, we have, as in \hardsubsectionref{12}{4}{1},

I'*" .,, IF am) ran)

cos' - cc sin" -1 xdx = f. ' - .

The well-known elementary formulae for the cases in which m and n are
integers can be at once derived from this result.

Example. Prove that, when \ k\ < .\,

fh CDS'" e sin' edd \ T (lm+ )T /i+ ) fh cos'" -'"Odd J \ l ksm 6)i ~
Tlh-a + hi+l) 7r J (l - k sin2 )i + *

\addexamplecitation{Trinity, 1898.}

\Subsection{12}{4}{3}{Pochhammers* extension of the Ealerian Integral of the First Kind.}

We have seen in \hardsubsectionref{12}{2}{2} that it is possible to replace the second
Eulerian integral for F(z) by a contour integral which converges for
all values of z. A similar process has been carried out by Pochhammer
for Eulerian integrals of the first kind.

Let P be any point on the real axis between and 1; consider the

integral

r(i+,o+, 1-, 0-) e-'"'<' + ) t - (1 - 0 -' dt = e a, /3).

J F

The notation employed is that introduced at the end of \hardsubsectionref{12}{2}{2} and
means that the path of integration starts from P, encircles the point
1 in the positive (counter-clockwise) direction and returns to P, then
encircles the origin in the positive direction and returns to P, and
so on.

, * Math. Ann. xxxv. (1890), p. 495.

%
% 257
%

At the starting-point the arguments of t and - t are both zero; after
the circuit (1 +) they are and l-ir; after the circuit (0 +) they are
Itt and 27r; after the circuit (1 - ) they are lir and and after the
circuit (0 - ) they are both zero, so that the final vahie of the
integrand is the same as the initial value.

It is easily seen that, since the path of integration may be deformed
in any way so long as it does not pass over the branch points 0, 1 of
the integrand, the path may be taken to be that shewn in the figure,
wherein the four parallel lines are supposed to coincide with the real
axis.

>

// the real parts of a. and y9 are positive the integrals round the
circles tend to zero as the radii of the circles tend to zero*; the
integrands on the paths marked a, h, c, d are

 a-Ig-'W(a-l) (1 \ )3-lg2.r<(8-l) a-l g2,r.(a-]) ( \ )fl-i

respectively, the arguments of t and 1 - nuiu being zero in each case.

Hence we may write e (a, ) as the sum of four (possibly improper)
integrals, thus :

e (a, /3) = e- '(''+ )

I t -' (1 - 0 "' + I t"-' (1 - 0 ~'e-''

 dt

C 1 /""

+ t"-' (1 - tf-' e -'t"* ) dt + -' (1 - tf-'e- ' dt . .' 1

Hence

€ (a, /3) = e- '(' - ) (1 - e---) (1 - e ' ) f -' (1 - tf-' dt

JO

, ., ., l (a)r(/9) = - -isin (a7r)sin (ott) ~

- 47r* "r(l-a)r(l-/: )r(a + )-

Now e (a, /S) and this last expression are analytic functions of a and
of /3 for all values of a and /S. So, by the theory of analytic
continuation, this equality, proved when the real parts of a and are
positive, holds for all values of a and l3. Hence for all values of a
and /3 lue have proved that

/ J -47r-

r i-cc)l\ l-id)l\ a+id)- ' The reader ought to have uo difficulty in
proving this.

AV. M. A.

17

%
% 258
%

\Section{12}{5}{Dirichlet's integral*TODO.}

We shall now shew how the repeated integral

/ = f f . . . I f t, + t,+ ...+ tn) i"'- o" - . . . tn' n-idt dt, . .
. dt

may be reduced to a simple integral, where/is continuous, a > (?* = 1,
2, ... n) and the integration is extended over all positive values of
the variables such that 1 + 4+ ... + tn \$1.

To simplify p'M f\ t + T+ ) t' -'T -'dtdT

Jo Jo

(where we have written t, T, a, j3 for t, t, cui, Og and X for 3 + 4
+ ... +tn), put t = T \ - v)/v; the integral becomes (if X. 0)

r~U' /(x + Tlv) l - vy-' V-''-' r-+3-i dvdT.

Jo J T/(l- )

Changing the order of integration \hardsubsectionref{4}{5}{1}), the integral becomes

( [ V( + T/v) l- vy-'v''-' T- -'dTdv. J J

Putting T = VTo, the integral becomes

I i /( + " 2) (1 - vy-' v -' r. + -' dr., dv J J

r (a)r(8) r -

r( + /3) Jo

Hence

  J|... j/(T. + 3+ ... +Qt/.+ -i 3" -i ... tn ' -'dr.dt, ... dtn,

r(,)r(,) r(e

the integration being extended over all positive values of the
variables such that T2 + ts + ... +tn- .

Continually reducing in this way we get

r((x, + a,+ ...+an) Jo- ' which is Dirichlet's result. Example 1.
Reduce

to a simple integral; the range of integration being extended over
all positive values of the variables such that

it being assumed that a, 6, c. a,, y, p, q, r are positive.
\addexamplecitation{Dirichlet.}

* Werkt, I. pp. 375, 391.

%
% 259
%

Example 2. Evaluate / / x yi dxdy,

m and n being positive and

' >0, 2/ 0, x>" + y " 1 . ( Pembroke, 1 907 . )

Example 3. Shew that the moment of inertia of a homogeneous ellipsoid
of unit density, taken about the axis of z, is

where a, 6, c are the semi-axes.

Example 4. Shew that the area of the epicycloid x-' +y =P is fn-r-.

REFERENCES. N. Nielsen, Handhnch der Theorie aer (Jamma-funktion*.
(Leipzig, 1906.) 0. ScHLOMiLCH, Compendium der ho her en Analysis, ll.
(Brun.swick, 1874,) E. L. LiNDELOF, Le Calcul des Residus, Ch. iv.
(Paris, 1905.) A. Pringsheim, Math. Ann. xxxi. (1888), pp. 455-481.

Miscellaneous Examples.

1. Shew that

\addexamplecitation{Trinity, 1897.}

2. Shew that

.,'i"i vr. rrp rTr.-i7i;""='"<"+"- '™'"' ' ' '>

3. Prove that

r'(i) T' (is)

f(i) ~ r(|) = S - (' ® " ' 2-)

4. Shew that

 r(i)! 32 52-1 72 92-1 IP . .

"16;; " = 3  5  r T  92  i -ZTi  \addexamplecitation{Trinity, 1891.}

5. Shew that

- f ( -a)(M+ + y ) a \ \ 1 .,, .,\,,

n \ - - --7-7 -; - r 1+, H- = - - sm (an) B (/3, y).

 =o I ( +/:<) ( +y) \ + l/j TT ' " '

\addexamplecitation{Trinity, 1905.}

6. Shew that ( ) ('Isf ' \addexamplecitation{Peterhouse, 1906.}

7. Shew that, if z = iC where is real, then

l l=\/(fSVc)- \addexamplecitation{Trinity, 1904.}

8. When x is positive, shew thatt

r (x) r (h) °° 2n ! 1

 . ., Tx = 2 -; - - - . \addexamplecitation{Math. Trip. 1897.}

* This work contains a complete bibliography.

t This and some other examples are most easily proved by the result of \hardsubsectionref{14}{1}{1}.

17-2

%
% 260
%

9. If a is positive, shew that

r( )r( +i) i ( -)" ( - 1) ((f - 2) ...(g-H) 1 r(2+ ) =o ! s+ '

10. If .V > and

JO

shew that

and

11. Shew that if X > 0,,c> 0, - tt <a <\ tt, then
$$
TODO
$$
\addexamplecitation{Euler.}

12. Prove that, if 6 > 0, then, when < s < 2,

/ - 7" dx = \ u\ f- cosec (J7rs)/r (s), y - and, when < s < 1,

/ * cosfto; \ J (a. .)/p (5), \addexamplecitation{Euler.}

\ / .

13. If < /i < 1, prove that

jj(l+.t'-cos -rf.r=r(,0 cos (f -1) - +,

\addexamplecitation{Peterhouse, 1895.}

14. By taking as contour of integration a parabola with its vertex at
the origin, derive from the formula

1 r** "")

2 sin an \ the result

1 f

r(a)= - -. / e- ''x"--' l+:c''-) [Ziim x + a?(.YCcot(-Jc)

2 sui utt J )

+ sin x + a - 2) arc cot ( - x) ] dx, the arc cot denoting an obtuse
angle.

(Bourguet, Acta Math. i. p. 367.)

15. Shew that, if the real part of a-n is positive and 2 l/a is
convergent, then

n = l

d' is convergent when m > 2, where \//-( ) (2) = -r log r (z). (Math.
Trip. 1907.)

16. Prove that

"jo 1'

d\ ogr z)\ /"e- g-e-g'

< 2

= r (l+a)-i-(l+a)- ---), Jo a

/ 1 .2 - 1 \ ] = / dx-y. \addexamplecitation{Legendre.}

Jo x-l

%
% 261
%

17. Prove that, when R z)>0,

\ ogr z)=r i- -xiz-l)] f- . \addexamplecitation{Bmet.}

18. Prove that, for all values of z except negative real values,

log r (2) = (3 - 1) log 2 - 2 + Uog (27r)

J 1 1 2 J; \ 3\ = J ]

19. Prove that, when (2) > 0,

-rlogr(2) = log2- / r j l-a.-+log.r .

dz ° ° Jo (l-.r)log.r

20. Prove that, when R (2) > 0,

c/2' °

21. If

shew that

/2+1 logr(Oo? = ?',

and deduce from \hardsubsectionref{12}{3}{3} that, for all values of 2 except negative real
value.s,

u = z log z - z + i log (2n-).

\addexamplecitation{Raabe, Jovnial fur Math, xxv.}

22. Prove that, for all wilues of 2 except negative real values,

sin 2nTrx

00 f dx' logr(2) = (2-i)log2-2 + Uog(27r)+ 2 / --

n=lj *+'

23. Prove that

(Bourguet*.

Bip,p)B p+h,p+h)= y \addexamplecitation{Binet.}

24. Prove that, when -(</<(,

r,,,1 /""" cosh (2n*) c?M

25. Prove that, when q>\,

B p, q) + Bip + \, q) + B p + 2, q) + ...=B p, q- ) .

26. Prove that, when p-a>0,

B p-ci,q) aq a(a + l) g(g + l)

 (i, ?) ' it;4-?'*' 1. 2. (/> + (/) (io + ? + l)

27. Prove that

B p, q)B p q, r) = B q, r)B q+r, p). \addexamplecitation{Euler.}

28. Shew that

n,,, .,, d.r r(a)r(b) 1

Jo " '' (.r+?>) + '' r(a + 6) (l+jo) jo"'

if a > 0, 6 > 0, p > 0. \addexamplecitation{Trinity, 1908.}

* This result is attributed to Bourguet by Stieltjes, Journal de Math,
(i), v. p. 432.

%
% 262
%

29. Shew that, if m > 0, n>0, then

n ( i+. )2 >-i (1 - -y n-i, \ r(m)r n)

and deduce that, when a is real and not an integer multiple of ijr,

'i /cos 6 + sin \ cos 2a

/'

\ i,r veos C - SUl

d6=.

and

30. Shew that, if a > 0, > 0,

/:

2 sin (tt cos a) '

\addexamplecitation{St John's, 1904.}

\addexamplecitation{Kummer.}

31 . Shew that, if a > 0, + 6 > 0,

fr(a)r(S) r(a + b)r 8)

r..r--(i- ) \,, lrw

Jo I-''*'' 5-0 I (a

l= / (a+6)- /'(a).

' + 8) T a + b + 8) Deduce that, if in addition a + c>0, a- b + c>0,

/l a-l (l\ b)(l\ . .c) r (t ).! ( ± \ +\ ' )

jo "(i-.r)(-log.r) * ~ *r(a + 6)r(a+c)" 32. Shew that, if a, b, c be
such that the integral converges,

fUl-x")(l-afi)(l-x'),, T b + c+l)T c + a + l)T a+b + l) ' a.v=los

JO (i-A-)(-log.r) '" '' °r(a + ' ) r b + l)r c + l)r a + h + c+l)' 33.
By the substitution cos = 1-2 tan <, shew that

(3-cos )5 4v/7r

\addexamplecitation{St John's, 1896.}

f sinP.v

34. Evaluate in terms of Gamma-functions the integral / ' dx, when /)
is a

J '*-"

fraction greater than unity whose numerator and denominator are both
odd integers.

[Shew that the integral is h I sin'' x\~+ 2 ( - )" ( 1 ) [ d.v.]

'- Jo l n=i \ x+mr x-mrj)

35. Shew that

\addexamplecitation{Clare, 1898.}

/:

93?-

2" + 2 r=o2/'!(n-r)

-a-mi-

36. Prove that

log Bip,g) log ( +i) 4- I ' \: '"\ \ l '" dv. \addexamplecitation{Euler.}

s v/', -/; °\ pq J j(, (1-V)l0g 7

37. Prove that, if p>0, p + s>0, then

B(p,p)

 '

s s~l), s(s-l)(s-2)(s-3)

 (P>P + )=- f7 ' l+ ( ) + 2.4.(2 +

fd i,-- - <--

38. The curve r"*=2'"~i a'"cos ??i is composed of ?n equal closed
loops. Shew that the length of the arc of half of one of the loops is

i~ a I (i cos x) ' dx, Jo

and hence that the total perimeter of the curve is

a iV

lm)\

%
% 263
%

39. Draw the straight line joiniug the points ±i, and the semicircle
of \ z\ = \ which lies on the right of this line. Let C be the contour
formed by indenting this figure at

- ?', 0, i. By considering / 2P- -i z + z- )p "-- dz, shew that, if p
+ q>l, q <l,

I " cosP*i--6 cos ip-q) 6 d6 =,, "!,, r.

Jo ip + q-l)2P i- B(p,q)

Prove that the result is true for all values of p and q such that p +
q>'l.

\addexamplecitation{Cauchy.}

40. If s is positive (not necessarily integral), and - in .r hn, shew
that

Mild draw graphs of the series and of the function cos*.i'.

41. Obtain the expansion

cos .f-2, r (*+i)[r(| +ia+i)r(i5- a+i) " r(h+?,a+i)raj- a+iy-]'

and find the values of x for which it is applicable. \addexamplecitation{Cauchy.}

42. Prove that, if /> > A,

22p-i r 2/>"- f 12 12.32 1 "|2

'"'''"=-A ""Wi'U + l i' 2(2yT3-) + 2.4.(2p+3)(2f+5)+ . '

\addexamplecitation{Binet.}

43. Shew that, if .c < 0, ./ + -- > 0, then

r(-.f) [-.f,(-..-)(l-.r) (-.r)(l- )(2-f ) 1 r(5) 1 5 - s(l+2) " z
l+z) 2 + z) j

and deduce that, when x + r> 0,

  Ina m +* ) \ f \ 4   -1), X '( -l)(- -2) \ f/-' r>) z z(z +
l) - z z + l) z + 2)

44. Using the result of example 43, prove that

logr(2 + a) = logr(0 + rtlogs

2z

fa

dt

a [\ \ { t)(2-t) ...(n-t)dt- f" t l-t) 2-t) ...(n-t)'

\ 5 .' .'o

nti n + l)z z+l) z + 2) ... z + n)

investigating the region of convergence of the .series.

(Binet, Journal de V Ecole polytechnique, xvi. (1839), p. 256.)

45. Prove that, if /> > 0, > 0, then

-. P-

B ip, q) = V- i (2 )* * "' '

%
% 264
%

where

II (p, g) = 2p - - T arc tan - - -. - -, -,

and p2 = 2 + q +pq-

46. If 6 =2*-'7r(l-i'r), F=2 - 7r(i-iA'),

and if the function F (,r) be defined by the equation

shew (1) that F o:) satisfies the equation

F x+ ) =xF x) +

r(l-A-)'

(2) that, for all positive integral values of x,

F x) = rix\

(3) that F(x) is analytic for all finite values of x,

1 (7 \ 2

(4) that "- "* '

47. Expand

F(x)= ~- r -r- log- 7

as a series of ascending powei's of a.

(Various evaluations of the coefficients in this expansion have been
given by Bourguet, Bull des Set. Math. v. (1881), p. 43; Bourguet,
Acta Math. ll. (1883), p. 261; Schlomilch,' Zeitschrift fiir Math,
und Phys. xxv. (1880), pp. 35, 351.)

48. Prove that the G-function, defined by the equation

G(z + ) = (2nf'e- ' + - n |(i+i)%-'+-'- /(2")|,

is an integral function which satisfies the relations

0 z + ) = V z)G z), (?(1) = 1,

(n !)'V6-' (n + 1) = 11 . 22 . 33 ... w". \addexamplecitation{Alexeiewsky.}

(The most important properties of the G-function are discussed in
Barnes' memoir, Quarterly Journal, xxxi.)

49. Shew that and deduce that

log Q J = / s cot Tvzdz-z log (27r).

50. Shew that

logrri + l)c <=i3log(2rr)-|3(2+i;+3logr(s + l)-logG'(s + l).


\chapter{Some Properties of Trees}
\label{sct_defining_clades}

\begin{figure}[t]
\centering
\includegraphics{oriented_graph.png}
 % oriented_graph.png: 485x393 pixel, 300dpi, 4.11x3.33 cm, bb=0 0 116 94
 \caption{An oriented graph (not a tree!), with edge orientation shown as arrows. Two paths are highlighted (cyan and blue). The cyan path starts at node A and ends at node E. Nodes B, C, D, and E are reachable from A. Node C is the direct successor of B in the cyan path; in the blue path the direct successor of B is F. The segment highlighted in red is \emph{not} a path.}
 \label{fig_oriented_graph}
\end{figure}

In the following, $T$ will be a rooted tree. We'll recall that a tree (rooted or not) is a connected, acyclic graph. By choosing one node to be the root (which we'll note $R$), and orienting all edges away from the root, we get an oriented graph. A \textit{path} along such a graph is a sequence of nodes such that there is an edge between two successive nodes, and that these nodes are ordered in the sequence as they are in the edge. The first node in the path is called the \textit{start} of the path, and the last node is its \textit{end}. We speak of a path \textit{from} the start \textit{to} the end, equivalently we say that the end is \textit{reachable} from the start. The nodes in a path are ordered: if $a$ and $b$ are in a path, then either $a$ is reachable from $b$, or $b$ is reachable from $a$, or $a = b$; furthermore if $a$ is reachable from $b$, then $b$ is \textit{not} reachable from $a$. If an edge connects $a$ to $b$, then $b$ is the \textit{direct successor} of $a$, and $a$ is the \textit{direct predecessor} of $b$
See figure {\ref{fig_oriented_graph}.

Although paths are not sets, we will (somewhat abusively, perhaps) use set notation with paths, unless there is a risk of confusion. Thus is $P$ is a path and $n$ is a node, then $n \in P$ means that $n$ is ``in'' $P$  or ``belongs to'' $P$ (strictly speaking, $n$ is reachable from the start of $P$, and the end of $P$ is reachable from $n$).

Now a few definitions - these are mostly renamings of graph-theoretical concepts, to make them more intuitive for phylogenetic trees.

\begin{dfn}
\label{def_ancestor}
Let $a$ and $b$ be two different nodes of $T$. We say that $a$ is an \textit{ancestor} of $b$, or (equivalently) that $b$ is a \textit{descendant} of $a$, if and only if there is a path from $a$ to $b$.
\end{dfn}

\begin{dfn}
\label{def_parent}
Let $P$ be a path in $T$, and $a, b$ two nodes in $P$ such that $b$ is the direct successor of $a$. We will call $a$ the \textit{parent} of $b$. We can say \textit{the} parent (rather than \textit{a} parent) of $b$ because i) $a$ lies on the path from $R$ to $b$ (which is unique), and ii) only one node on any path can be another node's direct predecessor. We also see that any node's parent is also its ancestor (which shouldn't be too surprising\ldots), since $b$ is reachable from $a$
\end{dfn}

\begin{dfn}
\label{def_child}
Let $P$ be a path in $T$, and $a, b$ two nodes in $P$ such that $b$ is the direct successor of $a$. We say that $b$ is a \textit{child} of $a$.
\end{dfn}

Note that a node has exactly one parent, except the root which has none. A node can have zero or more children, but we rarely ever encounter nodes with a single child. A node with no children is called a \textit{leaf}.

\begin{dfn}
\label{def_lineage}
A path that starts from the root we call a \emph{lineage}. By the definition of a rooted tree, there is always a lineage to $n$ for any node $n$, and this lineage is unique. So we can unambiguously talk of \textit{the} lineage of $n$ to mean the path from $R$ to $n$. We say that a set $L$ of nodes form a lineage if there exists $n \in L$ such that the path from $R$ to $n$ contains all and only elements of $L$.
\end{dfn}

\begin{figure}[b]
 \centering
 \includegraphics{prop_tree.png}
  \caption{A rooted tree}
 \label{fig_app_tree_prop}
\end{figure}

\begin{prop}
\label{prop_lineage_ancestors_equivalence}
Let $n$ be a node of $T$, and $L$ its lineage. Then all ancestors of $n$ belong to $L$, and all nodes of $L$, except $n$ itself, are ancestors of $n$.
\end{prop}

\begin{proof}

$\Rightarrow$ Let $a$ be an ancestor of $n$. By definition \ref{def_ancestor}, there is a path from $a$ to $n$. By tree properties, there is a path from $R$ to $a$. Hence $a$ belongs to the path from $R$ to $n$, which is the lineage of $n$.
\end{proof}

\noindent{}$\Leftarrow$ Let $l \neq n$ be a node in $L$. Since $L$ is the path from $R$ to $n$, $n$ is reachable from $a$, and hence $a$ is an ancestor of $n$ by definition \ref{def_ancestor}.

\begin{dfn}
If $L$ and $M$ are lineages of $T$, then the \textit{intersection}
of $L$ and $M$, noted $L \cap M$, is the set of nodes that belong to both $L$ and $M$.
\end{dfn}

\begin{lemma}
\label{lem_ancestors_in_lineage}
Let $n$ be a node of $T$, $L$ its lineage, and $l$ a node of $L$. Then $l$'s ancestors also belong to $L$.
\end{lemma}
\begin{proof}
If $l = n$ then the ancestors of $l$ are those of $n$, which belong to $L$ by proposition \ref{prop_lineage_ancestors_equivalence}. If $l \neq n$ then let $a$ be an ancestor of $l$. By definition \ref{def_ancestor}, $l$ is reachable from $a$. By proposition \ref{prop_lineage_ancestors_equivalence}, $l$ is an ancestor of $n$ and again $n$ is reachable from $l$. Therefore, $n$ is reachable from $a$, so $a$ is an ancestor of $n$, and so belongs in $L$.
\end{proof}

\begin{lemma}
Let $L$ and $M$ be lineages of $T$, and $q \in L \cap M, q \neq R$. Then $q$'s parent also belongs to $M \cap L$.
\end{lemma}
\begin{proof}
Call $p$ the parent of $q$. $p$ is an ancestor of $q$, and since $q$ belongs to $L$ (by hypothesis), $p$ belongs to $L$ by lemma \ref{lem_ancestors_in_lineage}. By the same reasoning, $p$ belongs to $M$, therefore $p \in L \cap M$.

\end{proof}

\begin{prop}
\label{prop_lineage_intersection}
Let $L$ and $M$ be lineages of $T$. Then $L \cap M$ also forms a lineage.
\end{prop}
\begin{proof}
Let $N = L \cap M$. Because $N$ is a subset of a lineage (in fact it is a subset of at least two lineages, $L$ and $M$), its elements are ordered, so we can pick the last one and call it $n$. Now all other elements of $N$ are ancestors of $n$, so by lemma \ref{lem_ancestors_in_lineage} they belong in $L$ and in $M$. So far we have proven
\end{proof}

\begin{prop}
In a rooted tree, you can always define a clade by specifying a single node: the clade consists of the specified node and all its descendants.
\end{prop}

\begin{prop}
In a rooted tree $T$ with unique labels and a node $n$ in $T$, it is always possible to choose two nodes $n_1$ and $n_2$ such that lca($n_1$,$n_2$) = $n$.
\end{prop}


\mychapter{8}{Lesson 8} %181019

\section{Domain extension}

Up until now, encryption has been dealt with messages of fixed size around a polynomial function to $\lambda$. How to deal with messages with arbitrary size? Setting a maximum bound to message length seems impractical, both for waste reasons when messages are too short, and for practicality when messages eventually get too long. The solution takes the form of a ``block-cipher'', where a message of a given size is split into equally-sized blocks, and then encrypted using a fixed-size encryption scheme. Various instances of this technique, called \emph{modes}, have been devised.

\subsection{Electronic Codebook mode}

The operation of \textsc{ecb}-mode is straightforward: Given a message split into blocks $(m_1, \dots, m_t)$, apply the scheme's encryption routine to each block, as shown in figure \ref{fig:ecb}:
\[
    c_i = F_k(r) \oplus m_i \quad \forall i \in \{0, \dots, t\}
\]
Decryption is trivially implemented by \textsc{xor}-ing the ciphered blocks with $F_k(r)$.

\begin{figure}[ht]
    \centering
    \begin{tikzpicture}[node distance = 12mm, >=latex']

        \path[->]
            node (m1) {$m_1$}
            node (x1) [right of = m1] {$\oplus$}
            node (c1) [below of = x1] {$c_1$}
            node (f1) [box, above of = x1] {$f_k$}
            node (r1) [above of = f1] {$r$}

            node (m2) [right of = x1] {$m_2$}
            node (x2) [right of = m2] {$\oplus$}
            node (c2) [below of = x2] {$c_2$}
            node (f2) [box, above of = x2] {$f_k$}
            node (r2) [above of = f2] {$r$}

            node (xd) [right of = x2, node distance = 15mm] {$\dots$}
            node (cd) [right of = c2, node distance = 15mm] {$\dots$}
            node (fd) [right of = f2, node distance = 15mm] {$\dots$}
            node (rd) [right of = r2, node distance = 15mm] {$\dots$}

            node (mt) [right of = xd] {$m_t$}
            node (xt) [right of = mt] {$\oplus$}
            node (ct) [below of = xt] {$c_t$}
            node (ft) [box, above of = xt] {$f_k$}
            node (rt) [above of = ft] {$r$}

            (r1) edge (f1)
            (r2) edge (f2)
            (rt) edge (ft)

            (f1) edge (x1)
            (f2) edge (x2)
            (ft) edge (xt)

            (m1) edge (x1)
            (m2) edge (x2)
            (mt) edge (xt)

            (x1) edge (c1)
            (x2) edge (c2)
            (xt) edge (ct)
        ;

    \end{tikzpicture}
    \caption{\textsc{ecb}-mode block-cipher in action, using a \prf{} as the encryption routine}
    \label{fig:ecb}
\end{figure}

This approach has the advantage of being completely parallelizable, as each block can clearly be encrypted separately; however there is a dangerous flaw in being not \cpa-secure, even when using a \prf-based encryption scheme. To understand why, observe that random nonces for ciphertext randomization are chosen per-message; this means the encryption of message blocks become deterministic in the message scope, enabling an adversary to attack the scheme within a single plaintext. It is sufficient to choose an all-0 or all-1 message to realize that all its blocks would encrypt to the same ciphered block.

\subsection{Cipher block chaining mode (\textsc{cbc})}

% AP190105: The explanation anticipates PRPs, which may be a problem. Should be reviewed at later times...
This mode serializes block encryption by using the preceding ciphered block in the formula:
\[
    c_i = P_k(r) \oplus m_i \quad \forall i \in \{0, \dots, t\}
\]
This time, a \emph{pseudorandom permutation}(\prp) is used instead of a \prf; they will be discussed later on. The diagram in figure \ref{fig:cbc} shows a general view of \textsc{cbc}-mode's operation. The decryption process is analogous but in a reversed fashion, by computing the preimage of a ciphered block and \textsc{xor}-ing it with the preceding ciphered block:
\[
    m_i = P_k^{-1}(c_i) \oplus c_{i-1}
\]

\begin{figure}[ht]
    \centering
    \begin{tikzpicture}[node distance = 12mm, > = latex']

        \draw[->]
            node (r) {$r$}
            node (c0) [below of = r, node distance = 24mm] {$c_0$}

            node (c1) [right of = c0, node distance = 24mm] {$c_1$}
            node (p1) [box, above of = c1] {$P_k$}
            node (x1) [above of = p1] {$\oplus$}
            node (m1) [above of = x1] {$m_1$}

            node (c2) [right of = c1, node distance = 24mm] {$c_2$}
            node (p2) [box, above of = c2] {$P_k$}
            node (x2) [above of = p2] {$\oplus$}
            node (m2) [above of = x2] {$m_2$}

            node (cd) [right of = c2, node distance = 24mm] {$\dots$}
            node (pd) [above of = cd] {$\dots$}
            node (xd) [above of = pd] {$\dots$}
            node (md) [above of = xd] {$\dots$}

            node (ct) [right of = cd, node distance = 24mm] {$c_t$}
            node (pt) [box, above of = ct] {$P_k$}
            node (xt) [above of = pt] {$\oplus$}
            node (mt) [above of = xt] {$m_t$}

            (r) edge (c0)

            (m1) edge (x1)
            (m2) edge (x2)
            (mt) edge (xt)

            (x1) edge (p1)
            (x2) edge (p2)
            (xt) edge (pt)

            (p1) edge (c1)
            (p2) edge (c2)
            (pt) edge (ct)

            (c0) -| +(12mm, 24mm) edge (x1)
            (c1) -| +(12mm, 24mm) edge (x2)
            (c2) -| +(12mm, 24mm) edge (xd)
            (cd) -| +(12mm, 24mm) -- (xt)
        ;

    \end{tikzpicture}
    \caption{\textsc{cbc}-mode block-cipher in action, using a \prp{} as the encryption routine}
    \label{fig:cbc}
\end{figure}

\subsection{Counter mode}

Also denoted as \textsc{ctr} in short, this mode closely resembles \textsc{ecb}-mode but uses a ``rolling'' nonce instead of a static one, as shown in figure \ref{fig:ctr}. At each successive block, the nonce is incremented by 1 and then used in a single block encryption. Since the nonce is in $\binary^n$, the increment is done modulo $2^n$ so that the value will wrap around to 0 if it ever overflows. Decryption is analogous.

\begin{figure}[ht]
    \centering

    \begin{tikzpicture}[node distance = 12mm, > = latex']

        \draw[->]
            node (c0) {$c_0$}

            node (c1) [right of = c0, node distance = 24mm] {$c_1$}
            node (x1) [above of = c1] {$\oplus$}
            node (m1) [left of = x1] {$m_1$}
            node (f1) [box, above of = x1] {$f_k$}
            node (r1) [above of = f1] {$r$}

            node (c2) [right of = c1, node distance = 24mm] {$c_2$}
            node (x2) [above of = c2] {$\oplus$}
            node (m2) [left of = x2] {$m_2$}
            node (f2) [box, above of = x2] {$f_k$}
            node (r2) [above of = f2] {$r + 1$}

            node (cd) [right of = c2, node distance = 19mm] {$\dots$}
            node (xd) [above of = cd] {$\dots$}
            node (fd) [above of = xd] {$\dots$}
            node (rd) [above of = fd] {$\dots$}

            node (ct) [right of = cd, node distance = 24mm] {$c_t$}
            node (xt) [above of = ct] {$\oplus$}
            node (mt) [left of = xt] {$m_t$}
            node (ft) [box, above of = xt] {$f_k$}
            node (rt) [above of = ft] {$r + t - 1$}

            (r1) edge (r2)
            (r2) edge (rd)
            (rd) edge (rt)

            (r1) edge (f1)
            (r2) edge (f2)
            (rt) edge (ft)

            (f1) edge (x1)
            (f2) edge (x2)
            (ft) edge (xt)

            (m1) edge (x1)
            (m2) edge (x2)
            (mt) edge (xt)

            (x1) edge (c1)
            (x2) edge (c2)
            (xt) edge (ct)

            (r1) -| (c0)
        ;

    \end{tikzpicture}
    \caption{Counter-mode block-cipher in action, using a \prf{} as the encryption routine}
    \label{fig:ctr}
\end{figure}

This apparently innocuous change to \textsc{ebc} is enough to ensure \cpa-security, at the cost of perfect parallelization.

\begin{theorem}
    Assume $f_k$ is a \prf, then the counter-mode block cipher is \cpa-secure for variable length messages\footnotemark.
\end{theorem}
\footnotetext{\emph{Variable length messages} exactly means every message $m = (m_1, \dots, m_t)$ is made of $t$ blocks, and $t$ can change from any message to a different one.}

\begin{proof}
    Figure \ref{cryptogame:ctrcpa} models a \cpa{} attack to a counter-mode block-cipher. The proof will proceed by hybrid argument starting from this game, therefore the statement to verify will be $\cryptog{cpa}[\textsc{ctr}](\lambda, 0) \compindist \cryptog{cpa}[\textsc{ctr}](\lambda, 1)$.

    \begin{cryptogame}
        {ctrcpa}
        {A chosen-plaintext attack to counter-mode block-cipher}
        {cpa}

        \cseqbeginloop

        \send{}{$m = (m_1, \dots, m_t)$}{}
        \receive{\shortstack[l]{
            $r = c_0 \pickUAR \binary^n$ \\
            $c_i = f_k(r + i - 1) \oplus m_i \quad \forall i$
        }}
        {$c = (c_0, c_1, \dots, c_t)$}{}

        \cseqendloop

        \cseqdelay

        \send{$|\mu_0| = |\mu_1| \in \mathcal{M}$}{$\mu_0, \mu_1$}{}
        \receive{\shortstack[l]{
            $\rho = \gamma_0 \pickUAR \binary^n$ \\
            $b \pickUAR \binary$ \\
            $(\gamma_b)_i = f_k(\rho + i - 1) \oplus (\mu_b)_i \quad \forall i$
        }}
        {$\gamma_b = (\gamma_0, \gamma_1, \dots, \gamma_t)$}{}

        \cseqdelay

        \cseqbeginloop

        \send{}{$m = (m_1, \dots, m_t)$}{}
        \receive{\shortstack[l]{
            $r = c_0 \pickUAR \binary^n$ \\
            $c_i = f_k(r + i - 1) \oplus m_i \quad \forall i$
        }}
        {$c = (c_0, c_1, \dots, c_t)$}{}

        \cseqendloop

        \cseqdelay

        \send{}{$b'$}{\textsc{Output 1 iff} $b' = b$}

    \end{cryptogame}

    Define the two hybrid games from the original \cpa{} game as follows:

    \begin{itemize}
        \item $\hybridg{1}[\textsc{ctr}](\lambda, b)$: A random function $R$ is chosen \uar{} from $\mathfrak{R}(n, n)$ at the beginning of the game, and is used in place of $F_k$ in all block encryptions;
        \item $\hybridg{2}[\textsc{ctr}](\lambda, b)$: The challenger will pick random values from $\binary^n$ as ciphered blocks, disregarding any encryption routine.
    \end{itemize}

    \begin{lemma}
        $\cryptog{cpa}[\textsc{ctr}](\lambda, b) \compindist \hybridg{1}[\textsc{ctr}](\lambda, b) \quad \forall b \in \binary$
    \end{lemma}

    \begin{proof} The proof is left as exercise.

        \emph{Hint}: Since the original game and the first hybrid are very similar, we can use a distinguisher which plays the \cpa-game; since this is a lemma, our goal in the reduction is to break the precondition contained in the theorem statement.
    \end{proof}

    \begin{lemma}
        $\hybridg{1}[\textsc{ctr}](\lambda, b) \compindist \hybridg{2}[\textsc{ctr}](\lambda, b) \quad \forall b \in \binary$
    \end{lemma}

    \begin{proof}

        Since $m_i$ doesn't affect the distribution of the result at all, for any $i$, if $R(r^{*})$ behaves like a true random extractor, then the two hybrids are indistinguishable in the general case ($R(r + i) \oplus m_i \approx R(r + i)$). However, there is a sneaky issue: if in both games it happens that a given nonce $r_i$ is used in both one query encryption and the challenge message encryption at any step, the subsequent encrypted blocks will be completely random in the second hybrid, whereas in the first hybrid the function's images, albeit random, become predictable, enabling a \cpa.

        Nevertheless, it can be proved that these ``collisions'' happen with negligible probability within $\hybridg{1}[\textsc{ctr}]$. Let:
        \begin{itemize}
            \item $q$ = number of encryption queries in a game run
            \item $t_i$ = number of blocks for the $i$-th query
            \item $\tau$ = number of blocks for the challenge ciphertext
            \item \textsc{Overlap} event: $\exists i, j, \iota : r_i + j = \rho + \iota$
        \end{itemize}

        The \textsc{Overlap} event exactly models our problematic scenario. Now it suffices to show that it occurs negligibly. For simplicity, assume the involved messages are of the same length, that is $t_i = \tau =: t$. Denote with $\textsc{Overlap}_i$ to be the event that the $i$-th query overlaps the challenge sequence as specified above.

        Fix some $\rho$. One can see that $\textsc{Overlap}_i$ happens if:
        \[
            \rho - t + 1 \leq r_i \leq \rho + t - 1
        \]
        which means that $r_i$ should be chosen \emph{at least} in a way that:
        \begin{itemize}
            \item the sequence $\rho, \dots, \rho + t - 1$ comes before the sequence $r_i, \dots, r_i + t - 1$, and they overlap just for the last element $\rho + t - 1 = r_i$ or
            \item the sequence $r_i, \dots, r_i + t - 1$ comes before the sequence the sequence $\rho, \dots, \rho + t - 1$, and they overlap just for the last element $r_i + t - 1 = \rho$.
        \end{itemize}

        Then:

        \begin{align*}
            \Pr[\textsc{Overlap}_i] &= \frac{(\rho + t - 1) - (\rho - t + 1) + 1}{2^n} \\
            &= \frac{2t-1}{2^n} \\
            \Pr[\textsc{Overlap}] &\leq \sum_{i = 1}^{t} \Pr[\textsc{Overlap}_i] \\
            &\leq 2 \frac{t^2}{2^n} \in \negl{\lambda}
        \end{align*}

        which proves that our collision scenario happens with negligible probability, thus the two hybrids are indistinguishable.

    \end{proof}

    Having proven the indistinguishability between the hybrids, the conclusion is reached:
    \[
        \cryptog{cpa}[\textsc{ctr}](\lambda, 0) \compindist \cryptog{cpa}[\textsc{ctr}](\lambda, 1)
    \]

\end{proof}


% Preamble.
\documentclass[12pt]{article}
\usepackage[margin=1.25in]{geometry}
\usepackage[fleqn]{amsmath}
\usepackage{textcomp}
\usepackage{gensymb}
\usepackage{amsfonts}
\usepackage{enumitem}
%\usepackage{tikz}  % Include for figures.
%\usepackage{subfiles}  % Include for subfiles.

%% Title macros.
\newcommand{\HOMEWORKNUM}{21}
\newcommand{\NAME}{D. Choi}
\newcommand{\DATE}{2020-06-24}

\title{\vspace{-2\baselineskip}MATH 225 - Homework \#\HOMEWORKNUM}
\author{\NAME}
\date{\DATE}

%% Formatting options.
%\pagenumbering{gobble}  % Include for single-page document.

% Macros.
%% Contextualized by input/output bases.
\newcommand{\based}[3]{{\{#1\}}_{#2}^{#3}}

% Document.
\begin{document}
\maketitle

\section*{1.}
\begin{equation*}
	A = \begin{pmatrix} 5 & 1 \\ 1 & 5 \end{pmatrix}
\end{equation*}
\begin{enumerate}[label=(\alph*)]
	\item \textit{Let}
	\begin{equation*}
		\vec{a} = \begin{pmatrix} 1 \\ 1 \end{pmatrix}, \quad
		\vec{b} = \begin{pmatrix} 2 \\ 2 \end{pmatrix}, \quad
		\vec{c} = \begin{pmatrix} -1 \\ 1 \end{pmatrix},\quad
		\vec{d} = \begin{pmatrix} 5 \\ -5 \end{pmatrix},\quad
		\vec{e} = \begin{pmatrix} 10 \\ 0 \end{pmatrix}.
	\end{equation*}
	\textit{Which are eigenvectors of $A$? Find their corresponding
	eigenvalues.} \\[\baselineskip]
	For a square matrix $A$, a vector $\vec{v}$ is an eigenvector of $A$ if
	there is a scalar $\lambda$ such that $A\vec{v} = \lambda \vec{v}$.
	\\[\baselineskip]
	For $\vec{a} = \begin{pmatrix} 1 \\ 1 \end{pmatrix}$,
	\begin{equation*}
		A \vec{a}
		=
		\begin{pmatrix} 5 & 1 \\ 1 & 5 \end{pmatrix}
		\begin{pmatrix} 1 \\ 1 \end{pmatrix}
		=
		\begin{pmatrix} 6 \\ 6 \end{pmatrix}
		=
		6
		\begin{pmatrix} 1 \\ 1 \end{pmatrix}
		=
		6 \vec{a}
		.
	\end{equation*}
	Thus, $\vec{a}$ is an eigenvector of $A$ with a corresponding eigenvalue
	of \boxed{6}.
	\\[\baselineskip]
	For $\vec{b} = \begin{pmatrix} 2 \\ 2 \end{pmatrix}$,
	\begin{equation*}
		\vec{b} = 2 \vec{a}
		.
	\end{equation*}
	Because $\vec{b}$ is a scalar multiple of $\vec{a}$, an eigenvector of
	$A$, $\vec{b}$ is also an eigenvector of $A$. Furthermore, $\vec{b}$
	shares $\vec{a}$'s corresponding eigenvalue of \boxed{6}.
	\\[\baselineskip]
	For $\vec{c} = \begin{pmatrix} -1 \\ 1 \end{pmatrix}$,
	\begin{equation*}
		A \vec{c}
		=
		\begin{pmatrix} 5 & 1 \\ 1 & 5 \end{pmatrix}
		\begin{pmatrix} -1 \\ 1 \end{pmatrix}
		=
		\begin{pmatrix} -4 \\ 4 \end{pmatrix}
		=
		4
		\begin{pmatrix} -1 \\ 1 \end{pmatrix}
		=
		4 \vec{c}
		.
	\end{equation*}
	Thus, $\vec{c}$ is an eigenvector of $A$ with a corresponding eigenvalue
	of \boxed{4}.
	\\[\baselineskip]
	For $\vec{d} = \begin{pmatrix} 5 \\ -5 \end{pmatrix}$,
	\begin{equation*}
		\vec{d} = -5 \vec{c}
		.
	\end{equation*}
	Because $\vec{d}$ is a scalar multiple of $\vec{c}$, an eigenvector of
	$A$, $\vec{d}$ is also an eigenvector of $A$. Furthermore, $\vec{d}$
	shares $\vec{c}$'s corresponding eigenvalue of \boxed{4}.
	\\[\baselineskip]
	For $\vec{e} = \begin{pmatrix} 10 \\ 0 \end{pmatrix}$,
	\begin{equation*}
		A \vec{e}
		=
		\begin{pmatrix} 5 & 1 \\ 1 & 5 \end{pmatrix}
		\begin{pmatrix} 10 \\ 0 \end{pmatrix}
		=
		\begin{pmatrix} 50 \\ 10 \end{pmatrix}
		\neq
		\lambda
		\begin{pmatrix} 10 \\ 0 \end{pmatrix}
		\text{ for any $\lambda$.}
	\end{equation*}
	Thus, $\vec{e}$ is not an eigenvector of $A$.

	\item \textit{Let $\mathcal{S}$ be the standard basis, and let}
	\begin{equation*}
		\based{T}{\mathcal{S}}{\mathcal{S}} = A.
	\end{equation*}
	\textit{Find a basis $\mathcal{B}$ made of the eigenvectors of $A$, and
	find $\based{T}{\mathcal{B}}{\mathcal{B}}$.} \\[\baselineskip]
	Let
	\begin{equation*}
		\mathcal{B}
		=
		\left\{
			\begin{pmatrix} 1 \\ 1 \end{pmatrix},
			\begin{pmatrix} -1 \\ 1 \end{pmatrix}
		\right\}
		.
	\end{equation*}
	Using $\mathcal{B}$,
	\begin{align*}
		\based{T}{\mathcal{B}}{\mathcal{B}}
		&=
		\based{T}{\mathcal{S}}{\mathcal{B}}
		\based{T}{\mathcal{S}}{\mathcal{S}}
		\based{I}{\mathcal{B}}{\mathcal{S}}
		\\
		&=
		\begin{pmatrix}
			\frac{1}{2} & \frac{1}{2} \\
			-\frac{1}{2} & \frac{1}{2}
		\end{pmatrix}
		\begin{pmatrix} 5 & 1 \\ 1 & 5 \end{pmatrix}
		\begin{pmatrix} 1 & -1 \\ 1 & 1 \end{pmatrix}
		\\
		&=
		\boxed{
			\begin{pmatrix} 6 & 0 \\ 0 & 4 \end{pmatrix}
		}
		.
	\end{align*}
	Note the diagonal elements of $\based{T}{\mathcal{B}}{\mathcal{B}}$ are
	the eigenvalues of $A$.
\end{enumerate}
\newpage

\section*{2.}
\textit{Suppose that $A$ is a $3 \times 4$ matrix.}
\begin{enumerate}[label=(\alph*)]
	\item \textit{Is it possible that $\text{dim}(\text{nul}(A)) = 0$?}
	\\[\baselineskip]
	\boxed{\text{No.}} By the rank-nullity theorem,
	\begin{equation*}
		\text{rank}(A) + \text{nullity}(A) = \text{dim}(\text{domain}(A))
		.
	\end{equation*}
	The dimension of the domain of $A$ is $4$, because $A$ has $4$ columns. \\
	The rank of $A$ is at maximum 3, because $A$ is a $3 \times 4$ matrix. \\
	As a result of this, the nullity of $A$ must be at least $1$.

	\item \textit{If $\text{dim}(\text{nul}(A)) = 1$, what can you say about
	$\text{col}(A)$?} \\[\baselineskip]
	\boxed{\text{dim}(\text{col}(A)) = \text{rank}(A) = 4 - 1 = 3.}

	\item \textit{If $\text{dim}(\text{nul}(A)) = 2$, what can you say about
	$\text{col}(A)$?} \\[\baselineskip]
	\boxed{\text{dim}(\text{col}(A)) = \text{rank}(A) = 4 - 2 = 2.}

	\item \textit{If $\text{dim}(\text{nul}(A)) = 3$, what can you say about
	$\text{col}(A)$?} \\[\baselineskip]
	\boxed{\text{dim}(\text{col}(A)) = \text{rank}(A) = 4 - 3 = 1.}

	\item \textit{If $\text{dim}(\text{nul}(A)) = 4$, what can you say about
	$\text{col}(A)$?} \\[\baselineskip]
	\boxed{\text{dim}(\text{col}(A)) = \text{rank}(A) = 4 - 4 = 0.}
\end{enumerate}
\newpage

\section*{3.}
\textit{Let}
\begin{equation*}
	A = \begin{pmatrix} 8 & -10 \\ 5 & -7 \end{pmatrix},
	\qquad
	\vec{v}_1 = \begin{pmatrix} 2 \\ 1 \end{pmatrix}, \quad
	\vec{v}_2 = \begin{pmatrix} 1 \\ 1 \end{pmatrix}.
\end{equation*}
\begin{enumerate}[label=(\alph*)]
	\item \textit{Show that the vectors $\vec{v}_1$ and $\vec{v}_2$ are
	eigenvectors of $A$ and find their associated eigenvalues.}
	\begin{gather*}
		A \vec{v}_1
		=
		\begin{pmatrix} 8 & -10 \\ 5 & -7 \end{pmatrix}
		\begin{pmatrix} 2 \\ 1 \end{pmatrix}
		=
		\begin{pmatrix} 6 \\ 3 \end{pmatrix}
		=
		3 \begin{pmatrix} 2 \\ 1 \end{pmatrix}
		=
		3 \vec{v}_1
		, \\
		A \vec{v}_2
		=
		\begin{pmatrix} 8 & -10 \\ 5 & -7 \end{pmatrix}
		\begin{pmatrix} 1 \\ 1 \end{pmatrix}
		=
		\begin{pmatrix} -2 \\ -2 \end{pmatrix}
		=
		-2 \begin{pmatrix} 1 \\ 1 \end{pmatrix}
		=
		-2 \vec{v}_2
		.
	\end{gather*}
	Thus, $\boxed{\lambda_1 = 3}, \boxed{\lambda_2 = -2}$.

	\item \textit{Express the vector}
	\begin{equation*}
		\vec{x} = \begin{pmatrix} -4 \\ -1 \end{pmatrix}
	\end{equation*}
	\textit{as a linear combination of $\vec{v}_1$ and $\vec{v}_2$.}
	\\[\baselineskip]
	Solving
	\begin{equation*}
		\begin{pmatrix} 2 & 1 \\ 1 & 1 \end{pmatrix}
		\begin{pmatrix} a \\ b \end{pmatrix}
		=
		\begin{pmatrix} -4 \\ -1 \end{pmatrix}
		,
	\end{equation*}
	$a = -3$, and $b = 2$. \\
	Thus,
	\begin{equation*}
		\boxed{
			\vec{x}
			=
			-3 \vec{v}_1 + 2 \vec{v}_2
		}
		.
	\end{equation*}
\end{enumerate}
\newpage

\section*{Extra.}
\textit{Consider the Fibonacci sequence and the following:}
\begin{equation*}
	\begin{pmatrix} 0 & 1 \\ 1 & 1 \end{pmatrix}
	\begin{pmatrix} 2 \\ 3 \end{pmatrix}
	=
	\begin{pmatrix} 3 \\ 5 \end{pmatrix}
	, \quad
	\begin{pmatrix} 0 & 1 \\ 1 & 1 \end{pmatrix}
	\begin{pmatrix} 3 \\ 5 \end{pmatrix}
	=
	\begin{pmatrix} 5 \\ 8 \end{pmatrix}
	.
\end{equation*}
\textit{Find the 1000th Fibonacci number.} \\[\baselineskip]
Let $0$ be the $0$th Fibonacci number.
\begin{equation*}
	\begin{pmatrix} 0 & 1 \\ 1 & 1 \end{pmatrix}^n
	\begin{pmatrix} 0 \\ 1 \end{pmatrix}
	=
	\begin{pmatrix}
		n\text{th Fibonacci number} \\
		(n+1)\text{th Fibonacci number}
	\end{pmatrix}
	.
\end{equation*}
Thus, let
\begin{equation*}
	\begin{pmatrix} 0 & 1 \\ 1 & 1 \end{pmatrix}^n
	\begin{pmatrix} 0 \\ 1 \end{pmatrix}
	=
	\begin{pmatrix}
		a \\
		\_
	\end{pmatrix}
	.
\end{equation*}
\boxed{a} is the 1000th Fibonacci number.

\end{document}


\subsection{Heuristic approach}
A heuristic method has been developed basing on imitating the visual selection of L-shapes (see figure)
\begin{itemize}
\item Overimpose a $3\times 3$ grid on the scatterplot.
\item Score points on each subgrid in such a way that
\begin{itemize}
	\item Points in permitted regions increase score
	\item Points in non-desired regions decrease score
	\item Points in non-allowed regions set score to $\-infty$.
\end{itemize}
\item Use cross-validation to tune scoring parameters.
\end{itemize}

\subsection{The Naive method}

Traditionally selection has been based on searching for genes with negative correlation betweem expression and correlation. This ``Naïve approach" is used to compare with other approaches.


\section{Gaussian elimination}
Gaussian elimination is an algorithm for solving systems of linear equations.


\documentclass[]{article}

%opening
\title{MTH 343 Numerical Analysis: Lecture 12}
\author{Sheikh Abdul Raheem Ali}

\begin{document}

\maketitle

\section*{Interpolation}

	\begin{enumerate}
		\item Solving Systems of Equations
		\item Lagrange Polynomials
	\end{enumerate}

\begin{tabular}{c c}
	$ x_i $ & $ f_i $ \\
	$ x_0 $ & $ f_0 $ \\
	$ x_1 $ & $ f_1 $ \\
	$ x_2 $ & $ f_2 $
\end{tabular}

\[ P_2(x) = \frac{(x-x_1)(x - x_2)}{(x_0 - x_1)(x_0 - x_2)}f_0 + \frac{(x-x_0)(x - x_2)}{(x_1 - x_0)(x_1 - x_2)}f_1 + \frac{(x-x_0)(x - x_1)}{(x_2 - x_0)(x_2 - x_1)}f_2 \]

\begin{tabular}{c c}
	$ x_i $ & $ f_i $ \\
	$ 0 $ & $ 1 $ \\
	$ -1 $ & $ 2 $ \\
	$ 2 $ & $ 3 $
\end{tabular}

\[  P_2(x) = \frac{(x+1)(x - 2)}{(0 + 1)(0 - 2)} + \frac{(x-0)(x - 2)}{(-1 - 0)(-1 - 2)}2 + \frac{(x-0)(x + 1)}{(2 - 0)(2 + 1)}3 \]

$ P_n(x) = \sum_{0}^{n}L_{n,i}f(x_i) $

\section*{Lagrange Polynomial Error Function}

\[ E(x) = |f(x) - P_n(x)| = \frac{|(x-x_0)(x-x_1)\dots(x-x_n)f^{n+1}(\xi)|}{(n+1)!}  \]

Where $ \xi  $ is the element in the smallest interval containing $ x_0,x_1,\dots,x_n $

\end{document}


%!TEX root = main.tex
\section{Simulation setup}
\subsection{Variance reduction}
Because the simulation can be time consuming to run, we want to lower the variance of the estimated parameters as much as possible relative to the computational resources used.

\subsubsection{Control Variates}
Control variates is a variance reduction technique which can be used to reduce the variance of the estimated expected value $\hat{\mu} = \mathbb{E}[Y]$. It works by drawing/calculating a variable $X_i$ such that $Y_i \approx f(X_i)$. One can then estimate $\hat{\mu} = \mathbb{E}[Z]$ where $Z$ is given by:
\begin{align}
Z_i = Y_i - c (X_i - \mathbb{E}[X])
\end{align}

Choosing $c = \frac{Cov(X, Y)}{Var(X)}$ gives the largest variance reduction of:
\begin{equation}
\frac{Var[Z]}{Var[Y]} = \frac{Var[Y]}{Var[Y]} - \frac{Cov(X, Y)^2}{Var[X] Var[Y]} = 1 - \rho_{x, y}^2 \label{eq:variance-reduction}
\end{equation}

In our case there is no analytical expression for the covariance or variance of the random variables. Instead $c$ is estimated from the dataset itself. This introduces some overfitting, thus one should take care to reduce the degrees of freedom in the variance, covariance estimates:
\begin{equation}
\hat{c} = \frac{Cov_{N-1}(X, Y)}{Var_{N-1}(X)}, \quad \hat{\sigma}^2 = Var_{N-2}(Z)
\end{equation}

The subscript denotes the degrees of freedom, and $\hat{\sigma}^2$ has $N - 2$ degrees of freedom, because $\hat{c}$ is estimated from the dataset.

\subsubsection{Estimating infection rate}

From \eqref{eq:variance-reduction} it seen that to get a high variance reduction, $X_i$ just need to be heavily correlated with $Y_i$. In our case we would like to estimate the infection peak time and how many people where infected at the peak. From the theoretical differential equation model those values should be correlated with the infection rate $\beta$.

Assuming the stochastic model have a behaviour somewhat similar to the differential equation model, there exists a fairly simple method for estimating $\beta$ and $\gamma$ \cite{wiki-sir}.
\begin{equation}
\gamma = \frac{R'_{max}}{I_{max}} \text{ and } \beta = -\frac{\ln(p)}{1 - p} \gamma \quad \text{where: } p = \frac{N - R_\infty}{N}
\end{equation}

$R'_{max}$ is the maximum removed difference, and $I_{max}$ is the maximum infected. Due to the construction of the differential equation, these are found at the same time $t$. $R_\infty$ is how many people where removed in the end, thus $p$ is the survival rate.

\subsection{Effect of Global Events}
We want to estimate what effect a global event can have on a virus outbreak. We define an event $e$ as simply being a transfer of people from one or more regions $r_{i}$ to region $r_t$ at a time $t_0$, and the reverse transfer of people from $r_t$ to $r_{i}$ at time $t_1$.

\subsubsection{Motivation: Zika virus}
Recently, a new virus has been observed in South and Latin America. The Zika virus affects pregnant women's fetuses and can cause serious birth defects. The Zika virus is primarily spread by mosquitoes, but can also spread from a man to his sex partners (and from mother to fetus). Some political discussions have been made as to whether or not the Olympic Games should be canceled to prevent the spreading of the virus.

In this report we will run a "hypothetical" simulation, showing how the a virus could spread assuming inter-human infections. As such this simulation is primarily an attempt of showing how such a model would work and not a realistic Zika virus predictor.

\subsubsection{Event definition: Olympic Games in Rio 2016}
In our simulation we define the Olympic Games to take place during $t_0=$ `2016-07-03' and $t_1=$ `2016-07-21'. According to The Gaurdian \cite{theguardian-olympics} Rio expects to recieve 380,000 tourist. We choose to transfer people from all over the world to Rio, such that the transfer is proportional to the population size of each region:

\begin{align}
	\text{Transfer}_0(i, j) &= 380000 \cdot \frac{\text{population}_i}{N} \\
	\text{Transfer}_1(j, i) &= \text{transfer}_0(i, j)
\end{align}

where $\text{Transfer}_0(i, j)$ denotes the number of people transferred from region $i$ to region $j$ at the start of the Olympics and $ \text{Transfer}_1(j, i) $ the people transferred from $j$ to $i$ at the end of the Olympics.


%Note for this test case:
%Simple water flow example using ANUGA: Water flowing down a channel.
%It was called "steep_slope" in an old validation test.

\section{Shallow flow down a mild slope}
This case simulates very shallow flow running down a mild slope topography. It represents an idealisation of the rainfall-runoff problem, which will often involve very shallow flows down such a topography. This case has an analytical solution, and in particular, we consider the steady-uniform solution with the values of bed slope and friction slope are the same.

Suppose that we are given a one dimensional domain. The steady state conditions with a contant water depth everywhere make the shallow water equations to the single identity
\begin{equation}
z_x = - S_f,
\end{equation}
where $z_x$ is the bed slope, and $S_f$ is the symbol for the force of bottom friction.  We take Manning's friction
\begin{equation}
S_f = n^2 \frac{q|q|}{h^{10/3}}
\end{equation}
where $n$ is the Manning's coefficient and $q$ is the discharge $uh$.
If $q$, $n$, and $z_x$ are given, then the analytical solution for $u$ and $h$ is
\begin{equation}
u(x)= \left[- n^{-2} q^{4/3} z_x\right]^{3/10},
\end{equation}
\begin{equation}
h(x)= \frac{q}{u}\,.
\end{equation}

\subsection{Results}
For our test, we consider a square dimensional domain with length and width 100. We take $q=0.2$, $n=0.03$, and $z_x=-0.1$.
The topography is
\begin{equation}
z(x, y)= -0.1 x\,.
\end{equation}
The initial condition is $u=v=0$ and
\begin{equation}
w(x,y,0)= -0.1 x + 0.01\,.
\end{equation}

Some simulation results are as follows.
Figures~\ref{fig:depthdownchan} shows the steady state depth in the downstream direction.
There should be a good agreement with the analytical solution, at least away from the boundaries.

Figures~\ref{fig:depthacrosschan} shows the steady state depth across the slope around the line x = 50m.
There should be a good agreement with the analytical solution, at least away from the boundaries.

Figures~\ref{fig:xvelscrosschan} and~\ref{fig:yvelscroschan} show the steady state $x$- and $y$-velocities, along a slice in the cross slope direction (near $x=50$). The $x$-velocities should agree well with the analytical solution, and the $y$-velocities should be zero.

\begin{figure}
\begin{center}
\includegraphics[width=0.8\textwidth]{depth_x.png}
\caption{Depth in the downstream direction}
\label{fig:depthdownchan}
\end{center}
\end{figure}

\begin{figure}
\begin{center}
\includegraphics[width=0.8\textwidth]{depth_y.png}
\caption{Depth across the slope around $x$ = 50m}
\label{fig:depthacrosschan}
\end{center}
\end{figure}

\begin{figure}
\begin{center}
\includegraphics[width=0.8\textwidth]{x_velocity.png}
\caption{$x$-velocity along the cross-section $x=50$ (i.e. a cross-section with constant bed elevation)}
\label{fig:xvelscrosschan}
\end{center}
\end{figure}

\begin{figure}
\begin{center}
\includegraphics[width=0.8\textwidth]{y_velocity.png}
\caption{$y$-velocity along the cross-section $x=50$ (i.e. a cross-section with constant bed elevation)}
\label{fig:yvelscroschan}
\end{center}
\end{figure}

\endinput