Live data from Hacker News

Project Euler

projecteuler.net

81–90 of 142 posts

Re: Project Euler

#81
post #75

Earlier quoted context omitted.

This is one of my favourite problems, I still remember that it has a very real edge case even though I solved it more than 10 years ago. Thank you for the problem!

Can you reuse a plate with 500?

The wording seems to strongly imply no; you need two separate plates with 500 on them.

Re: Project Euler

#82

this is how you end up getting into APL/array langs for sure.

Second this ... have been writing some solutions in Kap, an APL like variant. It's stunning to see 20+ idiomatic solutions in one screen as many problems can be solved in a compact manner. The elegance really reminds one of why we fell in love with Programming in the first place

Re: Project Euler

#84

I love running euler problems when trying to learn the basics of a new programming language. I have a small collection of programs in like 10 different languages that I keep around as a reference for things because I always try to use language-specific features to solve the problems, and then I reference them as examples.

Wow. You reminded me of a computer engineering class years ago where we wrote assemblers and emulators for a simple architecture. I tested mine by writing a solution for one of the first Project Euler questions!

I still have my Oberon-2 compiler from my compilers class and a handful of Euler questions I used to test it.

Re: Project Euler

#86
post #57

I wrote Problem 371, https://projecteuler.net/problem=371 , as a high school student in 2012! I'm so happy to have spent twenty years of my life learning math and solving problems on Project Euler and elsewhere.

That sounds like a combinatorial problem...alphabets from AAA to ZZZ, numbers from 000 to 999.

That means one of the total sum of possible car plates is 26^3.

Since we want to find pairs (x, y) that x + y = 1000. That means the total sum would also add up sum([1 for x in range(1000) for y in range(1000) if x + y == 1000])/2 since there is a symmetry.

But wait, find the expected number of plates he needs to see for a win. So maybe we need to borrow something from statistics (Possion/chi-squared distribution) or queueing theory...?

Edit: ah I saw the solution, it is a Markov chain.

Re: Project Euler

#87
post #57

I wrote Problem 371, https://projecteuler.net/problem=371 , as a high school student in 2012! I'm so happy to have spent twenty years of my life learning math and solving problems on Project Euler and elsewhere.

That sounds like a combinatorial problem...alphabets from AAA to ZZZ, numbers from 000 to 999. That means one of the total sum of possible car plates is 26^3. Since we want to find pairs (x, y) that x + y = 1000. That means the total sum would also add up sum([1 for x in range(1000) for y in range(1000) if x + y == 1000])/2 since there is a symmetry. But wait, find the expected number of plates he needs to see for a…

[deleted]

Re: Project Euler

#89
Project Euler was what I used to get comfortable with my two main languages -- first python and then rust.

I loved to solve it and then look through all the different solutions and find pretty ideas and idioms.

Re: Project Euler

#90
post #75
post #57

I wrote Problem 371, https://projecteuler.net/problem=371 , as a high school student in 2012! I'm so happy to have spent twenty years of my life learning math and solving problems on Project Euler and elsewhere.

This is one of my favourite problems, I still remember that it has a very real edge case even though I solved it more than 10 years ago. Thank you for the problem!

I'm guessing if you only calculate based on the digits, the probability is going to be slightly different than the real one, because you only have a finite number of plates you can choose from.
Post reply on HN