LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Prime Factor Coding Challenge

Hi Bruce,

 

Since I do not have a good idea I will offer the lame ones that come to mind.

1) Nobody like to loose. Make all participant winners and only those that do not compete are lossers.

2) Make this a two tier competition.Participants with more than 200 answers compete in the higher tier.

3) Add team competion.

4) Make it a multiphase competition. Stop now, declare winners for part A. Share the results and build from there.

5) Add a "handicap" based on the number of "ratings" a contributor has recieved.

6) Get NI's best developers involved. I took it as an accomplishment when I placed third behind you in the "DIctionary Challenge" but still beat NI's best.

 

So those are the lame ideas. I hope they inspire some good ones.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 51 of 186
(2,202 Views)
Bruce,

I am working on it, mostly mentally at this stage. I plan to submit something after I find some time to actually code it. How many points do I get for good intentions?

Lynn
0 Kudos
Message 52 of 186
(2,198 Views)

Bruce

I don't think the current activity is any indcation for the final participation! If history tells us something, I'll imagine that most entries will arrive at midnight at the deadline 😮

Maybe some got already submitted via the NI site? Is there a way to find out?

Adding to Ben's, we should have several leagues, with a winner in each, for example based on member designation:

  • Best Enthusiastic, best Active, best Member, best NI person, etc.. (so.. Ben when can we see your submission! ;))
Then we could do subsets, scored according to different criteria:
  • Fastest time
  • Lowest memory footprint when running
  • Most innovative algorithm
  • Best use of color ( Shane?;))
  • most unique
  • etc.
Message 53 of 186
(2,196 Views)
is probably just a lack of nicotine that makes me feel this way but I get the feeling I can not offer any help without getting sucked into another quagmire!

OK, I will try (carpal tunnel and work-load permitting) to put something together to;

1) Support my fellow LV Champions. A) First Bruce (who can not beat me this time) for sponsoring this challenge, and you Christian, so you have someone to beat in the "Enthusiatic" catagory.

2) Prove once and for all that I am a Math Wimp (copyright Ben Rayner) and the only thing that I am really proficient at is hitting the "Submit Post" button.

 

Now where were those rules again (never mind Smiley Happy  )?

 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 54 of 186
(2,184 Views)

I like the idea of the categories.  Fastest time will still determine the overall winner (according to the rules), but we can have winners in other categories as well.  The lowest memory footprint will definitely be one.  Most innovative algorithm, smallest file size, and others will probably be determined as I evaluate all the submissions.  When submitting an entry, feel free to suggest any category you feel your submission would win.  I don't think I will give any prizes for the most spaghetti code or the most inefficient code, though.

One thing I noticed is that there is a major delay for calculating the prime numbers before starting the factoring.  This results in a very large area under the curve.  One category may be the smallest area under the curve, which would require the prime numbers to only be generated as they are needed...

For the entries that do calculate the entire prime number table beforehand, there may be separate categories for fastest prime number table generation and fastest factoring.

I don't think I will split up the winners by activity level on the discussion forum, since activity level doesn't necessarily indicate level of ability or expertise.  For example, Shane and I would be in a different category than Christian.

I am willing to create a category for NI employees, if any of them are interested.  I think there were several NI entries in the first few challenges, but I haven't seen any for a while.  I would love to see if anybody at NI can come close to the scores we've seen so far...

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 55 of 186
(2,180 Views)
Hi everyone,

I've been away for the weekend.  Dreaming of prime numbers all the way....

Lowest memory footprint?  I think I might give that a go too...

I think the different categories is a good idea.  I'll bet my painting equipment out then 😄

I believe the fastest version will still be significantly faster than Christian's or mine, simply because we're using a relatively simple algorithm (Assumption as the the inner workings of Christian's code included).

The biggest question I have is how many anonymous coders do we have in the background waiting for the last minute before posting.......

Shane.

PS as yet, no new code to test
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 56 of 186
(2,169 Views)
Hey Altenbach,

Any chance of the code in LV 6.1 format??  If you need a suggestion for a password, I can email one to you 😉

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 57 of 186
(2,165 Views)


@shoneill wrote:
Any chance of the code in LV 6.1 format??

Shane, what are your motives!?
 
(I know you're pretty good with brute force algorithms. Just curious, but was 6.1 before they added the time delay to the "set lock state" method? 🐵
 
After my last HD reformat, I no longer have 6.1 installed, else I would make you one, even without password (with the diagram removed, of course). 🙂
0 Kudos
Message 58 of 186
(2,145 Views)

OK,

 

I am ashamed to admit that after a couple of hours of playing I managed to find all of the prime number less than 1,000,000 in 2 minutes and 20 seconds. At the current rate I will not be able to meet the 5 minute limit of the challenge!

 

I have not given up but I am admitting a very slow start.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 59 of 186
(2,144 Views)

OK,

 

Now at 5 seconds for all primes less than 1,000,000.

Progress but still lame.

I am still taking a lot of time with the checks of the high value primes because ther are just too many to check. There must be another property of primes that I do not know about.

Ben

Message Edited by Ben on 10-07-2005 03:38 PM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 60 of 186
(2,123 Views)