Live data from Hacker News

Solving Wordle in 3.64 guesses on average, 99.4% of the time

lockwood.dev

121–130 of 181 posts

Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time

#121
post #80
post #74

Earlier quoted context omitted.

This is great. But it seems to fail with words containing repeat letters, for example, with my word as BOOKS, not on hard mode: SOARE JUMBY BOOST (at this point, it claimed to have won!)

books isn't a valid solution. it's on the guesslist but not the wordlist.

I used the combined solution and valid word list when I was playing around with a program to find good starting words. Feels too much like cheating otherwise.

Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time

#122
post #38

>so far what was taking 1GB of RAM in Python is taking, literally 1MB in Rust Is anybody hiring people to fix situations like this at work? i.e. this script that was written in a hurry needs to be revised to be 10^3 times more efficient, in space or time.

As a data engineer, I sometimes run into problems like this, but I generally find that 99.9% of them can be solved "well enough" in python, or in a database. Moving code from Python to Rust or similar has been required only a handful of times. This specific task, the next program I'm working on, seems to be a very "algo" based, comp sci type problem. I think most companies want to say that they have these kind of pro…

>I generally find that 99.9% of them can be solved "well enough" in python

Sorry, I didn't mean "by translating to a lower level language".

In fact, I especially meant by fixing the script in the existing language.

Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time

#123
post #38

>so far what was taking 1GB of RAM in Python is taking, literally 1MB in Rust Is anybody hiring people to fix situations like this at work? i.e. this script that was written in a hurry needs to be revised to be 10^3 times more efficient, in space or time.

I did this at an internship of mine. You aren't really going to be hired for "please fix our script's performance", but you might end up finding a place where you have the opportunity to do this kind of thing.

>You aren't really going to be hired for "please fix our script's performance"

Not for one script - but imagine everything like that is funneled to a group that supports operations. Such exists, as a matter of fact, question I have is how to find another one.

Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time

#124
post #86

Earlier quoted context omitted.

IMO, never losing the game is the bare minimum for any reasonable cost function: never take > 6 guesses. Beyond that, you can have different optimization functions based on whether you're trying to minimize the worst-case depth of the decision tree (number of guesses) for each position, or the average depth, or some other reasonable function of the distribution over number of guesses. Although you could have arbitrar…

> IMO, never losing the game is the bare minimum for any reasonable cost function: never take > 6 guesses. I wouldn’t think so. If I get 99.9% of rounds correct with 3 guesses (and fail to find a solution to 0.1% of the rounds), and you get 100% of rounds with 6 guesses, I’d say I’ve soundly defeated you 99.9% of the time.

Right, that point of view makes sense if you imagine two players separately playing Wordle and comparing their results, and indeed that's what the OP may have been thinking. But as far as I know, Wordle is primarily a game for one player to play against the computer, where eventually getting to the word (or not) is the most prominent outcome (the only notion of "win" or "defeat" in the game itself), and solving it in fewer guesses is just a bonus. But sure, if you don't care about occasionally losing, you can just set an appropriate weight for w7 within the same family of cost functions.

Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time

#125
post #90

https://github.com/JuanPotato/Wordle-Solver I made a similar solver, it solves all the words in 3.65 average moves. Could probably be better. The github explains how it works.

Neat! I came up with a similar statistic (3.65 average moves, hard mode, no failures) using a very simple heuristic. 1) pick a first guess, and partition the remaining words by the hints that they give 2) given any part of a partition, pick a word that minimizes the maximum-size part of the resulting sub-partition 3) repeat (2) until words are solved. I brute-forced the first guess (that is, generated a tree rooted a…

Yeah I'm on easy mode. With hard mode on I had some failures with words that only differ by 1 letter. I was happy with the result though and didn't care to try and optimize the hardmode.

I think your heuristic is pretty similar to mine, just accomplished in a different way.

Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time

#126

Earlier quoted context omitted.

As a data engineer, I sometimes run into problems like this, but I generally find that 99.9% of them can be solved "well enough" in python, or in a database. Moving code from Python to Rust or similar has been required only a handful of times. This specific task, the next program I'm working on, seems to be a very "algo" based, comp sci type problem. I think most companies want to say that they have these kind of pro…

A company I know hired a computer science PhD after putting them through the full programmer interview, including whiteboarding algos, etc. Literally the hardest crap that anyone working there could think up, and then hired the programmer who got the best score on the test, and the process took multiple months to find this magic individual who could score high enough to satisfy everyone. Once hired (at a fantastic sa…

I have trouble believing that story. An adult, who is also a super genius just says "I was given..." and quits? That's so passive! You have one CD drive and assume that's it, nothing can be done, that's all the resources in the whole company? Don't talk to anyone?

Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time

#127

Earlier quoted context omitted.

It's not copying the URL to my clipboard, would it be possible to expose the url as text so manual copying can be done?

My partner noticed this too, but after a couple of tries the same button will work again. Really hard to debug unfortunately. It usually worked after a couple of tries. I just pushed a fix that greys out the link if there's no URL, hopefully that helps?

Doesn't work for me either, after many clicks.

macOS 11.6, Chrome 96.0.4664.55.

Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time

#128
post #31

Earlier quoted context omitted.

As a point of curiosity, what do you mean by optimal? To me, I can see at least two (potentially different) cost functions that a Wordle strategy can aim to minimise. Firstly, you can try to minimise the expected number of guesses, and secondly you can try to minimise the expected number of guesses conditional on never losing the game. In principle you could optimise for the first but not the second by allowing a sma…

Funnily enough, I think neither of those notions are the correct thing to optimize. For me, you want to minimize the maximum number of guesses. This leads to an equilibrium. Otherwise, your opponent can just abuse your strategy.

What do you mean by opponent?

The entity choosing the word in a game like Wordle or Hang Man is more like the dungeon master in a game of D&D than an opponent in the traditional sense? They are there to help you have fun.

Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time

#129

Earlier quoted context omitted.

This program actually inadvertently created a quite philosophical discussion amongst my friends! Some of them contended that writing a program to solve wordle sucked the joy out of the process of solving it, even if I solved the puzzle myself, first.

Yes it's interesting, precisely because it's intuitively "solvable" by machines. There's joy in solving by hand, and joy in creating a solver, but probably no joy in running your solver every day and sharing with your friends. Because every decision is some maximum-likelihood estimate, there's no tension or drama in the sequence of guesses. In fact, simply the act of creating an infallible solver (100% likelihood of…

You might find some enjoyment in writing solvers that compete with your friends' solvers?

You could either compete on number of guesses. Or you could fix the hardware (eg a Famicom), and compete on runtime?

Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time

#130
post #122

Earlier quoted context omitted.

As a data engineer, I sometimes run into problems like this, but I generally find that 99.9% of them can be solved "well enough" in python, or in a database. Moving code from Python to Rust or similar has been required only a handful of times. This specific task, the next program I'm working on, seems to be a very "algo" based, comp sci type problem. I think most companies want to say that they have these kind of pro…

>I generally find that 99.9% of them can be solved "well enough" in python Sorry, I didn't mean "by translating to a lower level language". In fact, I especially meant by fixing the script in the existing language.

Oh yeah, I do that all the time - sometimes the volume of data gets higher and there are bottlenecks and such, you know? Much refactoring to be done.
Post reply on HN