The following warnings occurred:
Warning [2] Undefined array key 106817 - 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 106830 - 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 106831 - 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 106883 - 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 106883 - 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 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





19BII Program Question



#2

Hello,

I would like to ask for some help. I have some general knowledge of the solver and formulas but I am stumped on how (or if) to create a simple dice rolling equation.

I am trying to create a solver function that will re-create the following.

NUM DICE? = D
HIT MIN? = H
Number of hits = X

So if I needed to recreate the rolling of 48 dice and show how many results are 5 and 6 cumulatively. or 32 dice and how many results are 4, 5 and 6 cumulatively.

I saw a post from a guy that has done the on a TI-82. He used this formula.

Quote:

ClrHome
--clear the screen

0->X
--the variable x gets reset to 0, x will hold the # of successful hits

Input ("Num Dice? ", D)
--Prompts for # of dice to roll, stores the value in variable D

Input ("Hit Min? ", H)
--Prompts for Minimum number needed for a succesful hit, usually 4,5, or 6, and stores in Variable H)

For (I,1,D,1)
--This is a loop, the Variable I is our incrememted by 1 each time through until it is equal to D, which is the # of dice rolls

If ((int (rand*6+1)>=H)
--if the randomly generated number of 1-6 is greater than variable H, your minimum hit #, then...

X+1->X
--X, your hit count variable, gets incremented by 1

END
--end the loop

Disp X
--print out the number of hits

Quote:
REPLACE THIS TEXT WITH THE QUOTE


#3

This is a bit tricky but should work:

HITS=SUM(I:1:DICE:1:MAX(0:SGN(INT(6xRAN#)+2-HMIN)))
Replace SUM by the summation sign (Sigma)

INT(6xRAN#)  returns an integer from 0 to 5
+2-HMIN converts it to a posive number if the margin is hit
MIN(0:SGN()) returns a 1 if the argument is positive, 0 else
The summation sums up the ones that indicate a hit.

#4

I just found out about the IF function:

HITS=SUM(I:1:DICE:1:IF(INT(6xRAN#)+1<HMIN:0:1))
I didn't enter this version into my calc but it should work the same way and is easier to read.

#5

Hi,

Yes that works great. I appreciate your help.

Hans


Possibly Related Threads…
Thread Author Replies Views Last Post
  Solver issue with HP 17BII - different from 19BII Jeff Kearns 13 4,467 11-28-2013, 02:36 AM
Last Post: Don Shepherd
  HP Prime: run a program in another program Davi Ribeiro de Oliveira 6 2,614 11-11-2013, 08:28 PM
Last Post: Davi Ribeiro de Oliveira
  42s program question David Persinger (US) 5 1,751 08-09-2012, 06:34 AM
Last Post: David Persinger (US)
  Why is the 19BII faster than the 17BII(+)? Timo Labrenz 8 2,719 05-03-2012, 08:00 AM
Last Post: Xerxes
  HP 19Bii Market Value Celso Lima 1 1,041 04-18-2012, 05:39 AM
Last Post: Don Shepherd
  WP34S program question Mike Maiorana 12 3,066 04-05-2012, 03:09 AM
Last Post: Steve Simpkin
  19BII replacement recommendations/decision making help needed Timo Labrenz 20 4,782 03-28-2012, 12:24 PM
Last Post: Timo Labrenz
  17BII+ vs 19BII Business Consulatant II Jeff Kearns 18 4,632 01-06-2012, 08:52 PM
Last Post: Raymond Del Tondo
  Needed - a little help with my HP-19BII Palmer O. Hanson, Jr. 30 6,247 05-18-2010, 12:36 PM
Last Post: Steve Perkins
  A new 19BII variant... Massimo Gnerucci (Italy) 3 1,276 04-14-2010, 04:46 PM
Last Post: Sancerre (Phoenix)

Forum Jump: