Counting Legal Positions in Go

The computation uses dynamic programming to count the number of paths through a graph consisting of 18^2=324 layers with up to 81 billion nodes each. Each node corresponds to a set of partial board (e.g. the top 7 rows plus 6 points on the 8th row) positions that are equivalent in their set of valid completions. Our paper explains the algorithm in detail, and also explains how the resulting exact counts allow derivation of the approximation formula

L(m,n) ~ 0.850639925845714538 * 0.96553505933837387^{m+n} * 2.97573419204335724938^{m*n}

which gives us the approximate number of legal positions on a standard board size

L(19,19) ~ 2.08168199381982*10^170

via Counting Legal Positions in Go.

Thanks to the Chinese Remainder Theorem, the work of computing L(19,19) can be split up into 9 jobs that each compute 64 bits of the 566-bit result. Allowing for some redundancy, we need from 10 to 13 servers, each with at least 8 cores, 512GB RAM, and ample disk space (10-15TB), running for about 5-9 months.

The Face Detection Algorithm Set to Revolutionize Image Search

The great promise of this kind of algorithm is in image search. At the moment, it is straightforward to hunt for images taken at a specific place or at a certain time. But it is hard to find images taken of specific people. This is step in that direction. It is inevitable that this capability will be with us in the not too distant future.

via The Face Detection Algorithm Set to Revolutionize Image Search | MIT Technology Review.

Newest ‘procedural-generation’ Questions

Often synonymous with “random generation”, procedural generation is the usage of calculations and algorithms to create content, rather than referring to preset data. The typical reason is to generate content mid-gameplay, which makes for a more unpredictable and unique experience in multiple playthroughs. Common elements that are subject to procedural generation in games include item attributes, enemy abilities, and level layouts.

Procedural generation specifically refers to the usage of algorithms to generate content, it is not necessary to be random. Pseudo-random generators with fixed seeds can be considered procedural generation despite producing identical results.

via Newest ‘procedural-generation’ Questions – Game Development Stack Exchange.

On MetaFilter Being Penalized By Google

The truth is more likely that it’s less to do with his site and more to do with Google seeing a pattern of what it considers to be unnatural linking by the publishers it is contacting. As Haughey guesses, it’s more likely that MetaFilter is “collateral damage,” with the damage being the annoying link removal requests rather than any real distrust of the site. That’s especially since its ranking drop seems to well predate these requests.

But it is worrisome, especially when Haughey writes about how much care apparently goes into trying to ensure all links are relevant:

via On MetaFilter Being Penalized By Google: An Explainer.

Earn respect. That’s your best defense if things go south with Google. It’s also your best offense for doing well in Google

The Mining Algorithm And CPU Mining – All About Bitcoin Mining: Road To Riches Or Fool’s Gold?

One of the most difficult problems in computer science is reversing a secure hash (finding an input text for a given output, the digital signature). Let me explain this problem in simple terms. Let’s assume the wealthy but terminally ill Alice wrote her will and stored it on her computer. Knowing that a computer can be hacked and the will can be altered, Alice digitally signed her will with the secure hash algorithm SHA-256. She then emailed the digital signature to all her friends, allowing them to check the validity of the document. Bob wants to hack into the computer and change Alice’s will so that he becomes the sole beneficiary, but he faces a problem: he needs to change the will in such a way that the widely distributed SHA-256 signature stays the same. Otherwise, everybody realizes that the will has been forged. This is the computationally difficult problem of reversing or brute-forcing SHA-256, or finding an input that matches a predefined output. Satoshi famously decided that in order to find a new block, people all over the world need to compete in reversing SHA-256, turning block creation into a global lottery.

via The Mining Algorithm And CPU Mining – All About Bitcoin Mining: Road To Riches Or Fool’s Gold?.

Once very popular among Bitcoin miners, but now somewhat dated, the Radeon HD 5830 card boasts 1120 stream processing units. But that doesn’t mean it literally has 1120 separate cores. Rather, the GPU employs 224 SIMD cores, each of which sports five ALUs operating in parallel (VLIW5).

xkcd 1313: Regex Golf

I found that the hover text, “/bu|[rn]t|[coy]e|[mtg]a|j|iso|n[hl]|[ae]d|lev|sh|[lnd]i|[po]o|ls/ matches the last names of elected US presidents but not their opponents.“, contains a confusing contradiction. There are several last names (like “Nixon”) that denote both elected presidents and opponents. So no regular expression could both match and not match “Nixon”. I could only assume that Randall meant for these names to be winners and not losers (and in fact he later confirmed that was the correct interpretation).

So that got me thinking: can I come up with an algorithm to find a short regex that covers the winners and not the losers?

I started by finding a page that lists winners and losers of US presidential elections through 2000. Adding the 2004-2012 results I get:  …

via  xkcd 1313: Regex Golf

Apparently there is a Regex Golf game.

Type a regex in the box. You get ten points per correct match. Hit Enter to go to the next ‘level’.

How Not To Sort By Average Rating

PROBLEM: You are a web programmer. You have users. Your users rate stuff on your site. You want to put the highest-rated stuff at the top and lowest-rated at the bottom. You need some sort of “score” to sort by.

via How Not To Sort By Average Rating.

CORRECT SOLUTION: Score = Lower bound of Wilson score confidence interval for a Bernoulli parameter

Say what: We need to balance the proportion of positive ratings with the uncertainty of a small number of observations. Fortunately, the math for this was worked out in 1927 by Edwin B. Wilson. What we want to ask is: Given the ratings I have, there is a 95% chance that the “real” fraction of positive ratings is at least what? Wilson gives the answer. Considering only positive and negative ratings (i.e. not a 5-star scale), the lower bound on the proportion of positive ratings is given by:

Google wants a patent on splitting the restaurant bill

Google Patent Application, October 2013: “For example, continuing with the example of FIG. 4, assume that Users A-C have drinks at a bar and User B pays a bill of $45 for the drinks. User B adds the payment transaction as an expenditure of the group and allocates $15 of the transaction to User A, $20 to User B, $10 to User C. In this example, the balance module 308 would update the individual balances of Users A-C to indicate that User B now owes $115 to User A ($130-$15) and User C owes $10 to User B ($0+$10).”

via No joke: Google wants a patent on splitting the restaurant bill – GeekWire.

I didn’t think one could patent a mathematical formula.