The following warnings occurred:
Warning [2] Undefined array key 107233 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107236 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107242 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107245 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107248 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107267 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107268 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107273 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107274 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107279 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107292 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107293 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107294 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107297 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107316 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107322 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107385 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107392 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107405 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107245 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107292 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107316 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107248 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107405 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107274 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107294 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107293 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 107322 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





7 Out Of 10



#7

While doing some statistics research I ran across this article:

http://faculty.vassar.edu/lowry/ch5pt1.html

It states that the likelihood of at least 7 out of 10 coin tosses coming up heads is 17%. This seamed too high to me, so I set upon verifying the figure.

After about 4 hours, I managed to develop an equation that would tell you for any number of coins (c), the likelihood of at least (h) tosses coming up heads. Of course, 0<h<=c.

On my 50g, my equation worked right out of the editor. But just last week I was given an 11c (in exchange for tutoring in calculus) and I decided to see if I could still program. I was able to get my 11c to give the solution in 25 steps. I calculated the actual probability to be 0.171875.

I’d love to see other solutions. I’ll post mine in a few days.

Very respectfully,
David


#8

Hi, David:

    The following 20-step routine for the HP-11C I've concocted
    right now will do what you want:
        LBL A
    STO 0
    E3
    /
    +
    STO I
    CLX
    LBL 0
    RCL 0
    RCL I
    INT
    Cy,x
    +
    ISG
    GTO 0
    2
    RCL 0
    Y^X
    /

    To run it, just enter Heads and Coins in the stack, in that
    order, and GSB A. For example:

        7 ENTER 10 GSB A -> 0.171875
Best regards from V.

Edited: 3 Feb 2007, 11:26 p.m.


#9

Hi, Valentin --

Very elegant! The answer both of you gave is correct, of course. It assumes a fair coin, so the probabilities of heads and tails need not be incorporated, as the Binomial Theorem would do.

Your program using the example of 10 coins (or flips) and 7 heads took only two seconds flat to run on my
accelerated HP-11C.

The program is simple enough, so I'll leave to others the satisfaction of analyzing it. For those who are interested, it will port to an HP-15C with just one modification: Since "ISG" can work with any register on an HP-15C, its version would have "ISG I" in place of "ISG", which works only with the I register on an HP-11C.

-- KS

Edited: 4 Feb 2007, 3:33 p.m.

#10

Extremely well done Valentin,

It has been over 9 years since I lost my original 11C to a tragic laundry accident. I think it survived the washing, but the drying did it in.

I’d forgotten the syntax for using the “I” register. My solution included manually incrementing a memory register.

Thank you for a great example of elegant code.

One of my coworkers came up with a creative, but very inefficient solution. He created an Excel spreadsheet with all 1024 possible combinations of coin flips, then counted all where there were 7 or more heads.

The ironic thing, he finished his project about 20 minutes before I got my equation to work,

Thanks again,
David

Edited: 4 Feb 2007, 1:45 p.m.


#11

Alas, 100,000 chimps in a room *can* write Shakespeare after all!

#12

Thanks for your kind words of appreciation, David.

Sorry for your late HP-11C. The 11C's indeed a wonderful machine though if you can, get an HP-15C. It certainly is the very best pure calculator there is and has ever been, bar none.

Thanks also for your interesting 'quiz', it was a welcome relief over more mundane matters.

Best regards from V.

#13

Here is one for the 41 (my one and only... can you tell me what the 11c is in comparison to say the 12c and the 15c?) which I believe does the trick. It is rather brute force and 'stupid' (both of which is a function of the programmer, not the 41C!) It is not using the fact that the last loop of 00 will always deliver 1 and the one to the last run will always deliver the number of flips.

Also, it calculates the necesseray 'n over k' number brute force and hence a) has a limit of 69 flips - 69! is the max for the 41c - and b) will run into numerical inaccuracies at around 16 flips - 16! has 13 digits . A smarter - and longer - 'n over k' routine in lbl 00 would be needed to push these constraints a bit further as well as use of the above mentioned facts.

