News for hackers. Stuff that matters.
Re:Finding a random seed that solves a LeetCode problem (2023) by Xcelerate on Friday July 26, 2024 @03:56PM (#41081723)
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.

Re:Finding a random seed that solves a LeetCode problem (2023) by jrochkind1 on Friday July 26, 2024 @06:47PM (#41083011)
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!

Re:Finding a random seed that solves a LeetCode problem (2023) by nitwit005 on Friday July 26, 2024 @07:29PM (#41083239)
I learned about that proof from a YouTube math video, rather than my Computer Science degree or minor in Mathematics.

People expect genius in interviews all the time. They just don't realize that's what they're doing. They think what they're asking about is an obvious concept, forgetting that (insert renowned genius here) came up with the idea.

Re:Finding a random seed that solves a LeetCode problem (2023) by YZF on Friday July 26, 2024 @09:18PM (#41083803)
I'd have thought group theory would be a required math course. This would also come up in Comp.Sci. complexity contexts and even in Calculus or mathematical logic contexts (I'm sure in many others I'm missing). Way back when this was a required first year course in the Comp.Sci./Math program I took.
Re:Finding a random seed that solves a LeetCode problem (2023) by nitwit005 on Saturday July 27, 2024 @04:46AM (#41085285)
I suspect you are forgetting the possibility they just didn't cover that particular proof.
Re:Finding a random seed that solves a LeetCode problem (2023) by jrochkind1 on Saturday July 27, 2024 @09:05AM (#41086327)
I also would have thought that it would be covered in a CS curriculum, as I said. it'snot just some random proof, but an important foundational one. (I don't think I "forgot a possibilty", I just thought it usually would).

You are saying you took classes that covered logic, number theory, group theory, algorithmic complexity, discrete math, and calculus, and you are certain none of them covered this? Too bad, that is unfortunate! I'm glad you found it on your own! it's really neat!

Re:Finding a random seed that solves a LeetCode problem (2023) by YZF on Saturday July 27, 2024 @07:18PM (#41090060)
Yeah. It's pretty foundational. e.g. https://en.wikipedia.org/wiki/Aleph_number I guess it's possible to teach it without going through the proof.
Re:Finding a random seed that solves a LeetCode problem (2023) by gopher_space on Saturday July 27, 2024 @04:05AM (#41085149)
How many times have you been asked to rediscover the Fibonacci sequence and then make it useful to some stupid business?
Re:Finding a random seed that solves a LeetCode problem (2023) by eru on Friday July 26, 2024 @10:23PM (#41084045)
Yes. Cantors diagonalisation wasn't just a neat proof for an interesting theorem, but it made Cantor one of the few people to invent an entirely new class of proof technique. I'd give it a similar status to techniques like 'indirect proof' and 'induction'.
Re:Finding a random seed that solves a LeetCode problem (2023) by fragmede on Saturday July 27, 2024 @12:46AM (#41084511)
Hilariously, you can plug that into ChatGPT and get a (new?) leetcode problem out.

https://chatgpt.com/share/baf1c785-11dc-46d1-aed7-860cbc741f...

Re:Finding a random seed that solves a LeetCode problem (2023) by zzigge on Saturday July 27, 2024 @10:53AM (#41086979)
That seems almost like the way people curate their Magic the Gathering decks.