[HN Gopher] Finding a random seed that solves a LeetCode problem...
___________________________________________________________________
Finding a random seed that solves a LeetCode problem (2023)
Author : mcyc
Score : 64 points
Date : 2024-07-26 17:31 UTC (5 hours ago)
(HTM) web link (mcognetta.github.io)
(TXT) w3m dump (mcognetta.github.io)
| porphyra wrote:
| Reminds me of this rock paper scissors bot that has a 59% win
| rate against other algorithms:
| https://rpscontest.com/entry/614005
| bwestergard wrote:
| This is extremely funny. I'm assuming they just tried many
| seeds until one worked, to demonstrate the role of chance in
| scoring these programs?
| porphyra wrote:
| Apparently they downloaded a bunch of the best bots at the
| time and tested locally to find a seed that performs the
| best.
| ryan-c wrote:
| If I recall correctly, I downloaded all of them, then
| pruned any that appeared to have non-deterministic
| behaviour (for example, using random), then used the
| offline testing script[0] helpfully provided by the site.
|
| It was the first piece of code I put out that someone
| referred to as "art"[1].
|
| Some others that hit the HN front page over the years:
|
| https://news.ycombinator.com/item?id=10195358
|
| https://news.ycombinator.com/item?id=9516824
|
| https://news.ycombinator.com/item?id=26615938
|
| I also had wrote some code for my former employer
| containing the magic string "haha jit go brrr" that raised
| some eyebrows when someone reverse engineering the code
| noticed it. It was part of a routine to try to coax the JIT
| into optimizing the code soon on low end Android devices
| for performance reasons, but someone who didn't understand
| what the code was doing thought it was part of an
| exploit... :facepalm:
|
| 0. https://rpscontest.com/rpsrunner.py
|
| 1. https://rya.nc/threads/art-and-beauty.html
| its-summertime wrote:
| > I also had wrote some code for my former employer
| containing the magic string "haha jit go brrr"
|
| https://iter.ca/post/reddit-whiteops/
| adastra22 wrote:
| > If I recall correctly, I...
|
| Only on HN does someone asks questions about an obscure
| cool thing and the original author enters the discussion.
| Thanks for the explanation.
| freediver wrote:
| Reminds me of LLMs, where the weights are the 'seed' that solves
| standard benchmark suite.
| mcyc wrote:
| You may enjoy this article: https://arxiv.org/abs/2109.08203
|
| The author treats the seed as a hyperparameter and searches for
| the one that performs best for training a CV model.
| RomanPushkin wrote:
| The same can be applied to a stock market. I am a big fan of
| looking into historical data, and I was using WealthLab for quite
| a while.
|
| One of the funniest things is when you find "strategy" that
| performs best over one year by making from 50 to 100 deals. But
| don't get fooled, it's just a random parameters, and when applied
| to the next year or years, you won't get these results, of
| course.
|
| So you're getting reliable results only when you can reproduce
| your success (no matter what it is) consistently.
| deliveryboyman wrote:
| This does not speak to the randomness of markets. Only the ever
| changing nature of them.
| Xcelerate wrote:
| Haha, this is pretty funny. I immediately thought of Cantor's
| diagonal argument when I saw the question, but it makes me wonder
| -- how long would it have taken me to solve the problem if I
| hadn't previously read about Cantor's argument in the context of
| Turing machines?
|
| Here's a variant: "Given a list of k LeetCode problems sourced
| from a bag of n unique tricks, generate a new LeetCode problem
| that utilizes a trick not found in the bag."
|
| I'm being facetious of course, but actually now I have an idea
| that we could create a bipartite graph mapping tricks to LeetCode
| problems. From there, given a willingness to memorize n tricks,
| we can compute the optimal bag of tricks to commit to memory in
| order to maximize the number of LeetCode problems quickly
| solvable during an interview, weighted by the probability of each
| problem's appearance.
| jrochkind1 wrote:
| Cantor's diagonilization is something I think one would learn
| in most CS curricula, at least I did.
|
| Obviously Cantor was a genius, I would not expect most people,
| including myself, to come up with his argument themselves from
| scratch!
___________________________________________________________________
(page generated 2024-07-26 23:03 UTC)