What is ur minimum time to generate prime in 20000000 ?

Post about everything you want - even if it is not related to programming or this site.

Moderator: Board moderators

mohiul alam prince
Experienced poster
Posts: 120
Joined: Sat Nov 01, 2003 6:16 am
Location: Dhaka (EWU)

Post by mohiul alam prince »

Hi
A1 i have also mesured my time by ur policy and it takes 1.421 sec(in p4)
but in uva it takes 1.523 sec.

MAP
CodeMaker
Experienced poster
Posts: 183
Joined: Thu Nov 11, 2004 12:35 pm
Location: AIUB, Bangladesh

Post by CodeMaker »

:) Hi , my code can get prime in the range 0<=N<=200000000. But it takes 27 second, plz tell me what is your time.
Jalal : AIUB SPARKS
Raj Ariyan
Learning poster
Posts: 70
Joined: Sat Feb 05, 2005 9:38 am
Location: Gurukul

Post by Raj Ariyan »

Hi Codemaker,
Are u ok ? 27 sec ?????? Is your time generation code is ok ? If u use simple sieve of erathosthenecs then u can get those prime 2.812 sec. If u generate prime by bit then u time will be small enough. Think abt it.
Last edited by Raj Ariyan on Tue Mar 15, 2005 3:21 pm, edited 1 time in total.
Some Love Stories Live Forever ....
mohiul alam prince
Experienced poster
Posts: 120
Joined: Sat Nov 01, 2003 6:16 am
Location: Dhaka (EWU)

Post by mohiul alam prince »

Hi
I think code maker's time is 27 sec for (prime in the range 0<=N<=200000000) and for 20000000 his time will be about 27 / 10
i mean 2.7 sec. :)

Thanks
MAP
CodeMaker
Experienced poster
Posts: 183
Joined: Thu Nov 11, 2004 12:35 pm
Location: AIUB, Bangladesh

Post by CodeMaker »

:-? Actually for 20000000 my time is 1.3 to 1.4 seconds not 27/10=2.7 seconds. To store that huge amount, I had to do some conversions, for low limits, those conversions will be cutoff and that saves a lot of time. so, what about my question, can anyone let me a batter time plz. i am enjoying playing with seive for some days, i thought about using bits to make the limit even 100 times larger, but i will not be able to reduce the upper bound of seive to work on that limit, even seive will fail to produce any outcome....
Jalal : AIUB SPARKS
A1
Experienced poster
Posts: 173
Joined: Wed Jan 28, 2004 3:34 pm
Location: Bangladesh

Post by A1 »

Now I am happy with my run time. I have add simple if condition in my sieve prime function and it decrease my runtime significently. Now my code run 2.23s in P(III 600Mhz) and 1.34s in P(IV 2.4Ghz) :D for 20000000(20 million)
and for 200000000(200 million) in P(IV) it takes 16.5.. s :D
CodeMaker
Experienced poster
Posts: 183
Joined: Thu Nov 11, 2004 12:35 pm
Location: AIUB, Bangladesh

Post by CodeMaker »

:) Hi A1, My time is for P4 1.8 GHz. Still I have some plan to reduce it a little more.
Jalal : AIUB SPARKS
mohiul alam prince
Experienced poster
Posts: 120
Joined: Sat Nov 01, 2003 6:16 am
Location: Dhaka (EWU)

Post by mohiul alam prince »

Hi
now my prime generation time is 000.760 for (1 to 20000000)
my pc is p4 1.7GHz :D

MAP
Thanks :D
CodeMaker
Experienced poster
Posts: 183
Joined: Thu Nov 11, 2004 12:35 pm
Location: AIUB, Bangladesh

Post by CodeMaker »

I reached near about 0.9 ( fairly saying - just under 1 sec) :( You have done very well prince...
Jalal : AIUB SPARKS
mohiul alam prince
Experienced poster
Posts: 120
Joined: Sat Nov 01, 2003 6:16 am
Location: Dhaka (EWU)

Post by mohiul alam prince »

Hi
Now my prime generatoin time is 000.600 :D

thankx
MAP
CodeMaker
Experienced poster
Posts: 183
Joined: Thu Nov 11, 2004 12:35 pm
Location: AIUB, Bangladesh

Post by CodeMaker »

:( You know how u did it, I give up!!! and one thing, I never use anything like MACROS, i try to speed up using normal syntax and algo. And for that , that's my limit. I can't go further....i would like to know about ur process. Well done!! atlast.
Jalal : AIUB SPARKS
mohiul alam prince
Experienced poster
Posts: 120
Joined: Sat Nov 01, 2003 6:16 am
Location: Dhaka (EWU)

Post by mohiul alam prince »

Hi
You are right i have used MACROS. But My algorithm is secret. I have
solved 10311 Goldbach and Euler problem by using my algo and get ranked 9. :)

Thankx
MAP.
CodeMaker
Experienced poster
Posts: 183
Joined: Thu Nov 11, 2004 12:35 pm
Location: AIUB, Bangladesh

Post by CodeMaker »

:roll: there is a great chance that u will not get the credit of discovering a new algo if u don't publish it :wink: ,
ok no matter....keep it up. still u r 9th best :lol:
Jalal : AIUB SPARKS
mohiul alam prince
Experienced poster
Posts: 120
Joined: Sat Nov 01, 2003 6:16 am
Location: Dhaka (EWU)

Post by mohiul alam prince »

Hi codemaker
Don't mind I will publish my algo at that time if i reduce my time below 000.200 second because there is a man who can generate prime with in below 000.200 second for (1 To 20000000).So think my
prime generation time is not good at this time.

Thanks
MAP
Post Reply

Return to “Off topic (General chit-chat)”