This is not really the next part in my randomness series, but more of an aside. I used Maple's embedded components to use the Lotto649 drawing data from my last post to create a historical lottery simulator. Basically, you fill in your prefered numbers, and it simulates you playing the lottery in every draw since 1982.

In this series of blog posts, I have picked on Baseball win-loss records already. Looking for other sources of things that might or might not be random, I decided to look at lottery draws. Since I live in Canada, the obvious lottery to look at is the national Lotto 6/49.

A lotto 6/49 draw consists of drawing 6 numbered balls from...

I lived in the UK before making the barely-considered decision to move to Canada. I still have savings denominated in pounds sterling (all dutifully declared on my Canadian tax return). Accordingly, I keep a close watch on the GBP-CAD exchange rate so I have some sense of my net worth.

When I arrived in Canada in July 2008, one pound sterling bought $2, down from $2.30 two years before that. Today, the pound has devalued further and is worth around...

In a series of posts now imported to the Maplesoft blog (starting here), I have been talking about pseudo-random number sequences, but since part of what kicked off this series was a paper on true random number generation (with LASERS!) I thought I would share some routines I wrote that alllow you to use the two main true random number sources available on the web (neither using lasers, sadly).

I spent this past week preparing a Webex presentation to a client who was interested in using Maple for a physics course in chaos. Of the two texts selected for the course, I had one on my own bookshelf. So I scanned Steven Strogatz' text Nonlinear Dynamics and Chaos (Addison Wesley, 1994) for topics that would profit from investigation with Maple.

One of the best things about growing up in the “Hood” is that it feels really good when you leave. I grew up in a neighborhood called Downsview in Toronto whose claim to fame used to be it was the home to the DeHavilland Aircraft company but today is more associated with ongoing issues of crime, poverty, and many other urban illnesses. So every time I hear that someone from the Hood did something great, I take notice and I take special pride. This is the story about...

In this post I'll introduce is a nice visual test of randomness from signal processing. The main idea of this test to look at how a random sequence correlates with itself.

It's been a while since I wrote one of these random posts, but I still have a couple more I wanted to write. In this post, I want to describe one of the tests used in the paper that initially inspired this series of posts: the Wald-Wolfowitz runs test. This test is interesting in that it does not test for uniformity

A sign of a very successful period of work is the tally of how many email messages I’ve written that start with … “First, let me apologize for the delay in my response…” Yes, if you are the recipient of one of these notes from me, you’re probably more annoyed than pleased that I’m finding lots of very interesting things to fill up my ever-shrinking Outlook schedule. It’s been one heck of a summer, and I’m behind on countless...

As alluded to in my previous post in this series, one of the most straight forward ways to test if a PRNG is generating good random sequences is by examining the frequency of 0's and 1's. This is just a couple lines in Maple using Statistics:

(**) r1 := rand(0..1):L := [seq(r1(), i=1..10000)]:(**) n := nops(L); tally := `+`(op(L));(**) Statistics:-ChiSquareGoodnessOfFitTest( [n-tally, tally], [n/2, n/2], ':-output'=':-hypothesis');

Consider the following C code:

Today is my birthday, and in fact it is also the birthday of at least one other Maplesoft employee (not surprising since more than 23 people work here - considering the generalized birthday problem, I even know of 3 people here who share the same birthday). Of course, it turns out that birthdays are not evenly distributed through out the year and so I wanted to know if someone with an August birthday is more likely to share than someone with an April birthday.

Continuing on in this series of posts, here is a way to test the randomness of a sequence of bits from a PRNG that is the appropriate to the first morning back after the August long weekend. It is a very fast, and not very formal test done by checking how well a sequence compresses. This is really easy in Maple 14, with the new commands ?StringTools:-Compress and StringTools:-Uncompress which use ...

A while back, someone asked me for a good way to plot a Klein Bottle in Maple. I didn't have a good answer at the time, but I recently stumbled upon the following, which does a pretty good job if you don't mind the use of Heaviside in the parameterization.

plot3d( [4*(1-1/2*cos(u))*sin(v), 6*cos(u)*(1+sin(u))+4*(1-1/2*cos(u))*(cos(u)*(1-Heaviside(u-Pi))+Heaviside(u-Pi))*cos(v+Pi*Heaviside(u-Pi)),

In a previous post, I promised to write about testing the quality of pseudo-random number sequences. I'll post later about some of the statistical tests often used, but I first wanted to mention a sort of practical test one can do. One of the many things you might want to do with pseudorandomly generated numbers is Monte Carlo integration/simulatation/etc. As mentioned by acer in this comment, Monte Carlo integration can be shown to work better with some of the pseudorandom number generators (PRNGs) which are considered inferior in a statistical sense. In this post, we will play with a simple Monte Carlo approximation of π.

You must be logged into your Facebook account in order to share via Facebook.

Click the button below to share this on Google+. A new window will open.

You must be logged in to your Twitter account in order to share. Click the button below to login (a new window will open.)

Please log-in to your MaplePrimes account.

Wrong Email/Password. Please try again.

See All