Tuesday, October 28, 2014

Happy 20^2 (400th Blog Post)

Hello everyone,

This is the 400th blog entry.  I want to thank everyone who follows my blog, reads, and comments on my blog.  You rock!

For today’s blog entry, here are some mathematical, and fun facts regarding the number 400.



Mathematical Facts:

20^2 = 400

The divisors of 400 are: 1, 2, 4, 5, 8, 10, 16, 20, 25, 40, 50, 80, 100, 200, and 400.  The sum of these divisors is 961. 

The prime factorization of 400:  400 = 2^4 * 5^2

400 is a composite number.  The nearest primes to 400 are 397 and 401.

Totient function:  ϕ(400) = 160.  That is, there are 160 positive integers less than 400 that are coprime to 400.  That is, the GCD of 400 and such coprime numbers is 1.

A square matrix of 400 x 400 has 160,000 elements.

A gradian (also symbolized as gon) is an angle measure, splitting a circle in 400 angular units.  The gradian is primarily used in civil engineering and surveying in Europe. 

180° = π radians = 200 gon


Computing and Calculator Facts:

The Hewlett Packard HP 12C Platinum Edition finance calculator has a programmable memory of 400 steps. 

Atari released the Atari 400 computer in late 1979.  It was an entry-level computer.  Specifications include:  1.8 MHz processor, 8K RAM (expandable to 48K), and uses a TV screen a monitor.  Resolution of the computer varies, 320 x 192 monochrome to 160 x 96 color screen.  The Atari 400 used cartridges to run programs and games. 

A YouTube Video on the Atari 400, one of many:  https://www.youtube.com/watch?v=UNf8OQaud2M

  
Science Facts:

Visible light that has a wavelength of 400 nm (nanometers) has the color of violet.

