Publications by Matt Asher
Reaching escape velocity
Sample once from the Uniform(0,1) distribution. Call the resulting value . Multiply this result by some constant . Repeat the process, this time sampling from Uniform(0, ). What happens when the multiplier is 2? How big does the multiplier have to be to force divergence. Try it and see: iters = 200 locations = rep(0,iters) top = 1 multiplier = 2...
708 sym R (565 sym/1 pcs) 8 img
Weekend art in R (Part 2)
I put together four of the best looking images generated by the code shown here: # More aRt par(bg="white") par(mar=c(0,0,0,0)) plot(c(0,1),c(0,1),col="white",pch=".",xlim=c(0,1),ylim=c(0,1)) iters = 500 for(i in 1:iters) { center = runif(2) size = 1/rbeta(2,1,3) # Let's create random HTML-style colors color = sample(c(0:9,"A","B","C","D","E...
528 sym R (540 sym/1 pcs) 2 img
Entropy augmentation the modulo way
Long before I had heard about the connection between entropy and probability theory, I knew about it from the physical sciences. This is most likely how you met it, too. You heard that entropy in the universe is always increasing, and, if you’re like me, that made very little sense. Then you may have heard that entropy is a measure of disorder:...
3816 sym R (420 sym/4 pcs) 6 img
100 Prisoners, 100 lines of code
In math and economics, there is a long, proud history of placing imaginary prisoners into nasty, complicated scenarios. We have, of course, the classic Prisoner’s Dilemma, as well as 100 prisoners and a light bulb. Add to that list the focus of this post, 100 prisoners and 100 boxes. In this game, the warden places 100 numbers in 100 boxes, at ...
4723 sym R (1744 sym/2 pcs) 10 img
R: Clash of the cannon cycles
Imagine a unit square. Every side has length 1, perfectly square. Now imagine this square was really a fence, and you picked two spots at random along the fence, with uniform probability over the length of the fence. At each of these two locations, set down a special kind of cannon. Just like the light cycles from Tron, these cannons leave trails...
3153 sym R (1984 sym/2 pcs) 10 img
Weekend art in R (Part 3)
I have a few posts nearing completion, but meanwhile a weekend break for art. Big thanks to Simon Urbanek and Jeffrey Horner, creators of Cairo, a library for the programming language R. Have you noticed how R can’t anti-alias (fancy way for saying smooth out lines and curves when creating a bit-mapped image)? Cairo can. Make sure to click the ...
815 sym R (1034 sym/1 pcs) 2 img
The Chosen One
Toss one hundred different balls into your basket. Shuffle them up and select one with equal probability amongst the balls. That ball you just selected, it’s special. Before you put it back, increase its weight by 1/100th. Then put it back, mix up the balls and pick again. If you do this enough, at some point there will be a consistent winner w...
1745 sym R (445 sym/1 pcs) 4 img
Weekend art in R (Part 4)
Computer creations are perfect by design. We put in numbers, and if all goes well we get out an exact result. If we want a line, we want it perfectly straight. If we want a circle, it should conform to the platonic ideal of a circle. From a mathematical standpoint, these perfect shapes and precisely computed numbers are ideal. Someday, perhaps, w...
1343 sym R (863 sym/1 pcs) 4 img
Livin’ la Vida Poisson
Yes, I did just mix English, Spanish and French. And no, I living the “fishy” life, popular opinion to the contrary. Here’s the story. As someone who spends the majority of his time working online, with no oversight, I notice that I tend to drift a lot. I don’t play solitaire, or farm for virtual carrots, but I do wander over to Reddit mo...
8318 sym R (202 sym/1 pcs) 2 img
R: Attack of the hair-trigger bees?
In their book “Complex Adaptive Systems”, authors Miller and Page create a theoretic model for bee attacks, based on the real, flying, honey-making, photogenic stingers. Suppose the hive is threatened by some external creature. Some initial group of guard bees sense the danger and fly off to attack. As they go, they lay down a scent. Other be...
3398 sym R (734 sym/1 pcs) 6 img