Recent submissions

Comment · 2 years ago
It's great as a learning experience for the author, but it would be a good idea for the author to take a look at a JSON spec and see if the regular expressions used by the lexer support the whole spec and don't accept non-legal JSON. From a cursory glance, it seems like exponents in floating point numbers aren't supported, nor are escaped quotation marks in strings (`\"`). I think it supports string escapes that are valid in go, but not in JSON like `\xab` and 8-hexdigit unicode escapes `\U1234abcd`.
Comment · 4 years ago
Comment · 4 years ago
Comment · 4 years ago
Comment · 4 years ago
The (exact) optimal EV-minimizing strategies (assuming each target word is equally likely) always solve in 5 of fewer guesses in normal mode, and always solve in 6 guesses in hard mode. If you wish to guarantee 5 guesses in hard mode, there's a different (optimal) strategy with slightly higher EV. See: http://sonorouschocolate.com/notes/index.php?title=The_best_...

I don't think a maximum-number-of-guesses optimizer leads to an equilibrium (if you mean Nash equilibrium), assuming you're playing the game where the score of the game for the setter is the number of guesses. In particular, if the solver's strategy is deterministic, the setter will always pick one of the words that needs 5 guesses. There's no reason to think the nash equilibrium can be easily found.

Comment · 6 years ago
If you like programming puzzles, I also recommend trying to write the littlemancomputer programs listed on this blog entry: https://blog.paulhankin.net/littlemancomputer/

They are fun in the same way as TIS-100 is fun, and especially the last couple (generate primes, sort input) are interestingly difficult.

Instructions and description of the machine on wikipedia: https://en.wikipedia.org/wiki/Little_man_computer

Online emulator: https://blog.paulhankin.net/lmc/lmc.html

[note: the blog post contains some minor hints, and solutions in links]

Comment · 6 years ago
https://blog.paulhankin.net

I don't think everyone should read it, because it's quite technical. There's articles on mathematics, game-theory, and computer science.

The highlight (in my opinion) is a series of articles on Fibonacci numbers, with relatively novel content: https://blog.paulhankin.net/fibonacci/, https://blog.paulhankin.net/fibonacci2/, https://blog.paulhankin.net/fibonacci_doubling/

The first two in particular, are quite fun I think, playing with short integer-only computation of the Fibonacci numbers (and also the n-acci numbers).

Comment · 6 years ago
I wrote a solution to this some time back: https://github.com/paulhankin/morse-decoder . It finds the most likely sentence based on n-gram frequencies and a dictionary, and runs a relatively fast dynamic program (it's been a while since I looked at the code, but I think linear if word lengths are bounded). Word list and n-gram frequencies aren't provided in the repo, although they're easy to find online.
Comment · 6 years ago
In particular, E is . and T is -, so you can trivially decode any sequence of dots and dashes to strings containing only E and T.
Comment · 7 years ago
You can do it with just integers (ie: in Z[φ]) by noting that φ^n = φFib(n) + Fib(n-1). Equivalently, compute X^n in Z[X] / (X^2-X-1). I have an article on my blog, but it's unfortunately down right now because of some github issue with changing my account to a free one.
Comment · 8 years ago
Comment · 9 years ago
https://en.wikipedia.org/wiki/Little_man_computer is a simple computer model for education, from the 1960's. I built an emulator for it, which you can find here: http://paulhankin.github.io/lmc/lmc.html

It's not a game, but I found it fun to write simple programs; the machine code is so limited you need to find tricks to do anything non-trivial. For a challenge, try to write 1: a program that multiples two inputs, 2: a sieve of erastothenes, and 3: a program that can sort input.

The spec for the assembler is on the wikipedia page.

Comment · 9 years ago
It would be surprising to me if a completely deterministic strategy wasn't within some very close margin of an optimal strategy. For example, if you think you should raise with JJ 1/3 of the time and call the rest of the time in some spot, then you can raise JcJd and JhJs and call with the other jacks. This can give your opponent slightly more information about your range in some cases (for example, if they hold a J themselves), and of course you can only approximate correct frequencies, but it's highly unlikely (in my opinion at least) that such a deterministic strategy would be terrible.
Comment · 9 years ago
Significance works the other way round than you described it -- if two players were equal in skill, then a winrate of -91mbb/g or larger would happen 5-10% of the time.

I don't know if Doug Polk understands that or not, but I agree with his criticism and I think his analogy with sports reporting is sound. While "statistical tie" is true in a technical sense, it's not usually how matches are reported, and it's somewhat disingenuous and self-serving to use that language. It would be more honest to say that it's very unlikely that bot is better than humans -- given the advantages the bot had (a gruelling 2-week schedule, and pressure on the humans to get through N hands per day) it still lost by a significant margin.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton