xkcd and google

Download Report

Transcript xkcd and google

Please turn off your cell phones.
xkcd
and
The Electric Google
Keith
Clay
Application
Test

Department of Physics
Green River Community College
How to solve the problem
that stumped the world

= 21.414
2135623730950488
01688724209698078569671875
37694807317667973799073247846210703885038753
43276415727350138462309122970249248360558507372126441214970999358314132226659
2750559275579995050115278206057147010955997160597027453459686201472851741864088919860955232923048430871432145083976260362799525140799
(dot dot dot)
My obsession began:
2 = 1.414213562373095 …
7
= 1.4000000000000 …
5
99
= 1.4142857142857 …
70
8119
= 1.4142135 5164605 …
5741
Then I grew up…
… sort of.
And then,
on my birthday,
September 27, 1998
this appeared…
$30
billion
in profits
Electric
circuits?
Google?
Which isOver
one of
the
reasons
why
itinis2011
interesting that
Google once offered a job interview to anyone who
Chosencould
as the
most
employer
in America
The
goal
was
toelectric
identify
smartproblem.
people.
solve
andesirable
circuit
So Google asked some “interesting” questions.
Imagine an electric circuit composed of an infinite
number of 1-ohm resistors in a 2-dimensional grid.
= 1 𝑜ℎ𝑚
What really happens
inside an electric circuit:
Imagine an electric circuit composed of an infinite
number of 1-ohm resistors in a 2-dimensional grid.
= 1 𝑜ℎ𝑚
What is the total
resistance between
these two points?
Notice that mathematicians’ brains are
by Randall
morexkcd
expensive
thanMunroe
physicists’ brains
(because physicists’ brains are used).
And
Is now
2 rational?
back to 2.
Assume it is.
Then 2 =
𝑎
𝑏
,
𝑎, 𝑏 ∈ ℤ
𝑖𝑓
2
𝑎 𝑎
=,
=
𝑏 𝑏
2,
𝑎, 𝑏 𝑎,
∈ 𝑏ℤ ∈, ℤ
𝑡ℎ𝑒𝑛
𝑎
2𝑐 𝑐
2𝑒
𝑒
2 =𝑎22 =
=
= =⋯
2=
𝑎𝑏2 = 22𝑑𝑏
2𝑓
𝑓
, , 𝑑
𝑏
∴ 𝑎𝑎,𝑖𝑠𝑏,𝑒𝑣𝑒𝑛,
𝑐, 𝑑, 𝑒, 𝑓 𝑎,
…
𝑎=
𝑏,
∈ 𝑐2
ℤ∈𝑐, ℤ
𝑎2
> 2𝑐 𝑏>2 𝑑 > 𝑒 > 𝑓 > ⋯ > 0
4>
𝑎𝑐22𝑏 =
𝑎,
∴ 𝑏 𝑖𝑠
𝑏 𝑏,
= 𝑐,2𝑑𝑑,∈ ℤ
∴ 𝑒𝑣𝑒𝑛,
2 𝑖𝑠 𝑖𝑟𝑟𝑎𝑡𝑖𝑜𝑛𝑎𝑙.
𝑖𝑓
𝑎
3= ,
𝑏
𝑎, 𝑏 ∈ ℤ ,
𝑡ℎ𝑒𝑛
𝑎
3𝑐 𝑐
3𝑒
𝑒
3= =
= =
= =⋯
𝑏
3𝑑 𝑑
3𝑓
𝑓
𝑎, 𝑏, 𝑐, 𝑑, 𝑒, 𝑓 … ∈ ℤ
𝑎>𝑏>𝑐>𝑑>𝑒>𝑓>⋯>0
∴ 3 𝑖𝑠 𝑖𝑟𝑟𝑎𝑡𝑖𝑜𝑛𝑎𝑙.
𝑖𝑓
𝑎
4= ,
𝑏
𝑎, 𝑏 ∈ ℤ ,
𝑡ℎ𝑒𝑛
𝑎
4𝑐 𝑐
4𝑒
𝑒
4= =
= =
= =⋯
𝑏
4𝑑 𝑑
4𝑓
𝑓
No.
𝑎, 𝑏, 𝑐, 𝑑, 𝑒, 𝑓 … ∈ ℤ
It will be left as an exercise for
𝑎>𝑏>𝑐>𝑑>𝑒>𝑓>⋯>0
the reader to figure out why
this proof breaks down for 4.
∴ 4 𝑖𝑠 𝑖𝑟𝑟𝑎𝑡𝑖𝑜𝑛𝑎𝑙 ? ? ?
So there are no integers 𝑎, 𝑏 ∈ ℤ
such that 𝑎2 = 2 𝑏 2
The best we can hope for is 𝑎2 = 2 𝑏 2 ± 1
And there are plenty of these:
12 = 2 02 + 1
12 = 2 12 − 1
32 = 2
72 = 2
172 = 2
412 = 2
22 + 1
52 − 1
122 + 1
292 − 1
Could there be an infinite sequence of whole numbers
𝑎, 𝑏 ∈ ℤ such that 𝑎2 = 2 𝑏 2 ± 1 ?
An infinite sequence of integers with ratios that
approximate an irrational number?
Really?
The Fibonacci Sequence
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233…

