Shop OBEX P1 Docs P2 Docs Learn Events
PhiPi > PiPhi — Parallax Forums

PhiPi > PiPhi

ercoerco Posts: 20,261
edited 2010-11-02 15:08 in General Discussion
It shall be left as an exercise to the reader to prove that PhiPi logic is far more valuable than PiPhi-lology: http://en.wikipedia.org/wiki/Piphilology

Pie
I wish I could determine pi
Eureka, cried the great inventor
Christmas pudding, Christmas pie
Is the problem's very center.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-10-26 10:48
    Cripes! To me it would be easier just to memorize the dang digits, rather than some obscure verse in iambic pentameterized Elizabethan English! :)

    BTW, one of my favorite questions from the bank of those available for the ham radio technician-class license test is this:
    What instrument other than an SWR meter could you use to determine if a feedline and antenna are properly matched?
    A. Voltmeter
    B. Ohmmeter
    C. Iambic pentameter
    D. Directional wattmeter

    I was hoping I'd get this question on my exam, just so I could answer C. But I didn't.

    -Phil
  • ercoerco Posts: 20,261
    edited 2010-10-26 14:10
    Ham radio testing is flawed. When I took my Extra class test, they told me I got one answer wrong. But they wouldn't tell me which question it was, only the general category the question was in.

    What kind of logic is that? Tell me exactly what I missed so I can learn!

    And PhiPi, I'll make you a righteous deal on a vintage Heathkit 250W iambic pentameter if you're still in the market. Just PM me your credit card number and PIN. I'll take care of the rest.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-10-26 14:20
    Erco,

    You fared better on your Extra Class exam than I did. The examiner said, "Well, you didn't get any more right than you had to!" 'Total fluke: i didn't study for it (was just going for a Tech license) and should not have passed at all. So I agree that the testing is flawed.

    Regarding your generous offer: sorry, but I'll have to pass. I just bought a Hammarlund "Haiku 2000" Amp on eBay. 'Should be here any day now...

    -Phil
  • ercoerco Posts: 20,261
    edited 2010-10-26 14:39
    You and I had similar experiences, PhiPi! I studied all the material for my General class test years back, and when I passed that easily, the VE handed me the test for Advanced. "No penalty if you flunk", he said. So I just reasoned my way through and passed the test. AFAIK, the only questions I missed were on the frequency ranges specific to Advanced class hams.

    So I faked my way through Advanced class, but I did hit the books for Extra several years later. Honestly, my interest was primarily to get my code speed up. But it had been a while and the code requirements had already been dropped, much to my chagrin.

    Marginally related to my original post: I had Pi memorized to 50 decimal places in my misspent youth, for reasons that utterly escape me now.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-10-26 14:53
    Testing is a lot different now than when I got my first licenses as a kid. My uncle, who had a General Class license, administered the Novice test (incl. 5 wpm code), but I had to go to the FCC office in Indianapolis to take the General Class test (incl. 13 wpm code) from a humorless, glowering bureaucrat.

    -Phil
  • mctriviamctrivia Posts: 3,772
    edited 2010-10-26 18:18
    Boy I have a quest thankless it maybes. Write one story

    ok that is as far as I could get in 10 min
  • ElectricAyeElectricAye Posts: 4,561
    edited 2010-10-26 20:08
    About those world record holders who can "remember" 100,000 digits.... Do they truly memorize all those numbers or are they crunching some algorithm in their heads?

    ???
  • mctriviamctrivia Posts: 3,772
    edited 2010-10-26 20:18
    only algorithm I know of that lets you compute individual digits of pi only works in base 16.

    attachment.php?attachmentid=74718&stc=1&d=1288148933

    Useless fact 10^16th digit of pie is a 0.
    440 x 48 - 2K
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-10-27 05:19
    mctrivia wrote: »
    only algorithm I know of that lets you compute individual digits of pi only works in base 16.

    attachment.php?attachmentid=74718&stc=1&d=1288148933

    Useless fact 10^16th digit of pie is a 0.
    Yes, yes, yes, but can you make it run on a Propeller chip? More specifically, an algorithm to calculate the digits of pi in integer. I've had a sweet tooth for one of those.
  • ercoerco Posts: 20,261
    edited 2010-10-27 10:22
    From http://www.fun-with-words.com/mnem_numbers.html :

    There once was a fellow from Greece,
    Who forgot pi's last decimal piece.
    So he used electronics
    To collect pi mnemonics...
    Now he's hooked, and there is no release.
    Michael P. Masterson-Gibbons
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-10-28 13:18
    Erco, amazing. So now here is pi to 31 decimal places where the mnemonic stops and cannot represent a 0.

    Sir, I bear a rhyme excelling
    In mystic force, and magic spelling
    Celestial sprites elucidate
    All my own striving can't relate
    Or locate they who can cogitate
    And so finally terminate.
    Finis.

    To decode, a text program counting the number of characters is required. Now we definitely need strings.

    But this is not exactly the integer technique I was thinking about.
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-10-28 13:23
    This is a BASIC program to calculate pi in floating point. Can anyone find a simple integer program?
    DEFINT C, S  
    DEFDBL D, P  
    P = 0  
    D = 1  
    S = 2  
    CLS  
    PRINT "Press any key to stop"  
    PRINT 4# * ATN(1)  
    DO  
     FOR C = 1 TO 500  
      P = P + 4 / D  
      S = -S  
      D = S - D  
     NEXT  
     LOCATE 3, 1  
     PRINT P;  
    LOOP UNTIL LEN(INKEY$)  
    PRINT  
    PRINT (ABS(D) - 1) / 2; "iterations"  
    END
    

    For more info and another BASIC program
    http://www.groupsrv.com/computers/about501988.html
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-11-02 13:22
    No takers on creating an integer program to calculate pi using Spin? And all those genius' were joking about how simple it is in the other post. I see you can represent pi as a float math constant to a few DPs with an object in the OBEX. Could that be a good start? (i.e. float)
  • mctriviamctrivia Posts: 3,772
    edited 2010-11-02 13:27
    here is a spin program to equate pi as close as possible in integer format:

    pi=3


    now if you want to compute a single hex digit of pi you could use the formula i posted.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-11-02 13:36
    If you're multiplying by pi (the usual case), you can use this integer approximation:
    circum := dia * 355 / 113
    
    355/113 = 3.14159292...

    -Phil
  • ElectricAyeElectricAye Posts: 4,561
    edited 2010-11-02 13:56
    mctrivia wrote: »
    here is a spin program to equate pi as close as possible in integer format:

    pi=3


    ....

    I thought pi is a predefined constant in SPIN. Page 93 of the Prop manual, for example???
  • mctriviamctrivia Posts: 3,772
    edited 2010-11-02 14:00
    it is. I believe it is a fixed point format. A true integer though has no decimals. I was trying to be funny.

    attachment.php?attachmentid=74718&stc=1&d=1288148933 could be written into a spin program though to compute a hex digit of pi. don't think there is any practical use for it though except as a possible bench mark test. how quick can you compute the 100th bit of pi?
  • ercoerco Posts: 20,261
    edited 2010-11-02 14:15
    Great Pialog.

    Pity the poor masses who are content to remember Pi as 22/7!

    Or pity us, as the poor masses are out voting today!
  • Heater.Heater. Posts: 21,230
    edited 2010-11-02 14:38
    mctrivia,

    I don't know how many bugs you could put in one line of code that is only 4 characters long:)

    Firstly the assignment operator in Spin in ":=" not just "="
    Secondly "pi" is a reserved word that you cannot assign to. It is a constant holding the floating point value of pi.
  • mctriviamctrivia Posts: 3,772
    edited 2010-11-02 14:42
    ok maybe I should have error checked it. I have been doing php work and that always screws me up when I try to write some spin.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2010-11-02 15:08
    mctrivia wrote: »
    ...I was trying to be funny. ...

    You were successful. I thought it was funny. But I'd just so happened to notice that pi was a predefined constant just before seeing your post, so I thought I'd be a dork and try to look like I knew about pi's status off the top of my head. I was trying to look intelligent. :D
Sign In or Register to comment.