SlideShare a Scribd company logo
When Computers Don't Compute
And Other

pde1d.blogspot.com
Have you ever gotten a wrong
answer from a computer ?
Finite precision numbers
● Chaos
● Limited number of numbers
●

–

Insufficient resolution / memory

Software errors
● Branch cuts
● User errors / poor documentation
●

pde1d.blogspot.com
There are 10 types of people,
those that understand binary
numbers, and those that don't.
4s / sign bit

2s bit

1s bit

unsigned

signed

0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1

0
1
2
3
4
5
6
7

0
1
2
3
-4
-3
-2
-1

3 + 1 → -4

7+1→0

5 = -3

2/3 → 0
pde1d.blogspot.com
Factorial !!!

n

n! =

∏k

= 1∗2∗3∗4∗...∗(n−1)∗n

k=1

n ! = n∗(n−1)!
8 Byte
signed
integers

20! = 2432902008176640000
21! = -4249290049419214848
64! = -9223372036854775808
65! = -9223372036854775808
66! = 0
pde1d.blogspot.com
70! = Googol +
– C,

C++, Bash, Csh, Fortran, Java → 0

– Hand

Calculator → Error

– LibraOffice,

Calligra Sheets, Gnumeric →
1.19785716699699E+100

– Python,

Lisp, dc, bc, GMP, BigInteger →
119785716699698917960727837216890
987364589381425464258575553628646
280095827898453196800000000000000
00
pde1d.blogspot.com
Spreadsheets Googol +
–

LibraOffice →
1197857166996990000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000

–

Calligra Sheets →
1197857166996989221259474668628791114472893603304820
9921351258923353917776673784237595759172044980224

–

Gnumeric →
1197857166996989026992585446055884022526702920952930
3278944419871214396524861374498691473966836482048

–

70! =
119785716699698917960727837216890987364589
381425464258575553628646280095827898453196
80000000000000000
pde1d.blogspot.com
pde1d.blogspot.com
dc & bc
●

dc – Desktop calculator
–
–
–
–

●

Stack based calculator for Unixes
dc was bc ( Before C ) and before bc
Arbitrary Precision
Integer arithmetic with decimal point shift

bc – basic/bench calculator
–
–
–
–

C like syntax
Originally piped through dc
'bc -l' adds math library and scale=20 digits
Sine, Cosine, Arctan, ln, exp, Bessel fcn
pde1d.blogspot.com
High Precision Libraries
GMP – Gnu Multiple Precision
● MPFR – Gnu Multiple Precision
floating-point with rounding
●

–

MPC – Complex numbers

DD, QD – 32 and 64 digit
accuracy
● PARI/GP – Algebra C library +
shell
●

pde1d.blogspot.com
Floating Point Numbers
●

EPSILON
–

Smallest number such that

1.0 + ϵ != 1.0
or, if δ<ϵ 1.0 + δ = 1.0
●

Floating Point numbers
–

IEEE 754 - 2008
●
●

–
–

FLT_EPSILON = 1.19209e-07
DBL_EPSILON = 2.22045e-16

CPU registers may use higher precision
Detailed definitions vary by factor of ~2
pde1d.blogspot.com
Precision Loss
●

Rapidly varying functions
o

arccos( 0.99999999984769129011 ) = 0.001
o
arccos( 0.99999999939076516049 ) = 0.002
th

Change in 10 place doubles result
● Subtraction of nearly equal numbers
  3.14159292035xxx
­ 3.14159265359xxx
0.00000026676xxx
12 place accuracy reduced to 5 places
pde1d.blogspot.com
Quadratic Formula
−b± √ b −4 a c
X=
2a
2

2

a X +b X +c=0
●

2

What if

b ≈ 4ac

√

or

2

2

b ≫ ∣4 a c∣ or b ≪ ∣4 a c∣

1
EPSILON ⇒ Loss of digits
2
pde1d.blogspot.com
Quadratic Equation Examples
Traditional and alternate solution formulations*

●

2

Enter a,b,c: 1 -2 0.9999999999999996
X = 1.00000002107342 , 0.999999978926576
Err: 0 , -1.11022e-16
Alt. sol. X = 1.00000002107342 , 0.999999978926576
Err: 0 , 0

2

Enter a,b,c: 1 -2000000 1
X = 1999999.9999995 , 5.00003807246685e-07
Err: -0.000240445 , -7.61449e-06
Alt. sol. X = 1999999.9999995 , 5.00000000000125e-07
Err: -0.000240445 , 0

b ≈ 4ac
b ≫ 4ac

2

b ≪ 4ac

Enter a,b,c: 10000 1 -10000
X = 0.99995000125 , -1.00005000125
Err: -1.81899e-12 , 0
Alt. sol. X = -1.00005000125 , 0.99995000125
Err: 0 , 0

*Acton, Forman S., “REAL Computing Made Real”,pp 5-6, Dover, 2005/ Princeton Press 1996

pde1d.blogspot.com
It's About Time
Not the 1966 TV show
● The value of time is inversely
proportional to the amount remaining
● Example, 50 times slower
●

–
–
●

1 millisecond computation
4 day computation

Some times for 500X500 grid
–

Python ~30 min, numpy ~30sec, f2py ~2 sec
“Numerical Computing with SAGE”, pg 18, Aug 15, 2013
pde1d.blogspot.com
Time Cost of Precision
Double(15) – baseline gotoBLAS
● DD(32) – 11 to 312 X
● QD(64) – 109 to 3060 X
● GMP(77) – 132 to 3700 X
● GMP(154) – 197 to 5900 X
● MPFR(154) – 405 to 11500 X
●