𝐹0 = 0,
𝐹1 = 1,
𝐹𝑛+2 = 𝐹𝑛+1 + 𝐹𝑛
1
= 1.618034
1 + 5…
2
3
= 1.5
2
8
= 1.6
5
21
= 1.615 …
13
5
= 1.66 …
3
13
= 1.625
8
34
= 1.619 …
21
89
55
= 1.6181 …
= 1.6176 …
55
34
𝐹16
= 1.618033 …
𝐹15
The Golden Ratio:  = 1.61803398874989…
The Golden Ratio:  = 1.61803398874989…
1
𝐹𝑛+1
𝜑 ≡ 1 + 5 = lim
𝑛→∞
2
𝐹𝑛
𝐹𝑛+2 = 𝐹𝑛+1 + 𝐹𝑛
𝑜𝑟
𝐹𝑛+2 − 𝐹𝑛+1 − 𝐹𝑛 = 0
Define the “next term” operator E:
For any term of a sequence Sn , E Sn = Sn+1
𝐹𝑛+2 − 𝐹𝑛+1 − 𝐹𝑛 = 0
becomes
E2 Sn = Sn+2
𝐸 2 𝐹𝑛 − 𝐸 𝐹𝑛 − 𝐹𝑛 = 0
We can factor this:
𝐸 2 𝐹𝑛 − 𝐸 𝐹𝑛 − 𝐹𝑛 = 0
𝐸 2 − 𝐸 − 1 𝐹𝑛 = 0
𝐼𝑓 𝐸 𝐹𝑛 = 𝜆 𝐹𝑛 ,
𝑡ℎ𝑒𝑛
𝜆2 − 𝜆 − 1 = 0
1
𝜆± = 1 ± 5
2
𝐹𝑛+2 −1𝐹𝑛+1 − 𝐹𝑛 = 0
becomes
𝐸12 𝐹𝑛 − 𝐸 𝐹𝑛 − 𝐹𝑛 = 0
𝜆+ = 1 + 5 = 1.618 …
𝜆− = 1 − 5 = −0.618 …
2
2
Just “a little” algebra shows that…
𝐹𝑛+1
1
= 𝜑 𝐹𝑛 + −
𝜑
1
𝑛
1
𝐹𝑛 =
𝜑𝑛 − −
𝜑
5
= 𝜑 𝐹𝑛 + −0.618 …
𝑛
𝑛
Binet’s formula
1
1
𝜆+ = 1 + 5 = 1.618 … = 𝜑𝜆− = 1 − 5 = −0.618 … = −
(The
proof will be left as an exercise
2
2 for the reader.)
But what about 2 ?
We’re looking for
𝑎, 𝑏 ∈ ℤ
12 = 2 02 + 1
12 = 2 12 − 1
32
22
=2
+1
72 = 2 52 − 1
172 = 2 122 + 1
412 = 2 292 − 1
992 = 2 702 + 1
such that
𝑎2 = 2 𝑏 2 ± 1
𝒂𝒏
𝒃𝒏
𝒂𝒏 /𝒃𝒏
1
0
Undefined
1
1
1
3
2
1.5
7
5
1.4
17
12
1.4167
41
29
1.4138
99
70
1.4143
Notice:
𝑎𝑛+2 = 2 𝑎𝑛+1 + 𝑎𝑛
𝐼𝑓 𝐸 𝑎𝑛 = 𝜆 𝑎𝑛 ,
𝑡ℎ𝑒𝑛
1
𝜆− = 1 − 2 =
=−
𝜆+
1+ 2
𝐿𝑒𝑡 𝜆 = 1 + 2
1
𝜆2 − 2𝜆 − 1 = 0
−1
𝜆± = 1 ± 2
1 𝑛
1
𝑎𝑛 =
𝜆 + −
2
𝜆
𝑏𝑛+2 = 2 𝑏𝑛+1 + 𝑏𝑛
𝑛
1
𝑛
𝑏𝑛 =
𝜆 − −
𝜆
2 2
𝑛
𝒂𝒏
𝒃𝒏
𝒂𝒏 /𝒃𝒏
1
0
Undefined
1
1
1
3
2
1.5
7
5
1.4
17
12
1.4167
41
29
1.4138
99
70
1.4143
We have found an infinite number of pairs of positive integers
𝑎𝑛 , 𝑏𝑛 ∈ ℤ such that 𝑎𝑛 ≈ 2 𝑏𝑛 , in fact…
𝑛
𝑎𝑛+2 = 2 𝑎𝑛+1 + 𝑎𝑛
𝑏𝑛+2
1 = 2 𝑏𝑛+1 + 𝑏𝑛
𝑎𝑛 = 2 𝑏𝑛 + −
𝜆
𝒂𝒏
𝒃𝒏
𝒂𝒏 /𝒃𝒏
𝒂𝒏
𝒃𝒏
𝑎
1
1
𝐿𝑒𝑡 𝜆 = 1 + 21 2 − 𝑛 < 1
2
𝑏𝑛
3
2 2.414 𝑏𝑛1.5
1
1
𝑛
5
1.4
1 𝑛
17
3
2
𝑎𝑛 =
𝜆 + − 17
12
1.4167
2
𝜆
7
5
1
41
1
99
𝑛
𝑏𝑛 =
𝜆 − −
𝜆
2 2
239
577
𝑛
29
17
70
41
169
99
408
1.4138
12
1.4143
29
1.41420
70
1.414216
𝒂𝒏 /𝒃𝒏
1
1.5
1.4
1.4167
1.4138
1.4143
Hey… Doesn’t this have something to do with…
Hurwitz’ Theorem!
For any irrational number z there
exists an infinite number of pairs
of integers a, b, such that
𝑎𝑛
1
𝑧−
<
𝑏𝑛
5 𝑏𝑛
Adolf Hurwitz!
2
We have found an infinite number of pairs of positive integers
𝑎𝑛 , 𝑏𝑛 ∈ ℤ
in fact…
such that
𝑎𝑛
1
2 −
<
𝑏𝑛
2.414 𝑏𝑛
we’ve found all of them!
Assume someone finds 𝑎𝑛 , 𝑏𝑛 ∈ ℤ
𝑎𝑛−1 = 2 𝑏𝑛 − 𝑎𝑛
Define
𝐼𝑓
𝑎𝑛
2
2
− 2 𝑏𝑛
2
= ±1
not on our list.
𝑏𝑛−1 = 𝑎𝑛 − 𝑏𝑛
𝑡ℎ𝑒𝑛
𝑎𝑛−1
2
− 2 𝑏𝑛−1
2
= ∓1
Repeating this procedure will lead to 𝑎1 = 1, and 𝑏1 = 1
There are two types of (real) irrational numbers
Algebraic
2
1
1+ 5
2
5
3 7 − 13
roots of finite
polynomials with
rational coefficients
Transcendental
𝜋
For any irrational number z there
exists an infinitelnnumber
of pairs
5
of integers a, b, such that
𝑎𝑛𝐴𝑟𝑐𝑡𝑎𝑛 71
𝑧−
<
𝑏𝑛
5 𝑏𝑛 2
roots of infinite
polynomials with
rational coefficients
Solve:
3 1 2 1 4
0= − 𝑥 + 𝑥
2 2!
4!
485
𝑥= 6≈
198
Solve:
3 1 2 1 4 1 6 1 8
1 10
0= − 𝑥 + 𝑥 − 𝑥 + 𝑥 −
𝑥 …
2 2!
4!
6!
8!
10!
2𝜋 710
𝑥=
≈
3
339
What does any of this have to do with the Google problem???
= 1 𝑜ℎ𝑚
What is the total
resistance between
these two points?
What really happens
inside an electric circuit:
Resistance
What is the total
resistance between
these two points?
= 1 𝑜ℎ𝑚
What
is the total
RESISTORS
resistance
between
IN SERIES:
these two points?
= 2 𝑜ℎ𝑚𝑠
What is the total
resistance between
these two points?
= 3 𝑜ℎ𝑚𝑠
Resistances in series simply add
The opposite of resistance is conductance.
Conductances in parallel simply add
1
RESISTORS
1
1
1
IN PARALLEL: 𝑐𝑜𝑛𝑑𝑢𝑐𝑡𝑎𝑛𝑐𝑒 = =𝑟𝑒𝑠𝑖𝑠𝑡𝑎𝑛𝑐𝑒
+
+ …
𝑅𝑇𝑂𝑇𝐴𝐿 𝑅1 𝑅2
Conductance increases when resistors are added in parallel.
Conductance
Resistance
1
1 𝑜ℎ𝑚
1 𝑜ℎ𝑚
1
1
2
=
+
=
1 𝑜ℎ𝑚 1 𝑜ℎ𝑚 1 𝑜ℎ𝑚
1
oℎ𝑚𝑠
2
1
1
3
=
+
=
2 𝑜ℎ𝑚 1 𝑜ℎ𝑚 2 𝑜ℎ𝑚
2
oℎ𝑚𝑠
3
0, 1, 1, 2, 3, 5, 8, 13,
34, harder
55, 89,ones...
144, 233…
Try21,
some
1
1
= 1 𝑜ℎ𝑚 +
+
1 𝑜ℎ𝑚 13 𝑜ℎ𝑚𝑠
8
1
1
= 1 𝑜ℎ𝑚 +
+
1 𝑜ℎ𝑚 5 𝑜ℎ𝑚𝑠
3
1
1
= 1 𝑜ℎ𝑚 +
+
1 𝑜ℎ𝑚 2 𝑜ℎ𝑚𝑠
= 2 𝑜ℎ𝑚𝑠 =
2
oℎ𝑚𝑠
1
1
= "∞" 𝑜ℎ𝑚𝑠 = oℎ𝑚𝑠
0
−1
−1
−1
34
=
𝑜ℎ𝑚𝑠
21
13
=
𝑜ℎ𝑚𝑠
8
5
= 𝑜ℎ𝑚𝑠
3
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233…
…
𝑇𝑜𝑡𝑎𝑙 𝑟𝑒𝑠𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑜𝑓 𝑏𝑙𝑢𝑒 𝑟𝑒𝑠𝑖𝑠𝑡𝑜𝑟𝑠 = 𝑅 𝑜ℎ𝑚𝑠
𝑇𝑜𝑡𝑎𝑙 𝑟𝑒𝑠𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑜𝑓 𝒂𝒍𝒍 𝑟𝑒𝑠𝑖𝑠𝑡𝑜𝑟𝑠 = 𝑅 𝑜ℎ𝑚𝑠
1 1
𝑅= 1 +
+
1 𝑅
−1
2𝑅+1
=
𝑅+1
𝑅 + 𝑅2 = 2𝑅𝑅 +
+ 11
1
𝑅 = 1 + 5 = 𝜑 = 1.61803 …
2
…

