Results for: Random Numbers

Digital Simulation of Rubik’s Cube with Qube 2

This blog post describes Qube, my Rubik's Cube simulator. Source code for Qube is now available in one single file from this link: Qube_osf.m. I will also submit the code to the MATLAB Central File Exchange. As usual, I welcome any feedback.... read more >>

Benchmarking a GPU 5

I recently acquired a GPU, a graphics processing unit. It's called a GPU because such processors were originally intended to speed up graphics. But MATLAB uses it to speed up computation. Let's see how the gpuArray object benchmarks on my machine. I have been doing computer benchmarks for years. I like to do profiles where I vary the size of a task and see how the amount of memory required affects performance. I always learn something unexpected when I do these profiles. Ben Todoroff is on the MathWorks Parallel Processing team. Last year he contributed #34080, gpuBench to the MATLAB Central File Exchange. He has been able to compare several different GPUs. I am going to consider the performance of only one GPU, but in more detail. Important note. This is only about double precision. Single precision is another story. ... read more >>

USA Traveling Salesman Tour 4

Find the optimum traveling salesman tour through the capitals of the 48 contiguous states in the USA.... read more >>

How Far Apart Are Two Random Points in a Square? 5

How far apart can you expect two points chosen at random in the unit square to be? I found this problem on the YouTube channel maintained by Presh Talwalkar, Mind Your Decisions. He correctly calls it a very hard puzzle. At first, I guessed the answer might be $1/2$. But the correct answer is more interesting than that.... read more >>

Ulps Plots Reveal Math Function Accuracy 2

"ULP" stands for "unit in the last place." An ulps plot samples a fundamental math function such as $\sin{x}$, or a more esoteric function like a Bessel function. The samples are compared with more accurate values obtained from a higher precision computation. A plot of the accuracy, measured in ulps, reveals valuable information about the underlying algorithms.... read more >>

Season’s Greetings Fractal 6

I don't recall where I found this seasonal fractal. And I can't explain how it works. So please submit a comment if you can shed any light on either of these questions.... read more >>

The Ziggurat Random Normal Generator

This is the third in a multi-part series on the MATLAB random number generators. MATLAB has used variants of George Marsaglia's ziggurat algorithm to generate normally distributed random numbers for almost twenty years. ... read more >>