Friday Random Recipe: Spicy Chicken Lo Mein

Lo Mein is one of the staples of Chinese restaurants in the US. In general, it’s not bad,
but it’s a bit greasy, and a bit bland. This version of it is closer to authentic, and has
a really nice kick.

The heat comes from a sauce called Sambal. Sambal is the vietnamese name, but Chinese make
it too, and call it chili-vinegar sauce. It’s basically a ton of fresh chilis – the variety that
we call Thai bird chilis – pounded in a mortar and pestle until it forms a loose sauce, roughly the consistency of a thin ketchup.

You really need to go to a Chinese grocery for the noodles. The chinese egg noodles have a different consistency and flavor than any Italian pasta. To prepare them, you get some water boiling, toss the
noodles in for just one or two minutes, and then take them out and rinse with cold water to cool them, and toss them with just enough oil to stop them from sticking together.

Continue reading

Counted Petri Nets, and Useless Protocol Specification Tools

There’s one variant of Petri nets, called counted Petri nets, which I’m fond of for personal reasons. As Petri net variants go, it’s a sort of sloppy but simple one, but as I said, I’m fond of it.

As a warning, there’s a bit of a diatribe beneath the fold, as I explain why I know about this obscure, strange Petri net variant.

Continue reading

The Excel 65,535=100,000 Bug

I’ve been getting a lot of requests from people to talk about the recent Excel bug. For those of
you who haven’t heard about this, in Excel 2007, floating point calculations that should result in
a number very, very close to either 65,535 or 65,536 are displaying their result as 100,000.
It’s only in the display though – the underlying number is actually represented correctly, so if you subtract 2 from 65,536, you’ll get the correct answer of 65,534 – not 99,998.

I can’t give you the specifics – because without seeing the Excel code, I can’t tell exactly what they got wrong. But I’ve got some pretty good suspicions, so I’ll do my best to explain the background that leads to the problem, and what I think is probably going on. (Another excellent explanation if this
is in the Wolfram blog post that I mentioned in my fast arithmetic fractals post this weekend.)

Continue reading

Modeling Concurrency with Graphs: Petri Nets

Among many of the fascinating things that we computer scientists do with graphs
is use them as a visual representation of computing devices. There are many subtle problems that can come up in all sorts of contexts where being able to see what’s going on can make a huge difference. Graphs are, generally, the preferred metaphor for most computing tasks. For example, think of finite state machines, flowcharts, UML diagrams, etc.

One of the most interesting cases of this for one of the biggest programming problems today is visual representations of concurrency. Concurrent program is incredibly hard, and making a concurrency regime correct is a serious challenge – communicating that regime and its properties to another developer is even harder.

Which brings us to todays topic, Petri nets. Actually, I’m probably going to spend a couple of days writing about Petri nets, because they’re fun, and there are a lot of interesting variations. The use of Petri nets really isn’t just an academic exercise – they are seriously used by people in a lot of real, significant fields – for one example, they’re very commonly used to specify behaviors of network communication protocols.

Continue reading

Fast Arithmetic and Fractals

As pointed out by a commenter, there are some really surprising places where fractal patterns can
appear. For example, there was a recent post on the Wolfram mathematica blog by the engineer who writes
the unlimited precision integer arithmetic code.

Continue reading

Friday Random Recipe: Chicken Paprikash

The year before our first kid was born, my wife and I went on vacation in Budapest. It was a beautiful city, and the food was wonderful – I particularly loved the chicken paprikash that they seemed to server everywhere. When I got home, I started looking for recipes to reproduce it. This is the closest I’ve been able to come.

The most important thing for this recipe is the paprika. Get good hungarian paprika. American paprika is pretty much just powdered red food coloring. Hungarian paprika is a richly flavorful spice which is the heart of this dish.

Continue reading

Fugues: from the Ridiculous to the Sublime

Via YouTube, I came across this little gem. Who would have thought that you could create a beautiful fugue from a Britney Spears song?

Fugues are one of my favorite musical forms. There’s something magical (and something mathematical) about the way it sounds when a theme counterpoints itself. Anyway – here it is, the Danny Pi video “How to Write a Fugue”, featuring the “Oops, I did it again fugue”, from a theme by Britney Spears.

Now that you’ve heard the “Oops I did it again” fugue, here’s a better example of the form, by the great master himself, Johann Sebastian Bach. A little slice of musical perfection to brighten your day. The video is a bit heavy on clever tricks (it’s the “Wedge Fugue”, so naturally, they use a bunch of wedge effects), but the music is stunning.

Granville Sewell: Genius or Liar?

As of 2/24/2008, Sewell has just responded to this, pretending that he just noticed it. To make discussions easier to follow, I have responded with a new post here, and I would appreciate it if comments could be posted there, to keep it all in one place.

My SciBling Mark Hofnagle over at the Denialist blog wanted me to take a look at the pseudo-mathematical ramblings of Granville Sewell. It actually connects with some of the comments in the thread about the paper by Dembski and Marks – Sewell uses part of the article to make the same kind of quantum nonsense claims that showed up here.

Sewell claims to have written a simulator which simulates the Universe, and is complaining that his supposed simulation didn’t produce things like computers or aircraft carriers. I say claims because I’m pretty convinced that he did no such thing. Actually programming a simulator like the simplest of the several he claims to have done, which produces the results that he claims it produced, would be an absolutely astonishing feat of programming, involving a quantity of data that’s more on the scale of Google than on the scale of Granville Sewell’s laptop.

Continue reading

Fractal Applications: Logistical Maps and Chaos

In the course of the series of posts I’ve been writing on fractals, several people have either emailed or commented, saying something along the lines of “Yeah, that fractal stuff is cool – but what is it good for? Does it do anything other than make pretty pictures?”

That’s a very good question. So today, I’m going to show you an example of a real fractal that
has meaningful applications as a model of real phenomena. It’s called the logistic map.

Continue reading

Critical Paths, Scheduling, and PERT

Yet another example of how graphs can be used as models to solve real problems comes from the world of project management. I tend to cringe at anything that involves management; as a former IBMer, I’ve dealt with my share of paper-pushing pinheaded project managers. But used well, this demonstrates using graphs as a model for a valuable planning tool, and a really good example of how to apply math to real-world problems.

Project managers often define something called PERT charts for planning and scheduling a project and its milestones. A PERT chart is nothing but a labeled, directed graph. I’m going to talk about the simplest form of PERT, which considers only time, but not resources. More advanced versions of PERT exist that also include things like required resources, equipment, etc.

Continue reading