In this new version of Reference for Functional Equations I added several more z-transform pairs. I also started to add binomial transform pairs. The definition for the binomial is not consistent among different authors. I arbitrarily chose one, and later I changed it. I will probably change it again. Several typos were fixed. I am working on a system to include proofs so that the tables can be checked more easily.
You are currently browsing the archive for the Mathematics category.

I finally laid my hands on Donald Knuth’s The Art of Computer Programming (what a wonderful set of books!), and found a neat algorithm for generating random integers 0, 1, 2, … , n – 1, with probabilities p_0, p_1, … , p_(n-1).
I have written about generating random numbers (floats) with arbitrary distributions for one dimension and higher dimensions, and indeed that method can be adapted for generating integers with specific probabilities. However, the method described below is much more concise, and efficient (I would guess) for this special case. Moreover, it is also easy to adapt it to generate floats for continuous distributions.
Tags: 2D, AI, optimisation, probability, Python, random, random distribution, random integer, random number generation
It is sometimes necessary to find the distribution given a sample set from that distribution. If we do not know anything about the distribution, we cannot recover it exactly, so here we look at ways of finding a (discrete) approximation.
Tags: 2D, AI, convolution, distribution estimation, Python, random, random distribution

I have already covered how to generate random numbers from arbitrary distributions in the one-dimensional case. Here we look at a generalisation of that method that works for higher dimensions.
The basic trick, while easy to understand, is hard to put in words (without reverting to mathematical equations). For two dimensions, we divide the plane into slices. Each slice is a 1D distribution. We also calculate a distribution from summing the frequencies in each slice. The latter distribution gives us one coordinate, and the appropriate slice to use. The distribution of that slice then gives the second coordinate. All distributions are put into inverse accumulative response curves as was done to generate one-dimensional random numbers. (You should review that before implementing the 2D case).
In more dimensions, we also slice the space up into 1D distributions. Sums of these give us more distributions, which we can sum again, and again, until we reach a single distribution. This is used for the first coordinate, and to determine which distribution to use for the next coordinate. This goes on, until a 1D slice gives us the final coordinate. Again, all distributions are converted to inverse accumulative response curves.
If the above is unclear, I hope the detailed description below clears things up.
Tags: 2D, AI, distribution function, grids, n-dimensional distributions, Python, random, random distribution, random number generation, response curve, Special Numbers Library
I have not posted in a while; one reason is that I got sucked into some interesting mathematics; the work-in-progress Reference for Functional Equations is the result. If you are interested in such things – have a look.
For many applications, detailed statistical models are overkill. Instead, we can get away with a rough description of the distribution – not in mathematical formula form, but just as a graph with a few sample points.
For example, when trying to model the traffic around a school, you might know that the graph looks something like this:

The input is the number of minutes before the first bell rings, and the output the number of children dropped off at that time. You know that most kids are brought before the bell rings, and that the closer to the bell, the more kids are being brought every minute. Only a few kids are late.
This tutorial describes how to generate random numbers that can generate a distribution described by an arbitrary (piece-wise linear) curve, as the one above.
Tags: AI, C++, distribution function, Mathematics, probability, Python, random, random number generation, response curve, sampling, Special Numbers Library

Recent Comments