Showing posts with label random number generators. Show all posts
Showing posts with label random number generators. Show all posts

Monday, September 19, 2022

HHC 2022 Conference Videos

HHC 2022 Conference Videos


Coming to you from Nashville, Tennessee!


"We're Not Dead Yet"


And if it is any indication, HHC is doing alive and well.


I had the pleasure of attending HHC 2022 in Nashville a week ago.   Most of the talks from HHC 2022 have now been loaded on to hpcalc.org's YouTube channel:


https://www.youtube.com/c/hpcalc/videos



Highlights


*  The ill-fated Texas Instruments TI-88 that was never released in to the public.  How did it fail and what caused Texas Instruments to call off the project after five years?  


*  Updates on the new software for Telsa's automobiles for the Elon Musk fan base. 


*  The HP 10 referred to in Jim Johnson's talk is not the HP 10B or HP 10C, it is the 1978 HP 10 mini-adding machine.   I believe that this is Hewlett Packard's only adding machine type of calculator.


* APF Electronics, Inc manufactured calculators in the 1970s, focusing on four-function and scientific calculators.


*  Bob Prosperi's "When Ordan was New" is about the upcoming Swiss Micros DM32, which is an improved reimplementation of the popular HP 32SII.  


*  The "Everything But The Kitchen Sink" is not about a sink, or a kitchen, but something for the HP 85 and HP 87 computers. 


*  I made a presentation of the advanced functions of the solve feature of the Plus42 app on Day Two.  The Plus42 is by Thomas Okken.  


*  Day One lasted from 8:00 AM to 10:00 PM, and believe it or not, the day goes by fast!   On Day Two we started about 9:30 AM.   Per tradition, Day Two invites attendees to attend an optional Catholic Sunday mass. 


* Door prizes included over 60 calculators and lots of books.  I have a second HP 20S and won a few vintage calculator manuals.  


* Day Two started with an online talk with Klass Kuperus, HP Product Manager of Moravia Consulting.  In the last few years, Hewlett Packard transferred their calculator operation to Moravia Consulting, with the United States market in charge by Royal Consumer.  HP office supply's page:  https://hpofficesupply.com/product-category/calculators/.  Any further updates to the HP Prime's firmware will I get to you as soon I learn of it.  


* The "Actuarial Math" presentation gives a great introduction of calculating the cost of life insurance. 


Videos (as of 9/18/2022) are:


Day One - September 10, 2022


Calculator Patents and How to Find Them - Felix Gross

https://www.youtube.com/watch?v=7ylp17D2tDY


TI-88 Part 1: History of Go/No Go Decision - Gene Wright

https://www.youtube.com/watch?v=wl16wzmn3wA


TI-88 Hardware Tour - Richard Nelson

https://www.youtube.com/watch?v=AuujYrzSyJk


Autonomous Vehicle Status - Telsa's Full Self Driving in 2022 - David Ramsey

https://www.youtube.com/watch?v=4d-ERZgOO5s


What's New on the HCC 2022 USB Drive - Eric Rechlin

https://www.youtube.com/watch?v=FuR3VlWT0-0


If you want a USB Drive, please check on the hpcalc.org's commerce page.  It will be available soon (I don't know the exact date), the drive is sold at cost.  https://commerce.hpcalc.org/


What's New in the PPC Achieve - Jake Schwartz

https://www.youtube.com/watch?v=cWM6ZTan0_o


As of this post, the current version is 2.41, April 1, 2022.  The next update is scheduled later in 2022.   http://www.pahhc.org/ppccdrom.htm


When Ordan was New - Bob Prosperi

https://www.youtube.com/watch?v=kC4qqOmnVUs


TI-88 Part 2:  Features, Comparisons, and Verdict - Gene Wright

https://www.youtube.com/watch?v=xIHaSpvDu0o


Everything But The Kitchen Sink - David Ramsey

https://www.youtube.com/watch?v=tw0oMjgftkY


HP-10 Calculus with Focus on the HP-10 Printer - Jim Johnson

https://www.youtube.com/watch?v=44jsRmrs4_w


Calculator Humor - Gene Wright

https://www.youtube.com/watch?v=FPwUL7kWbHs


APF Calculators - Gene Wright

https://www.youtube.com/watch?v=5IyICERuQWQ



Day Two:  September 11, 2022