To start, just do heads, enter, flips, run to get the number of heads wanted in y and the number of flips in x before starting the routine

Lbl '7oo10
Sto O
E3/E+
LastX
Fact
Sto M
RDN
+
DECX
Sto N
Clx
Sto 00
Lbl 00
Rcl M
Rcl O
Rcl N
Int
-
LastX
Fact
X<>Y
Fact
*
/
Sto+ 00
Isg N
GTO 00

Rcl 00
Rcl O
2
y^x
/
Stop


#14

Hi, Peter --

Quote:
Here is one for the 41 (my one and only... can you tell me what the 11c is in comparison to say the 12c and the 15c?)

The MoHPC pages and "calculator comparison" feature would be helpful for identifying the differences between the three Voyager-series models. The topic of 11C vs. 15C has come up a few times in the Forum over the years.

Quote:
Also, it calculates the necessary 'n over k' number brute force and hence a) has a limit of 69 flips - 69! is the max for the 41c - and b) will run into numerical inaccuracies at around 16 flips - 16! has 13 digits . A smarter - and longer - 'n over k' routine in lbl 00 would be needed to push these constraints a bit further as well as use of the above mentioned facts.

Yes indeed, the HP-41 does not have built-in statistical combination ('n over k' number) or permutation. Nor are these functions available on the Stat Pac ROM. Robust routines -- which will provide the correct answer as long as it is within the displayable range, and which do not waste considerable time doing needless calculations -- do require some thought as to the approach.

The HP-15C in particular is a much better "pure calculator" (i.e., non-expandable, non-I/O, not intended for extensive programming) than the HP-41. Here's the proof!

HP-41 as calc vs. 15C

Of course, I'm delighted with my HP-41C, HP-41CV, and HP-41CX as well as my HP-15C's and HP-11C's...

-- KS


Edited: 4 Feb 2007, 3:36 p.m.

#15

wow, just came back to the thread. Busy, busy...

I'm not surprised that Valentin posted before me (though, to be fair, I do not know when he read the original puzzle and when I read it, but I don't think it would have mattered ;-) ) Yet I'm happy that his and my solution, developped independently, are quite similar. As we say in Austria, even a blind chicken finds a grain once in a while...

BTW - Valentin, when is the next SSMC? I was out of comission for a year but have 'caught up' programming allmost all of the ones I missed in the meantime, skipping those were the 41c is hopelessly out of his league...

Thanks Karl for the tips on 15c vs 41c, it seems that the 15c is quite a powerful little bugger!

Cheers and thanks for the entertainment!

Peter


#16

Hi, PeterP:

PeterP posted:

    "BTW - Valentin, when is the next SSMC?"

      Thanks for your interest. I know it's been quite some time since I posted the latest S&SMC, but I couldn't help it. I've been suffering an extreme lack of free time, what with working full-time in an important project on the one hand, while having to cope with some unfortunate events at home on the other.

      The result of it all has been that I've been forced to maximize my terminally scarce free time to bring maximum output to the most urgent tasks, and the most urgent HP-related task was to create and send new articles to Datafile for its publication in the very next issue due in February.

      They were 3 articles, all of them featured, one of them belonging to a classic series of mine, the "Long Live ..." one, and the other two being the first of two new regular series I've just created. All in all, 12 pages, including 3 programs, some 4 or 5 smaller 'routines', plus formatting, graphics, ... this took all my time, believe me.

      Nevertheless, I've just completed *four* more articles belonging to the new series, and intended for the April and June issues, so I can reserve some free time to concoct a worthwhile S&SMC or some interesting Mini-Challenge for the HP-15C, say, I've got some very good ideas to try.

      Stay tuned ! :-)

Best regards from V.


#17

Wow Valentin, you have been busy, very impressive. And very sorry indeed to hear about troubles at home. Those are the hardest one to deal with. All the best for you from here!

Peter


#18

Much appreciated.

Best regards from V.

