2×2 Squares on a Randomly Filled m×n Board

June 28, 2010 at 17:03 (algorithm, java, math.PR)

This post, like the last one, is an offshoot of a thread on Math Help Forum. The situation is: Suppose there is an m×n chess-like board and we wish to fill in all the (1×1) squares according to: all squares are either black or white, and the probability that a square is black is p . What is the probability that a randomly filled board will contain at least one 2×2 black square?

Read the rest of this entry »

Permalink Leave a Comment

Blackjack Basic Strategy – Infinite Deck

May 24, 2010 at 06:24 (algorithm, java, math.PR)

I came across a good programming exercise over on this thread at Math Help Forum (I’m “undefined”), and here are the results. This program reproduces the charts and expected value on this page over at The Wizard of Odds for an infinite deck. I realise the code could be cleaner, but I’m pleased with the performance of the underlying algorithms. On my laptop with modest specs, calculation takes about 20 milliseconds.

Read the rest of this entry »

Permalink Leave a Comment