On average, the average distance from the Sun to Earth is about 400 times the average distance from the Moon to Earth.     (http://space-facts.com/solar-eclipse/)

A person who has lived 400 days is of age 1 year, and a little more than 1 month.

Rules of the Gregorian Calendar:  Most century years, 1900 and 2100 for example, are not leap years.  However, century years that are divisible by 400, such as 1600, 2000, and 2400, are leap years. (http://www.timeanddate.com/date/leapyear.html)

Games:

If you went around the entire board on a Monopoly game 10 times, you would traveled 400 spaces.

The card game 400, originated in Lebanon, is a trick taking game between two teams of two players.  In 400, players individually make bids to how many tricks they can win.  Hearts is the trump suit.


If you want to play online: http://www.400cards.com/index.php


Business and Entertainment Facts:

This will probably make you jealous, inspired, or maybe both:  Forbes Magazine keeps track of the richest 400 individuals in the United States.  In 2014, the net worth of the Forbes 400 is a combined $2.29 trillion.  (http://www.forbes.com/forbes-400/)

The Barron's 400 index is an index of 400 top stocks.  (http://online.barrons.com/public/page/barrons_400.html)

The Brickyard 400 is an annual NASCAR race in Indianapolis, Indiana.  The race is 400 miles, or about 643.739 km.  (http://en.wikipedia.org/wiki/Brickyard_400http://www.indianapolismotorspeedway.com/events/brickyard)

The Walking Dead: The First Season video game by Telltale had a downloadable episode titled “400 Days”, designed as an episode bridge between seasons 1 and 2.  (http://walkingdead.wikia.com/wiki/400_Days)

There is a German music electronic artist named Kenkraft 400.  Chances are if you been to a recent sports event, you have heard “Zombie Nation”. 


Happy 20^2!

Eddie

This blog entry is property of Edward Shore.  2014

Monday, October 27, 2014

HP 12C: Games, Black Scholes, It's History and Solver

At the request of Gene and Thomas Klemm,  here are some more articles and goodies regarding the classic HP 12C calculator:

Article:  "The HP-12C, 30 Years and Counting"  - Richard Nelson and Gene Wright.  

Published in the HP Solve web-letter, October 2011.  This article explains why Hewlett Packard's HP 12C has been a mainstream in the financial calculator market for more than 30 years.  The HP 12C was originally released in 1981. 

Some of the praises of the HP 12C include its long battery life, unclutter keyboard, programming ability,  and a good financial function set.  In 2003, Hewlett Packard released the Platinum Edition of the HP 12C. 

Link:

https://dl.dropboxusercontent.com/u/10022608/_HP-12C%2030%20Yrs%20%26%20Counting%20V6.pdf

Solving Polynomial Equations

In this article, Valentin Albillo shows how the cash flow feature of the HP 12C can be used to solve polynomial equations.  (Datafile V21 N2 - March/April 2002)

Link:

http://www.hpcc.org/datafile/V21N2/V21N2P35.pdf

Games on the HP 12C

Want some games on the HP 12C?  Check out eight programs programmed by Tony Hutchins:
(Datafile V25 N4 - July/August 2006)

Games include:

Craps:  Start by assigning a random seven digit decimal and storing it in [i] and your initial bankroll in [FV].  Each bet is placed in the display before pressing [R/S].  Each dice roll will show tt.xxxx: where tt = total of the dice, xxxx represents the two individual dice.  Example:  7.52:  you rolled a 7 and the dice showed a 5 and a 2.

Dealer/Lotto Routine:  This works with sample without replacement. 

Jive Turkey: Or for you The Price is Right fans, the Clock Game, minus the clock.  The score is indicated by the number of guess you needed to get the right number.  The secret number is between 0 and 99. 

Super Bagels:  Another guess the number game.

Sum of Digits: A number guess game that uses the sum of the digits.

Pontoon/Blackjack:  Simulate the drawing and strategy of each player.  Start by giving a seven-digit seed and storing it in [i].  Press [R/S] to draw new cards.  A negative score indicates a bust. 

Fruit Machine:  Slot machine simulator. 

Lunar Lander:  Land a rocket on the Moon - if you can.  It is a classic calculator game of the 1970s.

Link:  http://www.hpcc.org/datafile/hp12/12c_EightGames.pdf

Full Accuracy of Trigonometry Functions

Not to long ago, I posted two short programs that you can get rough approximations of sine and cosine. This article by Valentin Albillo presents a 99 step program where you can calculate trigonometric functions to full calculator accuracy:

http://web.archive.org/web/20121216113919/http://membres.multimania.fr/albillo/calc/pdf/DatafileVA003.pdf

(DataFile VA003)

Thanks to Jeff Kearns for this suggestion.

Black-Scholes

If you are looking to input an algorithm for Black-Scholes, this article may be what you need.  The article is presented by Tony Hutchins, featuring programs by Dr. Peter Carr (UCLA).

Link:  http://www.hpcc.org/datafile/V23N3/V23N3P25.pdf

(DataFile V23 N3 - May/June 2004)


Amazing what can be done with a financial programming calculator.   Here's to at least another 30+ years of the amazing HP 12C. 

This blog is property of Edward Shore - 2014




 

More Fun with HP 12C (sine, cosine, error function approximations)


Fun with HP 12C Part II


Sine Approximation

Source:  Ted’s Math World, Calculator Magic #4

 
Retrieved 2014-10-13

sin x ≈ (((x^2/72 – 1)*x^2/42 + 1)*x^/20 – 1)*x^2/6 + 1)*x

 Registers:  R0 = x in radians, R1 = sin x

 
STEP
KEY
CODE
STEP
KEY
CODE
01
STO 0
44, 0
21
0
0
02
2
2
22
÷
10
03
y^x
21
23
*
20
04
ENTER
36
24
1
1
05
ENTER
36
25
-
30
06
ENTER
36
26
X<>Y
34
07
7
7
27
6
6
08
2
2
28
÷
10
09
÷
10
29
*
20
10
1
1
30
1
1
11
-
30
31
+
40
12
X<>Y
34
32
RCL 0
45, 0
13
4
4
33
*
20
14
2
2
34
STO 1
44, 1
15
÷
10
35
GTO 00
43, 33, 00
16
*
20
 
 
 
17
1
1
 
 
 
18
+
40
 
 
 
19
X<>Y
34
 
 
 
20
2
2
 
 
 

 
Examples:

sin 0.25 ≈ 0.2474

sin -1.82 ≈ -0.9691

Cosine Approximation

Source:  Ted’s Math World, Calculator Magic #4


Retrieved 2014-10-13

cos x ≈ (((x^2/56 – 1)*x^2/30 + 1)*x^2/12 – 1)*x^2/2 + 1

Registers:  R0 = x in radians, R1 = cos x
 
STEP
KEY
CODE
STEP
KEY
CODE
1
STO 0
44, 0
17
1
1
2
2
2
18
+
40
3
Y^X
21
19
X<>Y
34
4
ENTER
36
20
1
1
5
ENTER
36
21
2
2
6
ENTER
36
22
÷
10
7
5
5
23
*
20
8
6
6
24
1
1
9
÷
10
25
-
30
10
1
1
26
X<>Y
34
11
-
30
27
2
2
12
X<>y
34
28
÷
10
13
3
3
29
*
20
14
0
0
30
1
1
15
÷
10
31
+
40
16
*
20
32
STO 1
44, 1
 
 
 
33
GTO 00
43,33,0
 
 
 
 
 
 

 
cos 0.33 ≈ 0.23847605343

cos -0.58 ≈ 0.83646264991

 
Rough Approximation for erf(x)

If x ≤ 1, accuracy is at least 3 digits.  Method:  3/8 Integration Rule

Source:  Ball, John A.   “Algorithms for RPN Calculators” John Wiley & Sons:  1978.

STEP
KEY
CODE
STEP
KEY
CODE
1
STO 0
44, 0
26
CHS
16
2
3
3
27
e^x
43, 22
3
÷
10
28
+
40
4
2
2
29
8
8
5
Y^X
21
30
÷
10
6
CHS
16
31
3
3
7
e^x
43, 22
32
*
20
8
ENTER
36
33
RCL 0
45, 0
9
RCL 0
45, 0
34
*
20
10
2
2
35
3
3
11
*
20
36
÷
10
12
3
3
37
1
1
13
÷
10
38
.
48
14
2
2
39
1
1
15
Y^X
21
40
2
2
16
CHS
16
41
8
8
17
e^x
43, 22
42
3
3
18
+
30
43
7
7
19
3
3
44
9
9
20
*
20
45
7
7
21
1
1
46
*
20
22
+
40
47
GTO 00
43,33,00
23
RCL 0
45, 0
 
 
 
24
2
2
 
 
 
25
Y^X
21
 
 
 

 

Examples:

x = .15;  Result ≈ 0.1680

x = .50;  Result ≈ 0.5205

x = 1.25; Result ≈ 0.9220  (actual ≈ 0.9229)
 
 
This blog is property of Edward Shore, 2014.

 

 

Casio fx-9750GIII and fx-CG 50: Playing Games with the Probability Simulation Mode

Casio fx-9750GIII and fx-CG 50: Playing Games with the Probability Simulation Mode The Probability Simulation add-in has six type...