Two Plus Two Publishing LLC Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > Other Topics > Programming

Notices

Programming Discussions about computer programming

Reply
 
Thread Tools Display Modes
Old 04-25-2011, 11:15 AM   #31
journeyman
 
Join Date: Jun 2009
Posts: 265
Re: Any interest in a Project Euler Group?

Count me in.
Mike B is offline   Reply With Quote
Old 04-25-2011, 11:45 AM   #32
old hand
 
Join Date: Aug 2009
Posts: 1,983
Re: Any interest in a Project Euler Group?

Sounds fun, if I have time I'll participate
Air-Bear is offline   Reply With Quote
Old 04-27-2011, 05:13 PM   #33
adept
 
Join Date: Nov 2005
Location: Colorado
Posts: 844
Re: Any interest in a Project Euler Group?

Quote:
Originally Posted by Zurvan View Post
This is a great idea. I will attempt to participate, although my history with Project Euler is that I just don't have a strong enough background in math to do them well.
I was afraid of that when I started, too. I decided I would try to figure everything out from first principles. It's painful, and there are some stubborn problems I've come to again and again without solving. Others I just skipped entirely since I had no clue how to approach them. But I have learned a lot, and highly recommend project euler for anyone looking to improve. I used Haskell, fwiw, and am level 3 at the moment, although I haven't had much time for this in a great while, alas.

bachfan is offline   Reply With Quote
Old 04-27-2011, 05:20 PM   #34
Carpal \'Tunnel
 
Johnny Douglas's Avatar
 
Join Date: Apr 2008
Location: blog.jcarter.ca
Posts: 7,260
Re: Any interest in a Project Euler Group?

Will try to get a little organizational stuff taken care of later this week.
Johnny Douglas is offline   Reply With Quote
Old 04-27-2011, 09:17 PM   #35
Carpal \'Tunnel
 
jukofyork's Avatar
 
Join Date: Sep 2004
Posts: 10,213
Re: Any interest in a Project Euler Group?

How many can Wolfram Alpha solve? It seems to get confused a lot but it did manage to understand and answer some correctly:

"Find the 10001st prime."

"Calculate the sum of all the primes below two million."

"Find the sum of digits in 100!"


Anybody tried all the problems and seen how many it can solve?

Juk
jukofyork is offline   Reply With Quote
Old 04-28-2011, 09:10 PM   #36
Carpal \'Tunnel
 
gaming_mouse's Avatar
 
Join Date: Oct 2004
Location: taking notes on u (see profile)
Posts: 11,948
Re: Any interest in a Project Euler Group?

Quote:
Originally Posted by bachfan View Post
I was afraid of that when I started, too. I decided I would try to figure everything out from first principles. It's painful, and there are some stubborn problems I've come to again and again without solving. Others I just skipped entirely since I had no clue how to approach them. But I have learned a lot, and highly recommend project euler for anyone looking to improve. I used Haskell, fwiw, and am level 3 at the moment, although I haven't had much time for this in a great while, alas.

bachfan,

very nice. i've got a haskell question for you, since i've just been learning it. i think it's great, but apparently for speed/memory intensive applications it can fall short. this post:

http://stackoverflow.com/questions/3.../377124#377124

was pretty disturbing to me. it seems that if you are doing anything like simulations (eg, counterfactual regret stuff for poker) then haskell could easily perform very poorly. any thoughts on this?
gaming_mouse is offline   Reply With Quote
Old 04-28-2011, 09:17 PM   #37
adept
 
Join Date: Nov 2005
Location: Colorado
Posts: 844
Re: Any interest in a Project Euler Group?

I love Haskell, although I'm far from an expert. I love its compact syntax, functional-to-the-hilt philosophy, and super-strong type system. But I have never coded anything more than small programs in it, so I'm not really qualified to comment on engineering anything serious in Haskell.

I know that there _are_ folks who write hard-core, compute-intensive stuff with Haskell. I have heard that in many cases the performance characteristics of a Haskell program can be counter-intuitive, and sometimes seriously hacking is required to get things to run very fast. Personally, I'm not sure if it would be much worse than any other language in that regard, but I don't really know what I'm talking about.

Cheers,
bachfan

Quote:
Originally Posted by gaming_mouse View Post
bachfan,

very nice. i've got a haskell question for you, since i've just been learning it. i think it's great, but apparently for speed/memory intensive applications it can fall short. this post:

http://stackoverflow.com/questions/3.../377124#377124

was pretty disturbing to me. it seems that if you are doing anything like simulations (eg, counterfactual regret stuff for poker) then haskell could easily perform very poorly. any thoughts on this?
bachfan is offline   Reply With Quote
Old 04-28-2011, 10:50 PM   #38
veteran
 
xplore111's Avatar
 
Join Date: Jan 2010
Location: within the goldilocks zone
Posts: 2,596
Re: Any interest in a Project Euler Group?

Would a knowledge of Calc 2 be sufficient for a decent amount of these? Or are we talking Differential Eq.+?
xplore111 is offline   Reply With Quote
Old 04-28-2011, 10:52 PM   #39
Carpal \'Tunnel
 