Times/speeds from MPACK

http://www.slideshare.net/NakataMaho/the-mpack-multiple-precision-version-of-blas-and-lapack

pde1d.blogspot.com
Pick 3 Digits Calculation
●
●
●
●
●
●

Pick 3 ordered digits ( 1 2 3 )
Enter twice ( 123123 )
Divide by 11
Divide by 7
Divide by original 3 digit number
- Result >bc -l
123123
last/11
last/7
last/123

>dc
123123
11 /
7/
123 /
p
pde1d.blogspot.com
Paraskevidekatriaphobia
th

Fear of Friday the 13
● Today is the first Friday the
Thirteenth of 2013
● In Thirteen weeks the next Friday
th
the 13
● Triskaidekaphobia
●

–

Fear of the number 13

pde1d.blogspot.com
13
A prime number
● Is the smallest emirp
●

–
●

A happy number
–

●

12 + 32 = 10 → 12 + 02 = 1

Wilson prime ( 3 known – 5, 13, 563 )
–

●

31 and 13 are both prime

( (13-1)! + 1 ) % 132 = 0

A Fibonacci number
–

1 , 1, 2, 3, 5, 8, 13, 21, 34, …

pde1d.blogspot.com
What is the smartest
mammal ?
●

Rabbits
–

●

*

they can multiply very fast

Fibonacci
–
–
–
–

Leonardo Pisano Bigollo of Pisa
Illustrated rabbit breeding in 1202 “Liber Abaci”
F(n+1) = Fn + F(n-1) , F1 = 1 , F2 = 1
F(n+1) = number of possible arrangements of long
and short items
n

* http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/fibnat.html
pde1d.blogspot.com
Fibonacci Spiral

8
Chris 73 / Wikimedia Commons
13
1

2

1
5

Appears in Nature
- Sunflower seed spirals
Spiral with equal packing
- Sea Shells ( not csh )

3

pde1d.blogspot.com
Fibonacci &
Golden Ratio
a

F n+1
→ ϕ
F n n→∞

b

b
a+b
ϕ =
=
a
b
●

b
a

Beautiful
Proportion

φ, Phi symbol after Phidias
– Greek sculpture used and studied

pde1d.blogspot.com
Golden Ratio Uses
●

Penrose Tiles
–
–

Non-repeating pattern
Phi ratio of tiles
1

●

φ

1

Φ

2011 Nobel Prize
–
–

Quasicrystals
3D Non-repeating

Sir Roger Penrose
Solorflare100
Wikimedia Commons

1
2π
o
ϕ = 2 cos( 5 ) = 2 cos(72 ) = Φ
pde1d.blogspot.com
Calculating Golden Ratio
1
ϕ = 1+
1
1+
1
1+
1+. . .
ϕ =

Golde

n Mea
n
Divin
e P ro
portio
n
Gold
en Se
c ti o n

√1+ √1+ √ 1+ √ 1+ √1+...

1+ √ 5
ϕ =
2

Do you like stand-up comedians?
pde1d.blogspot.com
One Liners for Gloden Ratio
●

Continued fraction
–
–

●

Continued squareroot
–
–

●

echo “67k 1[dsb1r/1+pdlb!=c]dscxq” | dc
163 iterations
dc -e “67k1[dsb1+vpdlb!=c]dscxq”
133 iterations

Fibonacci
–
–

echo "67k1sa1d[sclardsa+dla/pdlc!=b]dsbx" | dc
163 iterations

pde1d.blogspot.com
Golden Ratio by dc
●

Equation - 67k5v1+2/p
Actions

67 Push '67'

Stack
67

k

Pop → set precision

5

Push '5'

5

v

Pop → Sqrt → Push

2.236...

1

Push '1'

1 ; 2.236...

+

Pop 2 → add → Push

3.236...

2

Push '2'

2 ; 3.236...

/

Pop 2 → divide → Push

1.618...

p

Pop → print → Push

1.618...
pde1d.blogspot.com
More dc
echo 67k5v1+2/dd*rd1r/[0]Ppsapsapq | dc
0.6180339887498948482045868343656381177203091798057628621354486227052
1.6180339887498948482045868343656381177203091798057628621354486227052
2.6180339887498948482045868343656381177203091798057628621354486227050

0.816033...6227052
1.816033...6227052
2.816033...6227050
1
ϕ = Φ = ϕ−1

2

ϕ = ϕ+1
pde1d.blogspot.com
Python Decimal Numbers
> python
>>> 1.1+2.2
3.3000000000000003
>>> from decimal import *
>>> getcontext().prec=67
>>> phi = ( Decimal('5').sqrt() + 1 ) / 2
>>> print 1/phi, 'n', phi, 'n', phi*phi
0.618033988749894848...21354486227050
1.618033988749894848...2135448622706
2.618033988749894848...2135448622708
pde1d.blogspot.com
Irrational Number Power
●

Can an irrational number to an
irrational power give a rational result ?

√(2) √(2)

(( √2) )

= 2

> python
>>> from decimal import *
>>> getcontext().prec=67
>>> s = Decimal(2).sqrt()
>>> print (s**s), "**", s
1.6325269194381528447734... ** 1.4142135623730950488016...
>>> print (s**s)**s
2.000000000000000000000000000000000000000000000000000
000000000000002
pde1d.blogspot.com
Chaos
●

Maxwell Smart's arch nemesis
–

●

●

Lorenz's Strange Attractor
Wikimedia commons

Butterfly effect
–

●

KAOS

Small initial difference yield a large impact

Non-periodic behavior
Example recurrence relations
–

Logistics equation

x n+1 = r x n (1−x n )
–

