Reflecting On A Queueing Prism Leads To Unexpected Results

Computers are difficult enough to reason about when there’s just a single thread doing one task. There are dozens of cores in today’s modern processor world, and your program might try to take advantage of using more than just one. Things happening concurrently makes the number of states and interactions explode in to a mess we as humans are likely going to have trouble understanding. So, like [Hillel], you might turn to the computer to try and model those interactions.

The model in question is a task queue. Things are added to the pile, and “workers” grab one from the pile and process it. There are two metrics used to measure the effectiveness of a task queue: throughput and latency. Throughput is the number of things you can do per second (like this maximum throughput 3d printer), while latency is the amount of time it takes to finish one thing. Continue reading “Reflecting On A Queueing Prism Leads To Unexpected Results”

Archimedes Would Have Known Better If He Could Count To A Million

Today is March 14th, or Pi Day because 3.14 is March 14th rendered in month.day date format. A very slightly better way to celebrate the ratio of a circle’s circumference to its diameter is July 22nd, or 22/7 written in day/month order, a fractional approximation of pi that’s been used for thousands of years and is a better fit than 3.14. Celebrating Pi Day on July 22nd also has the advantage of eschewing middle-endian date formatting.

But Pi Day is completely wrong. We should be celebrating Tau Day, to celebrate the ratio of the circumference to the radius instead of the diameter. That’s June 28th, or 6.283185…. Nonetheless, today is Pi Day and in the absence of something truly new and insightful — we’re still waiting for someone to implement a spigot algorithm in 6502 assembly, by the way — this is a fantastic opportunity to discuss something tangentially related to pi, the history of mathematics, and the idea that human knowledge builds upon itself in an immense genealogy stretching back to the beginning of history.

This is our Pi Day article, but instead of complaining about date formats, or Tau, we’re going to do something different. This is how you approximate pi with the Monte Carlo method, and how anyone who can count to a million can get a better approximation of one the fundamental constants of the Universe than Archimedes.

Continue reading “Archimedes Would Have Known Better If He Could Count To A Million”

Statistics And Hacking: An Introduction To Hypothesis Testing

In the early 20th century, Guinness breweries in Dublin had a policy of hiring the best graduates from Oxford and Cambridge to improve their industrial processes. At the time, it was considered a trade secret that they were using statistical methods to improve their process and product.

One problem they were having was that the z-test (a commonly used test at the time) required large sample sizes, and sufficient data was often unavailable. By studying the properties of small sample sizes, William Sealy Gosset developed a statistical test that required fewer samples to produce a reasonable result. As the story goes though, chemists at Guinness were forbidden from publishing their findings.

So he did what many of us would do: realizing the finding was important to disseminate, he adopted a pseudonym (‘Student’) and published it. Even though we now know who developed the test, it’s still called “Student’s t-test” and it remains widely used across scientific disciplines.

It’s a cute little story of math, anonymity, and beer… but what can we do with it? As it turns out, it’s something we could probably all be using more often, given the number of Internet-connected sensors we’ve been playing with. Today our goal is to cover hypothesis testing and the basic z-test, as these are fundamental to understanding how the t-test works. We’ll return to the t-test soon — with real data. Continue reading “Statistics And Hacking: An Introduction To Hypothesis Testing”

Computer Learns From Tic-tac-toe

menace-tic-tac-toe-computer

MENACE, the Matchbox Educable Noughts And Crosses Engine, is a fancy name for a machine that plays Tic-Tac-Toe. The concept is a product of Professor [Donald Mitchie]’s work in the 1960’s and was featured as an example in the “A New THEORY of AWESOMENESS and MIRACLES” talk given at this year’s UK games conference.

[James Bridle] built this fascinating example of how a computational system can learn from its successes and failures. Each box corresponds to one of 304 different board layouts. The operator uses an index sheet to locate the box that corresponds to the current state, shakes the box, then looks to see which bean has randomly fallen into a partition in the box. The color/type of bean corresponds to a space that the machine has “chosen” for that move. If MENACE won the game a bead matching the move that was played would be added to each box used. If MENACE lost, a bead would be removed from each box used. This way the machine cannot make the exact same mistakes twice, and is more likely to repeat successful solutions.

[James] notes that he couldn’t find any evidence of this machine actually being built before. It is possible that this was always a theoretical device but now we’ve seen an actual build. We consider this to be a computer because it is calculating moves based on probability of success but what do you think? If you’re thirsting for more pictures there’s plenty to see in the Flickr set he’s posted.

[via BoingBoing]