Johnny Douglas's Avatar
 
Join Date: Apr 2008
Location: blog.jcarter.ca
Posts: 7,260
Re: Any interest in a Project Euler Group?

Quote:
Originally Posted by xplore111 View Post
Would a knowledge of Calc 2 be sufficient for a decent amount of these? Or are we talking Differential Eq.+?
I think so. I don't see myself being too successful with too many DE programming problems in this endeavour.
Johnny Douglas is offline   Reply With Quote
Old 04-28-2011, 11:26 PM   #40
ɹǝʍoʇpunoɹ
 
RoundTower's Avatar
 
Join Date: Feb 2005
Location: soah made my profile
Posts: 13,926
Re: Any interest in a Project Euler Group?

Quote:
Originally Posted by xplore111 View Post
Would a knowledge of Calc 2 be sufficient for a decent amount of these? Or are we talking Differential Eq.+?
no need for calculus at all imo, it's 90% number theory, more about being very adept at very basic maths.

I think all of the problems could be explained to a bright sixth-grader. Normally there's a simple example given for say N=5 that you can test your programs on, but you have to figure out a fast algorithm to calculate it for N=10000 or something. Of course knowing some advanced maths might help you find a shortcut.

I have 113 solved it looks like, mostly in Common LISP. I have some elegant solutions but like Haskell it isn't really made for the number crunching required in the more advanced problems. Maybe I'll try and overtake bachfan...
RoundTower is offline   Reply With Quote
Old 04-28-2011, 11:36 PM   #41
Carpal \'Tunnel
 
gaming_mouse's Avatar
 
Join Date: Oct 2004
Location: taking notes on u (see profile)
Posts: 11,948
Re: Any interest in a Project Euler Group?

Quote:
Originally Posted by xplore111 View Post
Would a knowledge of Calc 2 be sufficient for a decent amount of these? Or are we talking Differential Eq.+?
the project isn't about advanced math skills, it's about programming skills, so calc2 makes you overqualified....
gaming_mouse is offline   Reply With Quote
Old 04-29-2011, 12:01 AM   #42
veteran
 
xplore111's Avatar
 
Join Date: Jan 2010
Location: within the goldilocks zone
Posts: 2,596
Re: Any interest in a Project Euler Group?

Quote:
Originally Posted by gaming_mouse View Post
the project isn't about advanced math skills, it's about programming skills, so calc2 makes you overqualified....
Oh I see, just curious.

After glancing at Problem 1 is it plainly asking for the summation of all multiples of 3 OR 5? Meaning if I choose my multiple to be 3, n(1)=3, n(2)=6, n(3)=9 etc and you simply test that n(X) is less than < 1000 and then add it to the pooling sum?

and the result is around 650 i think i saw?
xplore111 is offline   Reply With Quote
Old 04-29-2011, 08:03 AM   #43
ɹǝʍoʇpunoɹ
 
RoundTower's Avatar
 
Join Date: Feb 2005
Location: soah made my profile
Posts: 13,926
Re: Any interest in a Project Euler Group?

Quote:
Originally Posted by xplore111 View Post
Oh I see, just curious.

After glancing at Problem 1 is it plainly asking for the summation of all multiples of 3 OR 5? Meaning if I choose my multiple to be 3, n(1)=3, n(2)=6, n(3)=9 etc and you simply test that n(X) is less than < 1000 and then add it to the pooling sum?

and the result is around 650 i think i saw?
the question and example makes it really clear what it's asking for. You don't have a choice.
RoundTower is offline   Reply With Quote
Old 04-29-2011, 01:16 PM   #44
adept
 
Join Date: Nov 2005
Location: Colorado
Posts: 844
Re: Any interest in a Project Euler Group?

Quote:
Originally Posted by bachfan View Post
I used Haskell
Fair disclosure - I used Haskell for 90% of the problems. For those few problems that really cried out for an imperative solution, I used Ruby or C. (It is possible to write in imperative style in Haskell, but what's the point?)

- bachfan
bachfan is offline   Reply With Quote
Old 04-29-2011, 01:55 PM   #45
ɹǝʍoʇpunoɹ
 
RoundTower's Avatar
 
Join Date: Feb 2005
Location: soah made my profile
Posts: 13,926
Re: Any interest in a Project Euler Group?

118 now! did the last few in Python or pen and paper.

Having thought about it, I don't really think the problems are suitable for a "find the code that outputs the answer the fastest" competition. The best solutions don't calculate everything from first principles but use educated guesses/insights. You don't have to go as far as goofy/clown's solutions to get a program that "just happens" to work for the given problem, but isn't very extensible, and it's not really possible to tell the difference between a program that was reverse engineered from knowing the solution and one that uses some clever mathematical insight, because either way the effect is to rule out some portion of the search space.

They are designed for exactly what the site suggests: find a solution using any method in a reasonably short amount of time (milliseconds to a minute).
RoundTower is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 08:43 AM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.
Copyright © 2008-2010, Two Plus Two Interactive