Literature Achieve Update - Eric Rechlin

https://www.youtube.com/watch?v=MA9_0q7g96g


Plus42:  Advanced Equation Editor Functions - Edward Shore

https://www.youtube.com/watch?v=8Hk74yB1DhA


Best New Simple PRNGS (pseudo-random number generators) for Calculators: a Pandora's Box - Namir Shammas

https://www.youtube.com/watch?v=NvdBFTZF4SE


Actuarial Math - Adding Morality To The Time Value of Money - Gene Wright

https://www.youtube.com/watch?v=MAmC4An9LrU


Texas Instruments SR-60A Programmable Calculator - David Ramsey

https://www.youtube.com/watch?v=0Mf5rZbrx7k


Namir Shammas - The Best Empirical Multiple Regression Model. 

https://www.youtube.com/watch?v=w_rwLmjFC7E


Disclaimer:  I do not make money from the sales of the HHC USB drives or nor I was paid to advertise.  


Happy calculating,


Eddie 


All original content copyright, © 2011-2022.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Sunday, March 21, 2021

HP Prime: Testing Random Normal Distribution Generators

 HP Prime:  Testing Random Normal Distribution Generators


Introduction


The HP Prime's randNorm generates random numbers to fit a normal distribution curve.  The Box-Muller Method is used, and calls for the use of the formula:


x1 = √(-2 * ln u1) * cos(2*π*u2) 


where

u1 and u2 came from random generated numbers which takes the values in the range [0, 1).


The Box-Muller Method also includes a second formula, which isn't used by the calculator:


x2 = √(-2 * ln u1) * sin(2*π*u2) 


I imply that the radians mode is used in this calculation.  


What about using the direct normal distribution function?


(I)  y = 1/√(2*π) * e^(-x^2/2) 


Where y represents the probability and the maximum value y can take is when x=0:


(II)   y = 1/√(2*π) 


Solving (I) for x returns the solution:


(III) x = ± √(-2*ln(y*√(2 * π)))


Can (III) be a generator of random numbers that fit a normal distribution?   


TESTBX uses the cosine portion of the formula to generate random numbers:


x = √(-2 * ln u1) * cos(2*π*u2) 


While TESTND uses the following formula to generate random numbers:


x = u2 * √(-2*ln(u1*√(2 * π)))


where: u1 a random number between [0, 1) and u2 is either -1 or 1 chosen at random.  To accomplish the -1 or 1 choice, I use a wide range of random integers. 


The programs generate a list of 300 data points and I used a histogram plot of four samples to see whether the sample fits a normal curve.  While this isn't a rigorous proof, the plots give an idea of what the results would look like.  


HP Prime Program: TESTBX


EXPORT TESTBX()

BEGIN

// Box-Muller, 300 points

// EWS 2021

// Radian mode

HAngle:=0;


LOCAL u1,u2,i,x,l;

l:={};

FOR i FROM 1 TO 300 DO

u1:=RANDOM();

u2:=RANDOM();

x:=√(−2*LN(u1))*COS(2*π*u2);

l:=CONCAT(l,{x});

END;

RETURN l; 


END;



HP Prime Program: TESTND


EXPORT TESTND()

BEGIN

// Normal Dist, 300 points

// EWS 2021

// Radian mode

HAngle:=0;


LOCAL u1,u2,i,x,l,m;

l:={};

FOR i FROM 1 TO 300 DO

// maximum

m:=1/√(2*π);

u1:=m*RANDOM();

u2:=SIGN(RANDINT(−100,101));

x:=u2*√(−2*LN(u1*√(2*π)));

l:=CONCAT(l,{x});

END;

RETURN l; 


END;



As you can see, the four samples match nowhere near a normal distribution curve.  Clearly, the Box Muller transform does a better job.   


Sources:


"Box-Muller transform" Wikipedia.  Last edited December 27, 2020.  https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform  Retrieved January 20, 2021.


"Which formula does randNorm use?"  Thread.  The Museum of HP Calculators.  Last edited October 31, 2017.  https://www.hpmuseum.org/forum/thread-9403.html  Retrieved January 21, 2021.  


Eddie


All original content copyright, © 2011-2021.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


First Look: HP 16C Collector's Edition

 First Look: HP 16C Collector's Edition I just got the HP 16C Collector's Edition.   This is the famous HP 16C that specializes in c...