The “guess what number I’m thinking of” problem

This post is, to some extent, a follow-up to my post on the two envelopes problem. As before, you're the subject of an experiment. Your adversaries, who I'll call "Team E", present you with two envelopes, each containing a slip of paper with a different number written on it. The numbers could be any (Real) … Continue reading The “guess what number I’m thinking of” problem

ARC/PAK’s “Distilled” compression scheme

PAK is an old file compression and archiving program for DOS, developed by NoGate Consulting. (Search the web for "pak251.exe".) It has a number of features, which include some extensions to ARC format. One such ARC extension is compression method #11, named "Distilled". It was introduced in PAK v2.0, released in July 1989. Unlike my … Continue reading ARC/PAK’s “Distilled” compression scheme

Win32 I/O character encoding supplement 2 – setlocale enhancement

This is part of a series of post on using Unicode in Windows command-line applications. Here's the first post. Sometime in 2018, some functions in the Windows 10 C runtime system, and related development SDKs, were enhanced to support UTF-8. This feature is enabled by calling the setlocale function. For reference, Microsoft's current documentation of … Continue reading Win32 I/O character encoding supplement 2 – setlocale enhancement

Making an uncompressed JPEG 2000 file

Challenge: Construct a JPEG 2000 image file that isn't compressed. Also, try to do it without spending any money. Overview The flagship feature of the JPEG 2000 suite of graphics formats is the wavelet-based "JPEG 2000 codestream" compression format. This challenge is not to figure out how to make a degenerate form of that format … Continue reading Making an uncompressed JPEG 2000 file

Yes, pi is wrong. Sorry about that.

Which is the more fundamental constant: π or 2π? As pi day approaches, I think it's important for everyone to state their thoughts on this contentious matter. Here are the main options: π is more fundamental. (the establishment position)2π is more fundamental. (the progressive position)They're about equally fundamental. (the "both sides" position)Any rational multiple of … Continue reading Yes, pi is wrong. Sorry about that.

Encoding Huffman codebooks

This post will assume you have a basic knowledge of the data compression technique known as Huffman coding. Though maybe, since I'm only concerned about decompression, I should call it something like "bit-oriented prefix codes". Huffman coding is really just one of the algorithms that can produce such a code, but it's the term everybody … Continue reading Encoding Huffman codebooks