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 06-08-2011, 11:14 AM   #106
adept
 
Join Date: Nov 2005
Location: Colorado
Posts: 844
Re: Any interest in a Project Euler Group?

Hope you all are having fun with this. Don't be afraid to skip around - some of the later problems are way, way harder than others.

- bachfan

I had the most fun/satisfaction solving this one:

http://projecteuler.net/index.php?se...roblems&id=215
bachfan is offline   Reply With Quote
Old 06-08-2011, 12:16 PM   #107
veteran
 
MrWooster's Avatar
 
Join Date: Mar 2007
Location: Shoving AK
Posts: 2,839
Re: Any interest in a Project Euler Group?

Think its going to be a long time before I get that far.
MrWooster is offline   Reply With Quote
Old 06-08-2011, 06:22 PM   #108
ɹǝʍ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 bachfan View Post
Hope you all are having fun with this. Don't be afraid to skip around - some of the later problems are way, way harder than others.

- bachfan

I had the most fun/satisfaction solving this one:

http://projecteuler.net/index.php?se...roblems&id=215
There's quite a few "doable" ones along these lines if you're interested, for some reason the dynamic programming ones seem to be aimed a little easier than the average problem. Or maybe I just see how to do them more easily.

If you read the solutions in the forum some people come up with amazingly short and/or fast solutions to even the hardest questions. I was proud of finding a neat solution to this one until I saw the forums and some people posting one-liners that run in 10ms!

I have 132 at the moment, I think I can probably solve another 20-30 and get to the next level on the site before I need to get better at maths or programming or both.

RoundTower is offline   Reply With Quote
Old 06-13-2011, 01:27 AM   #109
old hand
 
sorrow's Avatar
 
Join Date: Apr 2008
Location: Perth, Western Australia
Posts: 1,500
Re: Any interest in a Project Euler Group?