, 3.82843 < r ≤ 4 , 0 < x < 1

or
2
n

x n+1=x − 2

, −2 < x < 2
pde1d.blogspot.com
2
n

X0 = 0.5 vs 0.49...

x n+1=x − 2

2
1.5
1
0.5
Xn

0
-0.5
-1
-1.5
-2
-2.5
0

2

4

6

8

10

12

14

16

18

20

Iteration n

X_0=0.5

2.5

Twelve Nines

X_0=0.4999999999999

Rain

2
1.5
1

Xn

0.5
0
-0.5
-1
-1.5
-2
-2.5
80

82

84

86

88

90

92

94

96

98

100

Iteration n

X_0=0.5

X_0=0.4999999999999

pde1d.blogspot.com
2
n

Recurrence Relation x n+1 = x − 2
●

An infinite number of initial values
end with x = 2
–

x 0 = √ 2 , x 1=0 , x 2 =−2 , x 3=2 , x 4 =2 , . . .
2
n

x n+1 = x − 2
x=0
for( i=1; i<30; i++) {
x= sqrt(x+2)
print i, " ", x, "n"
x= - sqrt(x+2)
print i, " ", x, "n"
}

→

x n−1 = ± √ x n + 2
27 .6180339887498950...
27 -1.6180339887498949...
28 .6180339887498947...
28 -1.6180339887498948...
29 .6180339887498948...
29 -1.6180339887498948520...

±ϕ → Φ → −ϕ → Φ → −ϕ → . . .
pde1d.blogspot.com
●

I know I am not
good at math,
but if I can get
95% of
problems right,
who cares
about the other
10%
pde1d.blogspot.com
Founding Fathers & Mathematics
●

Thomas Jefferson
–

Kept good numerical records
●

–
–

U.S. Currency
Mathematics to U.S. Universities
●
●

–

University of Virginia
West Point

Statistics to guide laws
●

–

Corrected Newton's Math

Limited duration laws ( 20 Yrs )

Concerning distribution of Representatives by state
●

Any law should “reduces the apportionment always
to an arithmetic operation, about which no two men
can ever possibly differ.”
Cohen, I.B.,”The Triumph of Numbers, How Counting Shaped Modern Life”,
W.W.Norton & Company, New York, 2005

pde1d.blogspot.com
Eliminate Soldier's Helmets ?
Britain almost stopped issuing steal
helmets in WW I
● generals began to call for their
removal as they increased incidences
of headwounds twelvefold and
doubled total casualties
● A fatality was not a casualty
●

http://tvtropes.org/pmwiki/pmwiki.php/Main/LiesDamnedLiesAndStatistics
pde1d.blogspot.com
Flue Shot ?
●

●

●

Based on three studies, getting
the flu shot
reduces chance of getting the flu by
5%
73% effective at preventing the flu

http://blog.minitab.com/blog/adventures-in-statistics/how-effective-are-flu-shots
pde1d.blogspot.com
Founding Fathers & Numbers
●

Benjamin Franklin
–

Inventor
●
●
●

–

Founder
●
●
●

–
–
–

Lightening Rod
Franklin Stove
Bifocals
Public Library
Fire Company
Police Service

Post Office
Electricity
Magic Squares
http://www.math.wichita.edu/~richardson/
pde1d.blogspot.com
Magic Squares
Sum of numbers in rows, columns
8 1 6
and diagonals are equal
3 5 7
● Unique number per cell
4 9 2
● Pattern for odd number squares
●

B

C

D

2

=H3+1

=B3+1

=C3+1

3

=H4+1

=B4+1

=C4+1

4

=H5+1

=B5+1

5

=H6+1

6

E
1

F

G

H

=E3+1

=F3+1

=G3+1

=D4+1

=E4+1

=F4+1

=H2+1

=D3+1

=D5+1

=E5+1

=F5+1

=G5+1

=B6+1

=C6+1

=D6+1

=E6+1

=G4+1

=G6+1

=H7+1

=C5+1

=C7+1

=D7+1

=E7+1

=F7+1

=G7+1

7

=H8+1

=B8+1

=C8+1

=D8+1

=F6+1

=F8+1

=G8+1

8

=B7+1

=B2+1

=C2+1

=D2+1

=E2+1

=F2+1

=G2+1
pde1d.blogspot.com
11 X 11 Magic Square – by Spreadsheet

pde1d.blogspot.com
4x4
Half Rows = Half Sum
–
–

Ben's Bent Diagonals
●

2056

http://www.math.wichita.edu/~richardson/
pde1d.blogspot.com
Music is About Fractions
●

Not just quarter
note, eight note
but tuning scales

1
Step =
2

12

√2