𝑇𝑜𝑡𝑎𝑙 𝑟𝑒𝑠𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑜𝑓 𝑎𝑙𝑙 𝑟𝑒𝑠𝑖𝑠𝑡𝑜𝑟𝑠 = 𝜑2𝑜ℎ𝑚𝑠
𝑜ℎ𝑚𝑠
…
…

𝑇𝑜𝑡𝑎𝑙 𝑟𝑒𝑠𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑜𝑓 𝑎𝑙𝑙 𝑟𝑒𝑠𝑖𝑠𝑡𝑜𝑟𝑠 = 3 𝑜ℎ𝑚𝑠
…
…
𝑇𝑜𝑡𝑎𝑙 𝑟𝑒𝑠𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑏𝑒𝑡𝑤𝑒𝑒𝑛 𝑡ℎ𝑒 𝑟𝑒𝑑 𝑑𝑜𝑡𝑠 =
1
3
𝑜ℎ𝑚𝑠
But we still don’t know how to solve this!
= 1 𝑜ℎ𝑚
What is the total
resistance between
these two points?
Surprise!
Leo Lavatelli, American Journal of Physics,
Volume 40, pg 1248, September 1972
“The Resistive Net and Finite-Difference Equations”
Surprise #2!
James Clerck Maxwell
1831 - 1879
Label the currents with indices to denote locations in the circuit.
𝐼−1
𝐼0
𝐼1
𝐼2
− 44 𝐼𝐼𝑛+1
𝐼2 𝐼=
0=0
Kirchhoff’s loop rule: 𝐼𝐼𝑛0 −
1 ++
𝑛+2
𝐿𝑒𝑡 𝐸 𝐼𝑛 = 𝐼𝑛+1
1 − 4𝐸 + 𝐸 2 𝐼𝑛 = 0
𝐸𝑖𝑔𝑒𝑛𝑣𝑎𝑙𝑢𝑒𝑠: 𝐸 𝐼𝑛 = 𝜆 𝐼𝑛
𝜆 =2+ 3
𝐼3
Particular solution:
𝐼𝑒𝑥𝑡
𝐼−1
𝐹𝑜𝑟 𝑎𝑙𝑙 𝑛 < 0,
𝐼0
1
𝐼𝑛 = 𝐼𝑛+1
𝜆
𝐼1
𝐼2
𝐹𝑜𝑟 𝑎𝑙𝑙 𝑛 > 1,
𝐼3
1
𝐼𝑛 = 𝐼𝑛−1
𝜆
𝐼𝑒𝑥𝑡 − 𝐼0 + 𝐼1 𝑅 = 𝑉
𝐼𝑒𝑥𝑡 − 𝐼0 + 4 𝐼1 − 𝐼2 = 0
1
𝜆 =2+ 3
𝐼0 = −𝐼1 𝑎𝑛𝑑 𝐼2 = 𝐼1
𝜆
1
𝑅=
𝑜ℎ𝑚𝑠
3
This method generalizes to 2 dimensions!
𝐼−1,1
𝐼0,1
𝐼1,1
𝐼2,1
𝐼3,1
𝐼−1,0
𝐼0,0
𝐼1,0
𝐼2,0
𝐼3,0
𝐼0,−1
𝐼1,−1
𝐼2,−1
𝐼3,−1
𝐼−1,−1
This method generalizes to 2 dimensions!
𝐸𝑥 𝐼𝑚,𝑛 = 𝐼𝑚+1,𝑛
𝐸𝑦 𝐼𝑚,𝑛 = 𝐼𝑚,𝑛+1
Horizontal and vertical equations are inseparable.
Current loops influence each other in a nonlinear way.
Interactions of two current loops: 1D chain
A
B
Interactions of two current loops: 2D array
A
B
Complexity of solutions of 2D grids
Number of rows
Order of polynomials
Number of equations
1
2
1
Fortunately the infinite dimensional 2D grid
2 is “simpler” than a grid
4 with 20 infinite rows. 2
3
6
6
But a full solution involves multivariate calculus
7and the creation of appropriate
14
924
Green’s functions.
20
40
35 billion
= 1 𝑜ℎ𝑚
What is the total
resistance between
these two points?
Finite element: 1 𝑜ℎ𝑚
Infinite 1-D chain:
1
3
𝑜ℎ𝑚𝑠
1
Infinite 2-D array:
𝑜ℎ𝑚𝑠
2
= 1 𝑜ℎ𝑚
What is the total
resistance between
these two points?
Finite element:
1 𝑜ℎ𝑚
Infinite 1-D chain:
3
𝑜ℎ𝑚𝑠
2
2
Infinite 2-D array:
𝑜ℎ𝑚𝑠
𝜋
= 1 𝑜ℎ𝑚
What is the total
resistance between
these two points?
7
Finite element:
𝑜ℎ𝑚
5
Infinite 1-D chain:
4
− 1 𝑜ℎ𝑚𝑠
3
Infinite 2-D array:
You have been nerd sniped.
It will be left as an exercise for the
reader to derive the resistance for
an infinite 2D array.
All of the information you need is in
the references, which are right here…
References:
• Lavatelli, L., “The Resistive Net and Finite-Difference
Equations,” American Journal of Physics, Volume 40, pg
1248, September, 1972
• Gardner, M., “The Calculus of Finite Differences,”
reprinted in The Colossal Book of Mathematics, Norton
& Co., 2001
• Levine, L., “The Calculus of Finite Differences,”
http://www.math.cornell.edu/~levine , Jan 2009
• MathPages.com, “Infinite Grid of Resistors,”
http://mathpages.com/home/kmath668/kmath668.htm
• Munroe, R., xkcd.com
By the way, the answer is…
8 − 𝜋
𝑅=
𝑜ℎ𝑚𝑠
2𝜋
DOOR PRIZES!
Pesonally signed by randall munroe
grownups
purity