HNHacker News
TopNewBestAskShowJobs

chriskw

292 karma · joined February 3, 2023

I'm just a guy

Website: https://chriskw.xyz/

Email: <website.xyz>@gmail.com

submissionscomments
chriskw··on Experiments with Plotter Art
In my experience plotter art is a fantastic creative outlet for programmers/people with math backgrounds, especially if your day job doesn't produce anything physical in the real world. Shameless self-plug but I recently animated some old plotter pieces which was surprisingly easy since most of my plots were just piles of math that could be parameterized over time without too much hassle: https://chriskw.xyz/art/

Also big shout out to Michael Fogleman who's pieces inspired me to impulse buy an Axidraw at the beginning of quarantine: https://www.michaelfogleman.com/plotter/

chriskw··on Correlated randomness in Slay the Spire 2
Breaking old seeds is probably not too big a deal since the game is currently in early access, and the biweekly patches mean that seeds are already pretty inconsistent. For example, adding new cards/relics/combats to the pool throws off the generation for all cards/relics/combats anyway
chriskw··on Correlated randomness in Slay the Spire 2
Random thing I ran into while trying to seed search for a challenge run, but since the seed is passed through a 32-bit hash function it means there's effectively only 4 billion seeds (as opposed to the first game, which had 64 bit seeds). This is great if you wanna do something like prove/disprove whether there are unwinnable seeds since its trivial to brute force all of them, but it does mean the potential for fun "high roll" seeded runs is much lower, which is a shame since the new game has so much more variance than the original.

This was the challenge run I ended up with (Ascension 10 win without taking any cards) https://youtu.be/PbP284CZrZ4?is=iL1E7gIzj_kgx0MS