frequency ( A# )
12
= √ 2 ∗ frequency ( A )
●

Independent of
base note

1
Fraction Error
1.0595
1.1225 ≈ 9/8
-0.0023
1.1892 ≈ 6/5
-0.0091
1.2599 ≈ 5/4
0.0079
1.3348 ≈ 4/3
0.0011
1.4142 ≈ 7/5
0.0101
1.4983 ≈ 3/2
-0.0011
1.5874 ≈ 8/5
-0.0079
1.6818 ≈ 5/3
0.0090
1.7818 ≈ 7/4
0.0178
1.8877 ≈ 15/8
0.0068
2
pde1d.blogspot.com
A

C

A#

C#

B

D

C

D#

C#

E

D

F

D#

F#

E

G

F

G#

F#

A

G

A#

G#

B

A

C

1

Fraction
1.0595
1.1225
1.1892
1.2599
1.3348
1.4142
1.4983
1.5874
1.6818
1.7818
1.8877
2

Error

≈ 9/8
≈ 6/5

-0.0023
-0.0091

≈
≈
≈
≈
≈
≈
≈
≈

0.0079
0.0011
0.0101
-0.0011
-0.0079
0.0090
0.0178
0.0068

5/4
4/3
7/5
3/2
8/5
5/3
7/4
15/8

pde1d.blogspot.com
A Golden Ratio Scale
FREQUENCY

STEP

1
8*Φ4

1
1.16718

1.167184

2*Φ

1.23607

1.059017

φ2/2

1.30902

1.059017

4*Φ2

1.52786

1.167184

φ

1.61803

1.059017

8*Φ3

1.88854

1.167184

2

1.059017

2

Fractions
within 1%
7
6
13
8
15
8

pde1d.blogspot.com
Golden Ratio Intervals
3

1.059017... = φ / 4
● 12
√2 = 1.059463... → 0.04%
● 4 each octave
●

4

1.167184... = 8*Φ
● Can be factored into 3 'half' steps
●

–
–

1.059017... * 1.059017... * 1.040719...
3 each octave

How many total intervals(steps) per octave ?
pde1d.blogspot.com
I hope you
had fun
pde1d.blogspot.com

More Related Content

What's hot

ゲーム理論NEXT 線形計画問題第9回 -シンプレックス法4 人工変数-
ゲーム理論NEXT 線形計画問題第9回 -シンプレックス法4 人工変数-ゲーム理論NEXT 線形計画問題第9回 -シンプレックス法4 人工変数-
ゲーム理論NEXT 線形計画問題第9回 -シンプレックス法4 人工変数-ssusere0a682
 
Task compilation - Differential Equation II
Task compilation - Differential Equation IITask compilation - Differential Equation II
Task compilation - Differential Equation IIJazz Michele Pasaribu
 
Math quota-cmu-g-455
Math quota-cmu-g-455Math quota-cmu-g-455
Math quota-cmu-g-455Rungroj Ssan
 
Solucion de problemas de ecuaciones difrenciales hasta 19
Solucion de problemas de ecuaciones difrenciales hasta 19Solucion de problemas de ecuaciones difrenciales hasta 19
Solucion de problemas de ecuaciones difrenciales hasta 19JAVIERTELLOCAMPOS
 
ゲーム理論NEXT 線形計画問題第7回 -シンプレックス法2-
ゲーム理論NEXT 線形計画問題第7回 -シンプレックス法2-ゲーム理論NEXT 線形計画問題第7回 -シンプレックス法2-
ゲーム理論NEXT 線形計画問題第7回 -シンプレックス法2-ssusere0a682
 
เลขยกกำลังชุด 2
เลขยกกำลังชุด 2เลขยกกำลังชุด 2
เลขยกกำลังชุด 2kanjana2536
 
Probability and Statistics
Probability and StatisticsProbability and Statistics
Probability and Statisticsshekharpatil33
 

What's hot (17)

E1 f9 bộ binh
E1 f9 bộ binhE1 f9 bộ binh
E1 f9 bộ binh
 
V2.0
V2.0V2.0
V2.0
 
ゲーム理論NEXT 線形計画問題第9回 -シンプレックス法4 人工変数-
ゲーム理論NEXT 線形計画問題第9回 -シンプレックス法4 人工変数-ゲーム理論NEXT 線形計画問題第9回 -シンプレックス法4 人工変数-
ゲーム理論NEXT 線形計画問題第9回 -シンプレックス法4 人工変数-
 
Task compilation - Differential Equation II
Task compilation - Differential Equation IITask compilation - Differential Equation II
Task compilation - Differential Equation II
 
Los atomos-t4
Los atomos-t4Los atomos-t4
Los atomos-t4
 
Math quota-cmu-g-455
Math quota-cmu-g-455Math quota-cmu-g-455
Math quota-cmu-g-455
 
E2 f1 bộ binh
E2 f1 bộ binhE2 f1 bộ binh
E2 f1 bộ binh
 
Capitulo 5 Soluciones Purcell 9na Edicion
Capitulo 5 Soluciones Purcell 9na EdicionCapitulo 5 Soluciones Purcell 9na Edicion
Capitulo 5 Soluciones Purcell 9na Edicion
 
Problemas pares
Problemas paresProblemas pares
Problemas pares
 
Solucion de problemas de ecuaciones difrenciales hasta 19
Solucion de problemas de ecuaciones difrenciales hasta 19Solucion de problemas de ecuaciones difrenciales hasta 19
Solucion de problemas de ecuaciones difrenciales hasta 19
 
Solo edo hasta 20
Solo edo hasta 20Solo edo hasta 20
Solo edo hasta 20
 
ゲーム理論NEXT 線形計画問題第7回 -シンプレックス法2-
ゲーム理論NEXT 線形計画問題第7回 -シンプレックス法2-ゲーム理論NEXT 線形計画問題第7回 -シンプレックス法2-
ゲーム理論NEXT 線形計画問題第7回 -シンプレックス法2-
 
E3 f1 bộ binh
E3 f1 bộ binhE3 f1 bộ binh
E3 f1 bộ binh
 
Capitulo 4 Soluciones Purcell 9na Edicion
Capitulo 4 Soluciones Purcell 9na EdicionCapitulo 4 Soluciones Purcell 9na Edicion
Capitulo 4 Soluciones Purcell 9na Edicion
 
เลขยกกำลังชุด 2
เลขยกกำลังชุด 2เลขยกกำลังชุด 2
เลขยกกำลังชุด 2
 
Probability and Statistics
Probability and StatisticsProbability and Statistics
Probability and Statistics
 
Capitulo 7 Soluciones Purcell 9na Edicion
Capitulo 7 Soluciones Purcell 9na EdicionCapitulo 7 Soluciones Purcell 9na Edicion
Capitulo 7 Soluciones Purcell 9na Edicion
 

Similar to When Computers Don't Compute and Other Fun with Numbers

Cuaderno+de+integrales
Cuaderno+de+integralesCuaderno+de+integrales
Cuaderno+de+integralesjoseluisroyo
 
2014 st josephs geelong spec maths
2014 st josephs geelong spec maths2014 st josephs geelong spec maths
2014 st josephs geelong spec mathsAndrew Smith
 
51548 0131469657 ism-7
51548 0131469657 ism-751548 0131469657 ism-7
51548 0131469657 ism-7crhisstian
 
001 int techintro
001  int techintro001  int techintro
001 int techintrojbianco9910
 
Formulario de Calculo Diferencial-Integral
Formulario de Calculo Diferencial-IntegralFormulario de Calculo Diferencial-Integral
Formulario de Calculo Diferencial-IntegralErick Chevez
 
Trigonometry 10th edition larson solutions manual
Trigonometry 10th edition larson solutions manualTrigonometry 10th edition larson solutions manual
Trigonometry 10th edition larson solutions manualLin1936
 
Trigonometry 10th Edition Larson Solutions Manual
Trigonometry 10th Edition Larson Solutions ManualTrigonometry 10th Edition Larson Solutions Manual
Trigonometry 10th Edition Larson Solutions Manualrajevynab
 
51541 0131469657 ism-0
51541 0131469657 ism-051541 0131469657 ism-0
51541 0131469657 ism-0Ani_Agustina
 
Calculo purcell 9 ed solucionario
Calculo  purcell  9 ed   solucionarioCalculo  purcell  9 ed   solucionario
Calculo purcell 9 ed solucionarioLuis Manuel Leon
 
Strategic Intervention Materials
Strategic Intervention MaterialsStrategic Intervention Materials
Strategic Intervention MaterialsBrian Mary
 
Computer math
Computer mathComputer math
Computer mathPDE1D
 
Exponent & Logarithm
Exponent &  LogarithmExponent &  Logarithm
Exponent & Logarithmguest0ffcb4
 
51548 0131469657 ism-7
51548 0131469657 ism-751548 0131469657 ism-7
51548 0131469657 ism-7Carlos Fuentes
 

Similar to When Computers Don't Compute and Other Fun with Numbers (20)

Understanding Reed-Solomon code
Understanding Reed-Solomon codeUnderstanding Reed-Solomon code
Understanding Reed-Solomon code
 
Cuaderno+de+integrales
Cuaderno+de+integralesCuaderno+de+integrales
Cuaderno+de+integrales
 
2014 st josephs geelong spec maths
2014 st josephs geelong spec maths2014 st josephs geelong spec maths
2014 st josephs geelong spec maths
 
Bolum1cozumler
Bolum1cozumlerBolum1cozumler
Bolum1cozumler
 
51548 0131469657 ism-7
51548 0131469657 ism-751548 0131469657 ism-7
51548 0131469657 ism-7
 
001 int techintro
001  int techintro001  int techintro
001 int techintro
 
Formulario de Calculo Diferencial-Integral
Formulario de Calculo Diferencial-IntegralFormulario de Calculo Diferencial-Integral
Formulario de Calculo Diferencial-Integral
 
Trigonometry 10th edition larson solutions manual
Trigonometry 10th edition larson solutions manualTrigonometry 10th edition larson solutions manual
Trigonometry 10th edition larson solutions manual
 
Trigonometry 10th Edition Larson Solutions Manual
Trigonometry 10th Edition Larson Solutions ManualTrigonometry 10th Edition Larson Solutions Manual
Trigonometry 10th Edition Larson Solutions Manual
 
51541 0131469657 ism-0
51541 0131469657 ism-051541 0131469657 ism-0
51541 0131469657 ism-0
 
Calculo purcell 9 ed solucionario
Calculo  purcell  9 ed   solucionarioCalculo  purcell  9 ed   solucionario
Calculo purcell 9 ed solucionario
 
EPCA_MODULE-2.pptx
EPCA_MODULE-2.pptxEPCA_MODULE-2.pptx
EPCA_MODULE-2.pptx
 
Strategic Intervention Materials
Strategic Intervention MaterialsStrategic Intervention Materials
Strategic Intervention Materials
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 
Computer math
Computer mathComputer math
Computer math
 
Exponent & Logarithm
Exponent &  LogarithmExponent &  Logarithm
Exponent & Logarithm
 
1 to hop
1 to hop1 to hop
1 to hop
 
Calculo i
Calculo iCalculo i
Calculo i
 
51548 0131469657 ism-7
51548 0131469657 ism-751548 0131469657 ism-7
51548 0131469657 ism-7
 
Calculo i
Calculo iCalculo i
Calculo i
 

Recently uploaded

Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationZilliz
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsPaul Groth
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsExpeed Software
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Alison B. Lowndes
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backElena Simperl
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfChristopherTHyatt
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaRTTS
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Product School
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityScyllaDB
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutesconfluent
 
The architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfThe architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfalexjohnson7307
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Thierry Lestable
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...CzechDreamin
 

Recently uploaded (20)

Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
The architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfThe architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 

When Computers Don't Compute and Other Fun with Numbers

  • 1. When Computers Don't Compute And Other pde1d.blogspot.com
  • 2. Have you ever gotten a wrong answer from a computer ? Finite precision numbers ● Chaos ● Limited number of numbers ● – Insufficient resolution / memory Software errors ● Branch cuts ● User errors / poor documentation ● pde1d.blogspot.com
  • 3. There are 10 types of people, those that understand binary numbers, and those that don't. 4s / sign bit 2s bit 1s bit unsigned signed 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 2 3 4 5 6 7 0 1 2 3 -4 -3 -2 -1 3 + 1 → -4 7+1→0 5 = -3 2/3 → 0 pde1d.blogspot.com
  • 4. Factorial !!! n n! = ∏k = 1∗2∗3∗4∗...∗(n−1)∗n k=1 n ! = n∗(n−1)! 8 Byte signed integers 20! = 2432902008176640000 21! = -4249290049419214848 64! = -9223372036854775808 65! = -9223372036854775808 66! = 0 pde1d.blogspot.com
  • 5. 70! = Googol + – C, C++, Bash, Csh, Fortran, Java → 0 – Hand Calculator → Error – LibraOffice, Calligra Sheets, Gnumeric → 1.19785716699699E+100 – Python, Lisp, dc, bc, GMP, BigInteger → 119785716699698917960727837216890 987364589381425464258575553628646 280095827898453196800000000000000 00 pde1d.blogspot.com
  • 6. Spreadsheets Googol + – LibraOffice → 1197857166996990000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000 – Calligra Sheets → 1197857166996989221259474668628791114472893603304820 9921351258923353917776673784237595759172044980224 – Gnumeric → 1197857166996989026992585446055884022526702920952930 3278944419871214396524861374498691473966836482048 – 70! = 119785716699698917960727837216890987364589 381425464258575553628646280095827898453196 80000000000000000 pde1d.blogspot.com
  • 8. dc & bc ● dc – Desktop calculator – – – – ● Stack based calculator for Unixes dc was bc ( Before C ) and before bc Arbitrary Precision Integer arithmetic with decimal point shift bc – basic/bench calculator – – – – C like syntax Originally piped through dc 'bc -l' adds math library and scale=20 digits Sine, Cosine, Arctan, ln, exp, Bessel fcn pde1d.blogspot.com
  • 9. High Precision Libraries GMP – Gnu Multiple Precision ● MPFR – Gnu Multiple Precision floating-point with rounding ● – MPC – Complex numbers DD, QD – 32 and 64 digit accuracy ● PARI/GP – Algebra C library + shell ● pde1d.blogspot.com
  • 10. Floating Point Numbers ● EPSILON – Smallest number such that 1.0 + ϵ != 1.0 or, if δ<ϵ 1.0 + δ = 1.0 ● Floating Point numbers – IEEE 754 - 2008 ● ● – – FLT_EPSILON = 1.19209e-07 DBL_EPSILON = 2.22045e-16 CPU registers may use higher precision Detailed definitions vary by factor of ~2 pde1d.blogspot.com
  • 11. Precision Loss ● Rapidly varying functions o arccos( 0.99999999984769129011 ) = 0.001 o arccos( 0.99999999939076516049 ) = 0.002 th Change in 10 place doubles result ● Subtraction of nearly equal numbers   3.14159292035xxx ­ 3.14159265359xxx 0.00000026676xxx 12 place accuracy reduced to 5 places pde1d.blogspot.com
  • 12. Quadratic Formula −b± √ b −4 a c X= 2a 2 2 a X +b X +c=0 ● 2 What if b ≈ 4ac √ or 2 2 b ≫ ∣4 a c∣ or b ≪ ∣4 a c∣ 1 EPSILON ⇒ Loss of digits 2 pde1d.blogspot.com
  • 13. Quadratic Equation Examples Traditional and alternate solution formulations* ● 2 Enter a,b,c: 1 -2 0.9999999999999996 X = 1.00000002107342 , 0.999999978926576 Err: 0 , -1.11022e-16 Alt. sol. X = 1.00000002107342 , 0.999999978926576 Err: 0 , 0 2 Enter a,b,c: 1 -2000000 1 X = 1999999.9999995 , 5.00003807246685e-07 Err: -0.000240445 , -7.61449e-06 Alt. sol. X = 1999999.9999995 , 5.00000000000125e-07 Err: -0.000240445 , 0 b ≈ 4ac b ≫ 4ac 2 b ≪ 4ac Enter a,b,c: 10000 1 -10000 X = 0.99995000125 , -1.00005000125 Err: -1.81899e-12 , 0 Alt. sol. X = -1.00005000125 , 0.99995000125 Err: 0 , 0 *Acton, Forman S., “REAL Computing Made Real”,pp 5-6, Dover, 2005/ Princeton Press 1996 pde1d.blogspot.com
  • 14. It's About Time Not the 1966 TV show ● The value of time is inversely proportional to the amount remaining ● Example, 50 times slower ● – – ● 1 millisecond computation 4 day computation Some times for 500X500 grid – Python ~30 min, numpy ~30sec, f2py ~2 sec “Numerical Computing with SAGE”, pg 18, Aug 15, 2013 pde1d.blogspot.com
  • 15. Time Cost of Precision Double(15) – baseline gotoBLAS ● DD(32) – 11 to 312 X ● QD(64) – 109 to 3060 X ● GMP(77) – 132 to 3700 X ● GMP(154) – 197 to 5900 X ● MPFR(154) – 405 to 11500 X ● Times/speeds from MPACK http://www.slideshare.net/NakataMaho/the-mpack-multiple-precision-version-of-blas-and-lapack pde1d.blogspot.com
  • 16. Pick 3 Digits Calculation ● ● ● ● ● ● Pick 3 ordered digits ( 1 2 3 ) Enter twice ( 123123 ) Divide by 11 Divide by 7 Divide by original 3 digit number - Result >bc -l 123123 last/11 last/7 last/123 >dc 123123 11 / 7/ 123 / p pde1d.blogspot.com
  • 17. Paraskevidekatriaphobia th Fear of Friday the 13 ● Today is the first Friday the Thirteenth of 2013 ● In Thirteen weeks the next Friday th the 13 ● Triskaidekaphobia ● – Fear of the number 13 pde1d.blogspot.com
  • 18. 13 A prime number ● Is the smallest emirp ● – ● A happy number – ● 12 + 32 = 10 → 12 + 02 = 1 Wilson prime ( 3 known – 5, 13, 563 ) – ● 31 and 13 are both prime ( (13-1)! + 1 ) % 132 = 0 A Fibonacci number – 1 , 1, 2, 3, 5, 8, 13, 21, 34, … pde1d.blogspot.com
  • 19. What is the smartest mammal ? ● Rabbits – ● * they can multiply very fast Fibonacci – – – – Leonardo Pisano Bigollo of Pisa Illustrated rabbit breeding in 1202 “Liber Abaci” F(n+1) = Fn + F(n-1) , F1 = 1 , F2 = 1 F(n+1) = number of possible arrangements of long and short items n * http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/fibnat.html pde1d.blogspot.com
  • 20. Fibonacci Spiral 8 Chris 73 / Wikimedia Commons 13 1 2 1 5 Appears in Nature - Sunflower seed spirals Spiral with equal packing - Sea Shells ( not csh ) 3 pde1d.blogspot.com
  • 21. Fibonacci & Golden Ratio a F n+1 → ϕ F n n→∞ b b a+b ϕ = = a b ● b a Beautiful Proportion φ, Phi symbol after Phidias – Greek sculpture used and studied pde1d.blogspot.com
  • 22. Golden Ratio Uses ● Penrose Tiles – – Non-repeating pattern Phi ratio of tiles 1 ● φ 1 Φ 2011 Nobel Prize – – Quasicrystals 3D Non-repeating Sir Roger Penrose Solorflare100 Wikimedia Commons 1 2π o ϕ = 2 cos( 5 ) = 2 cos(72 ) = Φ pde1d.blogspot.com
  • 23. Calculating Golden Ratio 1 ϕ = 1+ 1 1+ 1 1+ 1+. . . ϕ = Golde n Mea n Divin e P ro portio n Gold en Se c ti o n √1+ √1+ √ 1+ √ 1+ √1+... 1+ √ 5 ϕ = 2 Do you like stand-up comedians? pde1d.blogspot.com
  • 24. One Liners for Gloden Ratio ● Continued fraction – – ● Continued squareroot – – ● echo “67k 1[dsb1r/1+pdlb!=c]dscxq” | dc 163 iterations dc -e “67k1[dsb1+vpdlb!=c]dscxq” 133 iterations Fibonacci – – echo "67k1sa1d[sclardsa+dla/pdlc!=b]dsbx" | dc 163 iterations pde1d.blogspot.com
  • 25. Golden Ratio by dc ● Equation - 67k5v1+2/p Actions 67 Push '67' Stack 67 k Pop → set precision 5 Push '5' 5 v Pop → Sqrt → Push 2.236... 1 Push '1' 1 ; 2.236... + Pop 2 → add → Push 3.236... 2 Push '2' 2 ; 3.236... / Pop 2 → divide → Push 1.618... p Pop → print → Push 1.618... pde1d.blogspot.com
  • 26. More dc echo 67k5v1+2/dd*rd1r/[0]Ppsapsapq | dc 0.6180339887498948482045868343656381177203091798057628621354486227052 1.6180339887498948482045868343656381177203091798057628621354486227052 2.6180339887498948482045868343656381177203091798057628621354486227050 0.816033...6227052 1.816033...6227052 2.816033...6227050 1 ϕ = Φ = ϕ−1 2 ϕ = ϕ+1 pde1d.blogspot.com
  • 27. Python Decimal Numbers > python >>> 1.1+2.2 3.3000000000000003 >>> from decimal import * >>> getcontext().prec=67 >>> phi = ( Decimal('5').sqrt() + 1 ) / 2 >>> print 1/phi, 'n', phi, 'n', phi*phi 0.618033988749894848...21354486227050 1.618033988749894848...2135448622706 2.618033988749894848...2135448622708 pde1d.blogspot.com
  • 28. Irrational Number Power ● Can an irrational number to an irrational power give a rational result ? √(2) √(2) (( √2) ) = 2 > python >>> from decimal import * >>> getcontext().prec=67 >>> s = Decimal(2).sqrt() >>> print (s**s), "**", s 1.6325269194381528447734... ** 1.4142135623730950488016... >>> print (s**s)**s 2.000000000000000000000000000000000000000000000000000 000000000000002 pde1d.blogspot.com
  • 29. Chaos ● Maxwell Smart's arch nemesis – ● ● Lorenz's Strange Attractor Wikimedia commons Butterfly effect – ● KAOS Small initial difference yield a large impact Non-periodic behavior Example recurrence relations – Logistics equation x n+1 = r x n (1−x n ) – , 3.82843 < r ≤ 4 , 0 < x < 1 or 2 n x n+1=x − 2 , −2 < x < 2 pde1d.blogspot.com
  • 30. 2 n X0 = 0.5 vs 0.49... x n+1=x − 2 2 1.5 1 0.5 Xn 0 -0.5 -1 -1.5 -2 -2.5 0 2 4 6 8 10 12 14 16 18 20 Iteration n X_0=0.5 2.5 Twelve Nines X_0=0.4999999999999 Rain 2 1.5 1 Xn 0.5 0 -0.5 -1 -1.5 -2 -2.5 80 82 84 86 88 90 92 94 96 98 100 Iteration n X_0=0.5 X_0=0.4999999999999 pde1d.blogspot.com
  • 31. 2 n Recurrence Relation x n+1 = x − 2 ● An infinite number of initial values end with x = 2 – x 0 = √ 2 , x 1=0 , x 2 =−2 , x 3=2 , x 4 =2 , . . . 2 n x n+1 = x − 2 x=0 for( i=1; i<30; i++) { x= sqrt(x+2) print i, " ", x, "n" x= - sqrt(x+2) print i, " ", x, "n" } → x n−1 = ± √ x n + 2 27 .6180339887498950... 27 -1.6180339887498949... 28 .6180339887498947... 28 -1.6180339887498948... 29 .6180339887498948... 29 -1.6180339887498948520... ±ϕ → Φ → −ϕ → Φ → −ϕ → . . . pde1d.blogspot.com
  • 32. ● I know I am not good at math, but if I can get 95% of problems right, who cares about the other 10% pde1d.blogspot.com
  • 33. Founding Fathers & Mathematics ● Thomas Jefferson – Kept good numerical records ● – – U.S. Currency Mathematics to U.S. Universities ● ● – University of Virginia West Point Statistics to guide laws ● – Corrected Newton's Math Limited duration laws ( 20 Yrs ) Concerning distribution of Representatives by state ● Any law should “reduces the apportionment always to an arithmetic operation, about which no two men can ever possibly differ.” Cohen, I.B.,”The Triumph of Numbers, How Counting Shaped Modern Life”, W.W.Norton & Company, New York, 2005 pde1d.blogspot.com
  • 34. Eliminate Soldier's Helmets ? Britain almost stopped issuing steal helmets in WW I ● generals began to call for their removal as they increased incidences of headwounds twelvefold and doubled total casualties ● A fatality was not a casualty ● http://tvtropes.org/pmwiki/pmwiki.php/Main/LiesDamnedLiesAndStatistics pde1d.blogspot.com
  • 35. Flue Shot ? ● ● ● Based on three studies, getting the flu shot reduces chance of getting the flu by 5% 73% effective at preventing the flu http://blog.minitab.com/blog/adventures-in-statistics/how-effective-are-flu-shots pde1d.blogspot.com
  • 36. Founding Fathers & Numbers ● Benjamin Franklin – Inventor ● ● ● – Founder ● ● ● – – – Lightening Rod Franklin Stove Bifocals Public Library Fire Company Police Service Post Office Electricity Magic Squares http://www.math.wichita.edu/~richardson/ pde1d.blogspot.com
  • 37. Magic Squares Sum of numbers in rows, columns 8 1 6 and diagonals are equal 3 5 7 ● Unique number per cell 4 9 2 ● Pattern for odd number squares ● B C D 2 =H3+1 =B3+1 =C3+1 3 =H4+1 =B4+1 =C4+1 4 =H5+1 =B5+1 5 =H6+1 6 E 1 F G H =E3+1 =F3+1 =G3+1 =D4+1 =E4+1 =F4+1 =H2+1 =D3+1 =D5+1 =E5+1 =F5+1 =G5+1 =B6+1 =C6+1 =D6+1 =E6+1 =G4+1 =G6+1 =H7+1 =C5+1 =C7+1 =D7+1 =E7+1 =F7+1 =G7+1 7 =H8+1 =B8+1 =C8+1 =D8+1 =F6+1 =F8+1 =G8+1 8 =B7+1 =B2+1 =C2+1 =D2+1 =E2+1 =F2+1 =G2+1 pde1d.blogspot.com
  • 38. 11 X 11 Magic Square – by Spreadsheet pde1d.blogspot.com
  • 39. 4x4 Half Rows = Half Sum – – Ben's Bent Diagonals ● 2056 http://www.math.wichita.edu/~richardson/ pde1d.blogspot.com
  • 40. Music is About Fractions ● Not just quarter note, eight note but tuning scales 1 Step = 2 12 √2 frequency ( A# ) 12 = √ 2 ∗ frequency ( A ) ● Independent of base note 1 Fraction Error 1.0595 1.1225 ≈ 9/8 -0.0023 1.1892 ≈ 6/5 -0.0091 1.2599 ≈ 5/4 0.0079 1.3348 ≈ 4/3 0.0011 1.4142 ≈ 7/5 0.0101 1.4983 ≈ 3/2 -0.0011 1.5874 ≈ 8/5 -0.0079 1.6818 ≈ 5/3 0.0090 1.7818 ≈ 7/4 0.0178 1.8877 ≈ 15/8 0.0068 2 pde1d.blogspot.com
  • 42. A Golden Ratio Scale FREQUENCY STEP 1 8*Φ4 1 1.16718 1.167184 2*Φ 1.23607 1.059017 φ2/2 1.30902 1.059017 4*Φ2 1.52786 1.167184 φ 1.61803 1.059017 8*Φ3 1.88854 1.167184 2 1.059017 2 Fractions within 1% 7 6 13 8 15 8 pde1d.blogspot.com
  • 43. Golden Ratio Intervals 3 1.059017... = φ / 4 ● 12 √2 = 1.059463... → 0.04% ● 4 each octave ● 4 1.167184... = 8*Φ ● Can be factored into 3 'half' steps ● – – 1.059017... * 1.059017... * 1.040719... 3 each octave How many total intervals(steps) per octave ? pde1d.blogspot.com
  • 44. I hope you had fun pde1d.blogspot.com