I just solved problem 34 (http://projecteuler.net/index.php?se...problems&id=34 ) but i'm a bit stumped on how to find a reasonable upper bound on the calculations, and the first couple of pages of comments didn't seem to list a good upper limit either.

Any ideas?
sorrow is offline   Reply With Quote
Old 06-13-2011, 02:30 AM   #110
Carpal \'Tunnel
 
gaming_mouse's Avatar
 
Join Date: Oct 2004
Location: taking notes on u (see profile)
Posts: 11,947
Re: Any interest in a Project Euler Group?

Quote:
Originally Posted by sorrow View Post
I just solved problem 34 (http://projecteuler.net/index.php?se...problems&id=34 ) but i'm a bit stumped on how to find a reasonable upper bound on the calculations, and the first couple of pages of comments didn't seem to list a good upper limit either.

Any ideas?
well eg,
8 * (9 !) = 2 903 040

yet any 8 digit number must be at least 10m. so you know at the very least you only have to test 7 digit numbers. you can do better than that i'm sure but it's simple.
gaming_mouse is offline   Reply With Quote
Old 06-13-2011, 08:01 PM   #111
Carpal \'Tunnel
 
jukofyork's Avatar
 
Join Date: Sep 2004
Posts: 10,213
Re: Any interest in a Project Euler Group?

You can build on the above and reduce the upper bound further:

7*9! = 2,540,160

which means the first digit cannot be higher than 2.

and all solutions where the first digit is 2 are invalid:

2! + 6*9! < 2,999,999

2! + 5*9! + 8! < 2,000,000

Therefore you can reduce the upper bound now to 1,999,999, as:

1! + 6*9! = 2,177,281 (which is >= 1,999,999)

Juk
jukofyork is offline   Reply With Quote
Old 06-14-2011, 01:18 PM   #112
veteran
 
Join Date: Oct 2002
Location: I hate not playing
Posts: 3,070
Re: Any interest in a Project Euler Group?

Is this still a "live" effort. I'd be willing to jump in
jon_1van is offline   Reply With Quote
Old 06-14-2011, 03:37 PM   #113
Carpal \'Tunnel
 
gaming_mouse's Avatar
 
Join Date: Oct 2004
Location: taking notes on u (see profile)
Posts: 11,947
Re: Any interest in a Project Euler Group?

Quote:
Originally Posted by RoundTower View Post
There's quite a few "doable" ones along these lines if you're interested, for some reason the dynamic programming ones seem to be aimed a little easier than the average problem. Or maybe I just see how to do them more easily.

If you read the solutions in the forum some people come up with amazingly short and/or fast solutions to even the hardest questions. I was proud of finding a neat solution to this one until I saw the forums and some people posting one-liners that run in 10ms!

I have 132 at the moment, I think I can probably solve another 20-30 and get to the next level on the site before I need to get better at maths or programming or both.

what do u mean by "dyanamic programming" ones?
gaming_mouse is offline   Reply With Quote
Old 06-14-2011, 05:17 PM   #114
 
goofyballer's Avatar
 
Join Date: Jun 2005
Location: Searching for my Canuck soulmate
Posts: 40,282
Re: Any interest in a Project Euler Group?

It's an algorithms term: http://en.wikipedia.org/wiki/Dynamic_programming
goofyballer is offline   Reply With Quote
Old 06-14-2011, 05:44 PM   #115
Carpal \'Tunnel
 
gaming_mouse's Avatar
 
Join Date: Oct 2004
Location: taking notes on u (see profile)
Posts: 11,947
Re: Any interest in a Project Euler Group?

thx, def know the concept but never knew the name
gaming_mouse is offline   Reply With Quote
Old 06-17-2011, 03:11 PM   #116
old hand
 
Filip's Avatar
 
Join Date: Sep 2003
Location: Sweden
Posts: 1,591
Re: Any interest in a Project Euler Group?

Damn why did i find this sub forum, first i spent a hour thinking that with a handpicked team i could probably build a pretty good poker site for $1M and now a bunch of funny Euler problems.
Filip is offline   Reply With Quote
Old 06-22-2011, 08:04 AM   #117
veteran
 
Victor Kros's Avatar
 
Join Date: Nov 2008
Posts: 3,256
Re: Any interest in a Project Euler Group?

solved the first 50 and the last one (was 96th weeeeeeeee)
Victor Kros is offline   Reply With Quote
Old 06-22-2011, 03:09 PM   #118
old hand
 
Filip's Avatar
 
Join Date: Sep 2003
Location: Sweden
Posts: 1,591
Re: Any interest in a Project Euler Group?

Quote:
Originally Posted by Victor Kros View Post
solved the first 50 and the last one (was 96th weeeeeeeee)
328? Good job. Ive spent to much time on it.
Filip is offline   Reply With Quote
Old 06-25-2011, 06:39 PM   #119
adept
 
Join Date: Mar 2005
Posts: 1,056
Re: Any interest in a Project Euler Group?

Can I get in on this Euler action?
mrcoughman is offline   Reply With Quote
Old 06-26-2011, 11:29 AM   #120
stranger
 
Join Date: May 2011
Posts: 11
Re: Any interest in a Project Euler Group?

Quote:
Originally Posted by bachfan View Post
Hope you all are having fun with this. Don't be afraid to skip around - some of the later problems are way, way harder than others.

- bachfan

I had the most fun/satisfaction solving this one:

http://projecteuler.net/index.php?se...roblems&id=215
Nice problem, my solution in Python

Code:
def wall_counter(gn,r=0,c=0):
    if r==gn:
        yield c & (2**gn-1)
    elif r<gn:
        for j in [2,3]:
            for i in wall_counter(gn,r+j, c | (1<<(r+j))):
                yield i

gc=list(wall_counter(32))
lt = [[i2 for (i2,v2) in enumerate(gc) if  (v1|v2) == (v1^v2)] for (i1,v1) in enumerate(gc)]
sol=[[0 if j!= 0 else 1  for i in lt] for j in range(10)]

for i in range(1,10):
    for j in range(len(gc)):
        for k in lt[j]:
            sol[i][j] += sol[i-1][k]

print(sum(sol[9]))

Last edited by ralu; 06-26-2011 at 11:54 AM.
ralu 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 02:26 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