chriskw··on I Spent Three Nights Solving Listen Labs Berghain Challenge (and Got #16)
The trick for Scenarios 2 and 3 is that most of the constraints don't end up being bottlenecks. For example in Scenario 2, well-connected pretty much always gets satisfied while doing the other constraints, so the DP table only needs 4 dimensions (space, Berlin local, techno lover, creative).

My other trick was to only build the full DP table for the latter half of the game (i.e. when all the constraints are at least 50% satisfied) which across 4 dimensions reduces the size by a factor of 16. For the beginning half of the game I combined Berlin and techno into a single parameter, which technically isn't perfect but doesn’t matter too much in the early game. I wrote up my approach here if you want more details: https://chriskw.xyz/2025/09/16/Berghain/

Re: optimizing for best case vs expected case, I thought about that but in simulations my strategy mostly performed the same as a "perfect knowledge" strategy where you could see all of the people in line ahead of time and retroactively accept people. When it under performed it was usually because some miraculous string of people showed up near the end, but betting on that happening seemed like it would do more harm than good, i.e. it would throw away more best case scenarios than it would salvage.

chriskw··on I Spent Three Nights Solving Listen Labs Berghain Challenge (and Got #16)
The tricky thing is the code for making decisions runs locally on the contestants machine, so the first time they submit they can record the sequence locally and compute the best set of actions for the next time they submit. Even if the sequence is somehow tied to a user's account so they can't resubmit against the same sequence, they could do the same thing with an alt account and feed the sequence to a main account.

Sites like Kaggle usually get around this problem by running contestant code in a containerized environment server side, but even then you can get clever with tricks to leak info.

chriskw··on I Spent Three Nights Solving Listen Labs Berghain Challenge (and Got #16)
Nice to see another participant's thinking process for the puzzles! I ended up getting 5th place using dynamic programming for all of the scenarios, but I'm under the impression that almost everybody in the top 20 had almost equally good strategies and most of the variance in scores was due to luck with the sequence of people they got.

A quick sanity check is in Scenario 2, you needed 300 creative people each with a ~6.2% chance of showing up. The odds of getting a sequence of people where that's even possible for the first place score (2906 rejections + 1000 accepts = 3906 total people) is on the order of 1 in 10000, and that's without even factoring in the other constraints.

chriskw··on Playing every game of Wordle simultaneously
You can check the diff on the file wordlist_hidden here: https://github.com/alex1770/wordle/commit/85c4a7e6
chriskw··on Playing every game of Wordle simultaneously
I could see it being handy to estimate probability where each word is to better inform each guess. The tricky thing is I'm not sure if each run of wave function collapse (with randomness injected) would be an accurate sampling method for the real distribution of possible permutations. While doing this writeup I tried to find ways to analyze permutations with restriction, but it turns out most general methods are pretty intractable: https://en.wikipedia.org/wiki/Permanent_(mathematics)#Enumer...
chriskw··on Playing every game of Wordle simultaneously
Good catch! I didn't know about this, I'll update the footnote. Anecdotally everyone I know was very surprised by KEFIR the other day.
chriskw··on Sixteen bottles of wine riddle
Yeah, I really like the sorting formulation! I didn't notice until after I'd written out the intended solution, but it's basically radix sort going from most significant to least significant bit.
chriskw··on Sixteen bottles of wine riddle
Before publishing I found this while trying to see if there was a already a riddle like it out there (closest I could find was the 1000 barrels of wine riddle mentioned at the beginning): https://puzzles.nigelcoldwell.co.uk/

You can also think of this riddle as a very symmetric version of Wordle, where instead of trying to solve for a permutation of letters you're solving for a permutation of years.

chriskw··on Sixteen bottles of wine riddle
I originally set it up like that, but felt having to explain that you need to subtract 2000 before doing the binary conversion was unnecessary and kind of distracting
chriskw··on That fractal that's been up on my wall for years
Good catch, corrected the formula!
chriskw··on That fractal that's been up on my wall for years
That's really cool! I tried to get something to work last week on pen and paper but couldn't get anything to stick. Is there a strategy you used or did you just go by feel?

Edit: just noticed how you encoded a flip (AB <--> CD) between iterations like how the matrix flips the orientation of space. Super neat!

chriskw··on That fractal that's been up on my wall for years
Yeah, it's in the last image and in the thumbnail at very top (which I realize now is really hard to spot on mobile), intentionally not in the spotlight to leave space for the twist at the end.

https://chriskw.xyz/images/fractal/thumbnail.jpg

I think it would work perfectly as a mosaic eventually, but for the time being I'm perfectly content with the "rustic" 8x11 graph paper sized one taped to the wall. Currently planning to put up a slice of the orthotopeflower as a companion piece once I find matches for the colored pencils I used back then.

chriskw··on That fractal that's been up on my wall for years
I'm by no means a parenting expert, but my answer would be anything related to something they feel passion or wonder for in the moment. I snuck in a paragraph near the end about burnout. At the root of the problem for me was that I lost the feeling of fascination and curiosity I had for math and programming, and doing this write-up helped me tap into that feeling of childlike wonder that used to come easily.
chriskw··on That fractal that's been up on my wall for years
Thanks Cliff, it means a ton coming from you! The videos from you and all the other folks on Numberphile always inspired me to see the beauty in math growing up :)
chriskw··on That fractal that's been up on my wall for years
The post presents it a bit out of order, but it was mostly from realizing at some point that the way the fractal grows by a factor of 5, base 5 number systems, and the "spiral" mentioned in the post can all fit together. I also thought a lot about how to programmatically draw the fractal and a natural way would be to start from the middle and zoom out.

There's an apocryphal story about Richard Feynman about how he used to keep a dozen or so random problems in the back of his mind and made a little bit of progress on them every time he saw a connection, until finally he'd solve one and everyone would think he magically figured it out instantly. This was a bit similar except I'm not nearly at that level and I've only been able to do that for one problem instead of a dozen.

chriskw··on The SHA256 for this sentence begins with: one, eight, two, a, seven, c and nine.
I did something similar once (with a bit of a twist) for my bio when I was a TA in college:

"Hi! I’m a senior studying CS. My hobbies include making semantic paradoxes and my bio includes eight a’s, seventeen e’s, fourteen i’s, eight o’s, six u’s, and one wrong number"

chriskw··on Adding C-style for loops to Python (2022)
I did something similar to option 3 to make the builtin numeric types "callable", since the dunder __call__ methods can't be overwritten for builtins. For example, in regular arithmetic notation, something like 6(7+8) could be read as 6*(7+8), but trying to do this in Python gives you `SyntaxWarning: 'int' object is not callable;`, since you're essentially trying to do a function call on the literal 6. The workaround was to use a custom codec to wrap all integer literals to give them the expected call behavior.

Repo if anyone is interested: https://github.com/ckw017/blursed

This was inspired by a way less silly usecase, future f-strings, which added f-string support to older versions of Python in a similar way using codecs: https://github.com/asottile-archive/future-fstrings