#19

Isn't this the binomial distribution? P(n,k)?

If I recall correctly, the probability would be:

P(n,k) = Comb(n,k) * p^k * (1-p)^(n-k)

where p in this case is 0.5


#20

I thought so, too. But that results to 0.1171875. What am I missing?

(calculated w/ Commodore SR4190R and HP-30S)


#21

Hi, Thomas:

Thomas posted:

    "I thought so, too. But that results to 0.1171875. What am I missing?"

      The key word is "at least N heads". The individual probabilities of having 7, 8, 9, or 10 heads out of 10 coins are as follows:
          10  7   0.1171875
      10 8 0.0439453125
      10 9 0.009765625
      10 10 0.0009765625
      and you need to add them up, to come with 0.171875 which is thus the correct answer. Have a look at my HP-11C program above.
Best regards from V.

#22

Ah, that's it. It's the accumulation of a series of those calculations. Missed the "at least" bit. :-)

#23

Thanks Valentin! Silly me...

#24

Hi, Gene --

Quote:
Isn't this the binomial distribution? P(n,k)?

If I recall correctly, the probability would be:

P(n,k) = Comb(n,k) * p^k * (1-p)^(n-k)

where p in this case is 0.5


From my post of a few hours prior:

"It assumes a fair coin, so the probabilities of heads and tails need not be incorporated, as the Binomial Theorem would do."

If the coin were not fair (that is, p(heads) < > 0.5), then a binomial series with simplified calculations might be the best approach. For example,

if q(n,k) = p^k * (1-p)^(n-k), then q(n, k+1) = q(n,k) * p/(1-p) for 0 < p < 1.

[An implicit assumption of 0^0 = 1 is needed to make the binomial expression give the correct answers of 1.00 for p = 0 and k = 0, and for p = 1 and k = n.]

However, since p = 0.5,

p^k * (1-p)^(n-k) = 0.5^n = 1/(2^n) for all k, which can be factored out from each term. 2^n was the denominator in Valentin's program.

-- KS

Edited: 5 Feb 2007, 12:28 a.m.

#25

There have been some great threads recently. This one is one of my favorites. Thanks for posting!


Possibly Related Threads…
Thread Author Replies Views Last Post
  Shutdown with the Apps key and more than 10 variables in a program. Davi Ribeiro de Oliveira 10 3,749 11-05-2013, 01:26 PM
Last Post: Han
  Updated PPC DVD Version 2.10: HP-41 Searchable Program Files and Scannable Barcode Jake Schwartz 3 1,833 09-27-2013, 09:51 PM
Last Post: Olivier (Wa)
  Rounding of 10^x Olivier De Smet 8 2,498 08-28-2013, 06:33 AM
Last Post: Dieter
  HHC 2012 RPN Programming Contest - 10-Step Way-After-Nashville Solution Jeff O. 32 6,651 10-12-2012, 01:41 AM
Last Post: Paul Dale
  Library 4 update on 10/2/2012 ? Gene Wright 10 2,999 10-11-2012, 02:31 AM
Last Post: Ángel Martin
  e^pi - pi + 9/10^4 + 1/(10^4*ln(2) + sqrt(10)/6)^2 Gerson W. Barbosa 47 11,463 08-08-2012, 10:58 PM
Last Post: Les Koller
  [WP-34S] Upgrade in 10 mins. now v 3.1 2988 Chris Tvergard 12 3,660 06-01-2012, 02:39 AM
Last Post: Walter B
  Link for SAMBA v2.10 download Tom Sauntry 9 2,539 05-28-2012, 11:41 AM
Last Post: Tom Sauntry
  [WP34S] OT - Fonts in Manual on OS X 10.7.3 Les Wright 43 9,603 03-23-2012, 08:41 AM
Last Post: Marcus von Cube, Germany
  Wrong answer when evaluating log(10^-12) Daniel Greenidge 4 1,644 01-26-2012, 05:54 PM
Last Post: Daniel Greenidge

Forum Jump: