Author Topic: [TI-Planet Contest] Heat up your calc with arithmetic !  (Read 23947 times)

0 Members and 2 Guests are viewing this topic.

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #45 on: April 10, 2013, 07:21:00 am »
I got that, but missed the joke. :P

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #46 on: April 11, 2013, 11:22:37 am »
I finally got around making the palindrome generator. that was easy. 8)
Stats :
The first five (2, 3, 5, 7, 11) are hardcoded because my palindrome gen wont work with less than 3 digits.
42nd palprime : 18181, 164/512 = 0.32 seconds 155/512 = 0.3 seconds.
70th palprime : 39293, 428/512 = 0.84 seconds 381/512 = 0.74 seconds. Unfortunately, that's the furthest we can go with 16 bits.
This is an Axe program that works with 16 bits integers at full speed.

I measure the speed with the max speed interrupt running theta++ every time. I display the value of theta at the end. Since this is a 512Hz interrupt, I just have to divide by 512 to know the time it took. ;)

Edit : Dropped in a crazy optimization that brought my times down by a fair amount. :P
« Last Edit: April 11, 2013, 01:10:22 pm by Streetwalker »

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #47 on: April 11, 2013, 12:42:31 pm »
Can we pre-calculate and store answers that aren't the very first values, as long as it's not a straightforward list of all the answers? I had an idea of speeding mine up by storing, say, every 100th prime palindrome and using them as base points for calculations to reduce computation time for large inputs/outputs. If this isn't allowed, I think it should probably be made clear that except for a few starting values, your algorithm must go through all prime palindromes to get up to the target.

EDIT: Also, do we have an official ruling yet on the largest input our programs need to work on? They could certainly be different for different platforms/languages, but establishing some would be really nice.

Can we get some official rulings on these two questions? I'm especially concerned about the first one, because unless it is specified that the search algorithm has to pass through every prime palindrome up to the target (except perhaps for the first five, which I know some algorithms take as given and wouldn't even be able to find some of them), then people will start using the method of storing "checkpoints" to drastically reduce the number of steps to get to an answer. The issue with this is that the competition would just become more of a battle of who can fit in the most checkpoints, rather than a battle of who can create the best searching algorithm.
« Last Edit: April 11, 2013, 12:43:00 pm by Runer112 »

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #48 on: April 11, 2013, 12:46:31 pm »
I totally agree with you Runer, checkpoints are unfair and even though they decrease max computing time, they make searching time random depending on wether you're just before a checkpoint or just after.

Offline Dapianokid

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 539
  • Rating: +46/-27
  • That one dude
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #49 on: April 11, 2013, 01:42:24 pm »
Well I believe there should be a check for the 10th, 50th, and 100th palindromes, or three within a certain range, depending on the model. That way, everybody can fairly compare. :)
I lost my function! Rewriting it now...
Keep trying.

Offline sammyMaX

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 204
  • Rating: +9/-0
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #50 on: April 11, 2013, 04:56:22 pm »
I really don't think such checkpoints should be allowed. It wouldn't contribute anything to the algorithmic thinking the competition is supposed to promote. Suppose checkpoints were allowed. Competitors would need to use them to keep up with other programs that use checkpoints, so all the good entries have them.

If, like  Dapianokid said, people could only store the 10th, 50th, and 100th palindromic primes, then all the programs would still start testing with the same number (say if we wanted the 74th prime palindrome, everyone would start with the 50th one), so the winner would be the person with the most efficient algorithm. That person still would have won if they started testing numbers from the beginning, so why not just start testing numbers from the beginning? It makes the programs simpler, smaller, and more "pure" anyways.

Meanwhile, if people could store whatever palindromic primes they wanted, the winner would be either:
a) lucky that he/she happened to store the palindromic primes just below the numbers wanted
b) someone who precomputed a huge number of palindromic primes
And both a) and b) imply that the efficiency of the actual algorithm used to search for palindromic primes is not important, which is bad.

Are you wondering who Sammy is? My avatar is Sammy.
   

Offline Dapianokid

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 539
  • Rating: +46/-27
  • That one dude
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #51 on: April 11, 2013, 05:06:43 pm »
I meant "check" as in test, so that timings were based off of those numbers.

I do not advocate checkpoints.
Keep trying.

Offline sammyMaX

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 204
  • Rating: +9/-0
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #52 on: April 11, 2013, 05:08:24 pm »
Okay, I agree with having official numbers to get timings.

Are you wondering who Sammy is? My avatar is Sammy.
   

Offline Dapianokid

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 539
  • Rating: +46/-27
  • That one dude
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #53 on: April 11, 2013, 05:09:42 pm »
If somebody could come up with a closed form function (which I am close to.. It's approximate..) then Sammy would be happy.
Keep trying.

Offline dinosteven

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 194
  • Rating: +10/-1
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #54 on: April 24, 2013, 08:08:07 am »
I have a question: What program do we submit if we're doing Axe? The compiled executable, or the source?

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #55 on: April 24, 2013, 08:17:57 am »
I have a question: What program do we submit if we're doing Axe? The compiled executable, or the source?
You'd have to give both.
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline dinosteven

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 194
  • Rating: +10/-1
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #56 on: April 24, 2013, 10:24:44 am »
Okay, thanks.

Offline jacobly

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 205
  • Rating: +161/-1
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #57 on: April 30, 2013, 01:08:52 am »
I have a question: What program do we submit if we're doing Axe? The compiled executable, or the source?
You'd have to give both.
I assume this applies to z80 assembly also?

So, my calculation of "300 per second" was off by quite a bit. I forgot to calculate in non-primes and the wasted cycles there :P I only get about 30 primes per second, but my algorithm could be better refined XD

(And this is at 6MHz)
According to my calculations, this is almost exactly the worst-case speed I am getting (29.78 pps). :o

Edit: Runer suggested that I don't post timings so as not to discourage anyone, so I'll just say that my program can get the 5953rd palprime in under an hour. ;)
« Last Edit: April 30, 2013, 01:45:46 am by jacobly »

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #58 on: April 30, 2013, 11:19:27 am »
Edit: Runer suggested that I don't post timings so as not to discourage anyone, so I'll just say that my program can get the 5953rd palprime in under an hour. ;)
Lol, that is too late, I got discouraged when I learnt that Runer and you were participating, no need to post your timings :P
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #59 on: May 10, 2013, 06:26:05 am »
Wow, I thought this was already done and I hadn't submitted in time! I have my last exams today, so maybe I can work on my programs a little more.