[go: up one dir, main page]

Showing posts with label games. Show all posts
Showing posts with label games. Show all posts

Sunday, March 17, 2024

Casio fx-9750GIII and fx-CG 50: Playing Games with the Probability Simulation Mode

Casio fx-9750GIII and fx-CG 50: Playing Games with the Probability Simulation Mode






The Probability Simulation add-in has six types of probability simulations:

* Coin Toss

* Dice Roll

* Spinner

* Marble Grab

* Card Draw

* Random Numbers


The add-in application is available for the following calculators:

* Casio fx-9750GIII and fx-9860GIII (and Graph 75/85/95 series, Graph 35+ E II)

* Casio fx-CG 10/20 and fx-CG 50 (and Graph 90+E)

* Casio fx-9860G


I believe on the fx-9750GIII and fx-9860GIII, the Probability Simulation Add-In is available out of the box. For others, the add-in can be downloaded through Casio’s Worldwide Education Website: https://edu.casio.com/download/index.php.


Let’s look at three ways we can use the Probability Simulation add-in in games of chance. This is a great app when you don’t have a pair of dice, playing cards, or a bag of marbles around.


In the Set Up menu, there is an option for seed from 1 to 99999.


Screen shots are from the fx-CG 50.


Interaction with Other Modes


* Data can be stored into global lists 1-26. Lists in these Casio calculators contain only numerical information. Numerical codes are used for card suits and face cards.


* There are no commands from the Add-In that can be used in programming. The simulation is mean to be a stand-alone app.




Drawing a Poker Hand






From the main screen, press F5 for Card Draw. To simulate poker, go into set up by pressing [SHIFT] {SET UP}. We can set either a 52 playing card deck, which is the standard deck without Jokers, or a reduced deck of 32 cards (sevens through Aces only). We don’t want Replacement, so turn that off. Press [ EXIT ] to go back to the simulation.


To draw a single card, press [ F1 ]. To draw multiple cards, press [ F2 ] for { +n }. At the prompt, press [AC/ON] and enter the number of cards.


We will have to memorize the cards or note the down on paper or another writing device.


To save the cards drawn, select [ F3 ] (STORE). There are three lists:


Draw: Draw number

Value: Card value. 1 = Ace, 11 = Jack, 12 = Queen, 13 = King

Suit: 1 = Heart, 2 = Club, 3 = Spade, 4 = Diamond


Lists can be allocated to the global list variables List 1 to List 26. Press [ F6 ] { EXE } to store the cards. Storing results works similarly in other applications.



Rolling Dice in Adventure Games





In adventure and fantasy games such as Dungeon and Dragons, sometimes dice beyond the standard six-sided die is needed. The Dice Roll (F2 from the Main Menu) has dice that are four-sided, six-sided, eight-sided, twelve-sided, and twenty-sided. Up to three dice can be thrown at once.


A Simple Lottery





Random integers from 0 to 99 can be drawn with the Random Numbers. Again, the set up menu is the key. For the lottery, turn the Repeat option off. Above are four draws from a simple lottery from 63 numbers.



This has been a look at Casio’s Probability Simulation Add-In. Until next time,


Eddie


All original content copyright, © 2011-2024. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.


Monday, July 3, 2023

Python: Five-Letter Scramble Game

Python:   Five-Letter Scramble Game








Scripts



scramble.py:  

Python 3


Calculators:

Numworks

TI-83 Premium CE Python Edition

TI-84 Plus CE Python


Python Scramble App:

HP Prime


Download the files here:   

https://drive.google.com/file/d/1wDTGv40HMGnaVoB_00Z9_YM1SQu_mItH/view?usp=sharing


Nuwmorks Page:

https://my.numworks.com/python/ews31415/scramble


Object


The object of the game is to unscramble five-letter words.  You only get one chance, but there is no time limit.   Try to get a high score!  



Note:  I did my best to include to include only words that have one correct permutation, that is you can only rearrange the letters one way.  There are no proper names.   (Hence words like heart/earth, diver/drive, sleet/steel, input/print, scare/cares, etc. are eliminated).   



If you want to know how the code was put together, please let me know.   



Have fun,


Eddie 



All original content copyright, © 2011-2023.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Sunday, May 14, 2023

HP Prime: Drawing a Balance Scale and an Updated High Low Game

HP Prime:   Drawing a Balance Scale and an Updated High Low Game



Introduction


The program DSCALE draws a balance scale given two weights:  one placed on the left side (A) and one on the right side.  The length of the bar, which is measured from the center to one of the weights can be set by the user.   Assume that the length is equal on both sides.


The scale in this program is not meant to bend more than 45°.   The program will not draw the scale if the bend is greater than 45°.  


The program is made to simulate balancing the scales.   


Note that the HP Prime PPL  (Prime Programming Language) does not have goto and label commands.  To allow for the user to draw more than one scale, a while loop and a seeding value are used.



HP Prime Program:  dscale


EXPORT dscale()

BEGIN

STARTAPP("Function");

HAngle:=1;  // degrees

W:=4;

K:=1;

INPUT(L,"Balance Scale","L:",

"Length-Center");

 

  

WHILE K==1 DO

INPUT({A,B},"Balance-Scale",

{"<-","->"},{"Left Weight","Right

Weight"});

D:=(B-A)/2;

θ:=ABS(ATAN((B-A)/L));

S:=W*(B-A)/L;

IF θ>45 THEN

MSGBOX("CANNOT DRAW");

CONTINUE;

END;

Function.Xmin:=−W-1;

Function.Xmax:=W+1;

Function.Xtick:=1;

Function.Ymin:=−W-1;

Function.Ymax:=W+1;

Function.Ytick:=1;

RECT(#FFFFFFh);

LINE(0,W,0,−W,#DAA520h);

LINE(−.5,W,.5,W,#FF8000h);

LINE(−1,−W,1,−W,#FF8000h);

LINE(−.5,W,−W,S,#AAAAAAh);

LINE(.5,W,W,−S,#AAAAAAh);

LINE(−W,S,W,−S,0);

WAIT(0);


CHOOSE(K,"Again?","Yes","No"); 

END;

STARTVIEW(−1);

 

END;






The Hi-Low Game Comes to the HP Prime



The program HILODS is the classic high-low guessing game, but instead of text, it draws a balance scale to indicate whether you are higher and lower from the target number.  You work with the left weight (A), with the goal of balancing with the right weight (B).  The right weight is set with a random integer from 10 to 99.  


The game has three difficulty levels:  easy (25 guesses), medium (15 guesses), and hard (10 guesses).






HP Prime Program:  hilods


lose()

BEGIN

STARTVIEW(−1);

MSGBOX("The number is "+STRING(B)+".\n

"+STRING(ABS(A-B))+" away.\n

Better luck next time.");

// backslash n: new line

END;


win() 

BEGIN

STARTVIEW(−1);

MSGBOX("You win! \n

# Guesses: "+STRING(N-C));

END;

 

EXPORT hilods()

BEGIN

// in progress

 

  

STARTAPP("Function");

HAngle:=1;  // degrees

W:=4;

L:=100;

B:=RANDINT(10,99);

Function.Xmin:=−W-1;

Function.Xmax:=W+1;

Function.Xtick:=1;

Function.Ymin:=−W-1;

Function.Ymax:=W+1;

Function.Ytick:=1;

CHOOSE(I,"Different Levels",

"Easy","Medium","Hard");

C:=2.5*I^2-17.5*I+40;

N:=C;

A:=0; // starting seed


WHILE A≠B DO

INPUT(A,

"Guesses left: "+STRING(C),

"Guess? ",

"From 10 to 99");

D:=(B-A)/2;

S:=W*(B-A)/L;

RECT(#FFFFFFh);

LINE(0,W,0,−W,#DAA520h);

LINE(−.5,W,.5,W,#FF8000h);

LINE(−1,−W,1,−W,#FF8000h);

LINE(−.5,W,−W,S,#AAAAAAh);

LINE(.5,W,W,−S,#AAAAAAh);

LINE(−W,S,W,−S,0);

WAIT(0);

C:=C-1;

IF A==B THEN

win();

END;

IF C==0 THEN

lose(); B:=A; // to exit loop

END;

// while end

END;

// main end

END;





This a slightly different approach to the same program than I gave last week.  


Eddie 



All original content copyright, © 2011-2023.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Sunday, May 7, 2023

TI-84 Plus CE: Drawing a Balance Scale and an Updated High Low Game

TI-84 Plus CE:   Drawing a Balance Scale and an Updated High Low Game



Drawing a Scale



The program DSCALE draws a balance scale given two weights:  one placed on the left side (A) and one on the right side.  The length of the bar, which is measured from the center to one of the weights can be set by the user.   Assume that the length is equal on both sides.





The scale in this program is not meant to bend more than 45°.   The program will not draw the scale if the bend is greater than 45°.  


DSCALE was programmed with a TI-84 Plus CE, but can be programmed on a monochrome calculator with the color commands taken out.


The program repeats for different weights at the user's choice.  



TI-84 Plus CE Program:   DSCALE



Degree:Func:FnOff 

Disp "BALANCE SCALE"

Disp "LENGTH-CENTER?"

Prompt L

4→W

Lbl 1

ClrHome

Disp "LENGTH-CENTER:",L,""

Input "LEFT WEIGHT? ",A

Input "RIGHT WEIGHT? ",B

(B-A)/2→D

abs(tan^-1((B-A)/L))→θ

W*(B-A)/L→S

If θ>45:Then:Disp "CANNOT DRAW":Goto 2:End

­-W-1→Xmin:W+1→Xmax:1→Xscl

­-W-1→Ymin:W+1→Ymax:1→Yscl

AxesOff:LabelOff

ClrDraw

Line(0,W,0,-­W,ORANGE)

Line(-­.5,W,.5,W,BROWN)

Line(­-1,­-W,1,­-W,BROWN)

Line(­-.5,W,-­W,S,LTGRAY)

Line(.5,W,W,­-S,LTGRAY)

Line(­-W,S,W,­-S,BLACK)

Lbl 2

Pause 

Menu("AGAIN?","YES",1,"NO",0)

Lbl 0

Disp "THANK YOU"







Updating a Game



The program HILODS is the classic high-low guessing game, but instead of text, it draws a balance scale to indicate whether you are higher and lower from the target number.  You work with the left weight (A), with the goal of balancing with the right weight (B).  The right weight is set with a random integer from 10 to 99.  


The game has three difficulty levels:  easy (25 guesses), medium (15 guesses), and hard (10 guesses).



TI-84 Plus CE Program:   HILODS


Degree:Func:FnOff 

Disp "HIGH-LOW GAME"

AxesOff:LabelOff

100→L

randInt(10,99)→B

4→W

­-W-1→Xmin:W+1→Xmax:1→Xscl

­-W-1→Ymin:W+1→Ymax:1→Yscl

Menu("DIFFICULTY LEVEL","EASY",10,"MEDIUM",11,"HARD",12)

Lbl 10:25→C:Goto 20

Lbl 11:15→C:Goto 20

Lbl 12:10→C:Goto 20

Lbl 20

Disp toString(C)+" GUESSES"

Disp "BETWEEN 10 AND 99"

C→N


Lbl 1

ClrHome

Disp "GUESSES LEFT: "+toString(C)

Disp "{10,99}"

Input "GUESS? ",A

(B-A)/2→D

W*(B-A)/L→S

ClrDraw

Line(0,W,0,-­W,ORANGE)

Line(-­.5,W,.5,W,BROWN)

Line(­-1,­-W,1,­-W,BROWN)

Line(­-.5,W,-­W,S,LTGRAY)

Line(.5,W,W,­-S,LTGRAY)

Line(­-W,S,W,­-S,BLACK)

Pause 

C-1→C

If A=B:Goto 9

If C=0:Goto 8

Goto 1


Lbl 8

ClrHome

Disp "THE NUMBER IS "+toString(B)

Disp toString(abs(A-B))+" AWAY"

Disp "BETTER LUCK NEXT TIME"

Stop



Lbl 9

ClrHome

Disp "THE NUMBER IS "+toString(A)

Disp "YOU WIN!"

Disp "NUMBER OF GUESSES: "+toString(N-C)

Stop







Download both programs here (as a zip file):  https://drive.google.com/file/d/1hJwyqSZJ-aCQ36Wh2cCfMVy6BpAzmmPZ/view?usp=share_link



Enjoy,


Eddie 


All original content copyright, © 2011-2023.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Saturday, January 21, 2023

Casio fx-9750GIII: Spin the Wheel

Casio fx-9750GIII:   Spin the Wheel



Making the Wheel and String Commands


The wheel is comprised of a long string.  Each space has an equal amount of characters, in this case I picked 5.  To make the wheel "spin", I use the StrRotate.


StrRotate(Str n, s):


Str n:  n from 1 to 20

s:  number of spaces to rotate the string.  If s>0 the string rotates left.  If s<0, the string rotates right.   The characters wrap around.  


If Str1 = "TESTBOOKADAM"


StrRotate(Str 1,4) returns "BOOKADAMTEST"

StrRotate(Str 1,-4) returns "ADAMTESTBOOK"


Other commands used:


StrLeft(Str n, s):   takes the left s characters of Str n

StrRight(Str n, s):  takes the right s characters of Str n

StrMid(Str n, p, m):  extracts the string starting at position n at m characters



The wheel used in this program:

BROKE  (it's bankrupt said in five characters)

$ 650

$ 550

$ 900

$ 800

$ 700

PRIZE  (prize space)

$1000

$ 600

$ 750

$ 500

$5000


5 characters per space is used.  




Casio fx-9750GIII Program:  SPIN


"2022-11-23 EWS"

"BROKE$ 650$ 550$ 900$ 800$ 700PRIZE$1000$ 600$ 750$ 500$5000"→Str 1

Lbl 1

RanInt#(20,48)→N

For 1→I To N

StrRotate(Str 1,5)→Str 1

StrLeft(Str 1,5)→Str 2

ClrText

Locate 10,3,"↓"

Locate 2,4,StrRight(Str 1,5)

Locate 8,4,Str 2

Locate 14,4,StrMid(Str 1,6,5)

Next

1DispsMenu "SPIN AGAIN?","YES",1,"NO",0

Lbl 0

ClrText

Locate 4,4,"THANK YOU"


↓ and $ are found in the CHAR menu.  






Have fun,


Eddie 


All original content copyright, © 2011-2023.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Monday, August 23, 2021

Nuwmorks: Three Doors Game

Nuwmorks: Three Doors Game


Happy Monday!


Introduction


In the popular game show Let's Make a Deal, there is a final round called the Big Deal.  In the Big Deal, one or two contestants picked from one of three doors.   One door had the "Big Deal" containing the biggest prize.  


This game simulates a modified round of the Big Deal.  You are tasked of choosing one of three doors, and the doors contain:


*  $5,000 (not a real contest, this is for gaming purposes)

*  A car

*  A goat 


Numworks Python Script: thedoorgame.py


https://my.numworks.com/python/ews31415/thedoorgame


Required modules:  math, random, kandinsky, ion


# 2021-08-05 EWS

# Three Door Game

# based on Lets Make A Deal

from math import *

from random import *

from kandinsky import *

from ion import *


# set up the key function

def key():

  while True:

    if keydown(KEY_ONE):

      return 1

    if keydown(KEY_TWO):

      return 2

    if keydown(KEY_THREE):

      return 3


# initial doors: indigo, fir green, orange

fill_rect(40,15,100,75,color(43,43,95))

fill_rect(140,15,200,75,color(34,139,34))

fill_rect(240,15,300,75,color(255,127,0))

# text, wheat

draw_string("1",70,45,color(245,222,179),color(43,43,95))

draw_string("2",170,45,color(245,222,179),color(34,139,34))

draw_string("3",270,45,color(245,222,179),color(255,127,0))

# prize setup

p=["\u0024 5,000","CAR","GOAT"]

l=[0,1,2]

w=[]

for i in range(3):

  a=choice(l)

  w.append(a)

  l.remove(a)

# ask for a door

draw_string("Which door do you want?",40,120,color(0,0,0))

k=key()

if k==1:

  ps=p[w[0]]

if k==2:

  ps=p[w[1]]

if k==3:

  ps=p[w[2]]

# the reveal

fill_rect(40,15,100,75,color(0,0,0))

fill_rect(140,15,200,75,color(0,0,0))

fill_rect(240,15,300,75,color(0,0,0))

# text, wheat

draw_string(p[w[0]],45,45,color(245,222,179),color(0,0,0))

draw_string(p[w[1]],145,45,color(245,222,179),color(0,0,0))

draw_string(p[w[2]],245,45,color(245,222,179),color(0,0,0))

draw_string("You win: "+ps,40,160,color(0,0,0))


Download the Python file here:  https://drive.google.com/file/d/1yR8bBqmFwOeKZqBSgCVnoQkUcqDZzvu6/view?usp=sharing


Good luck!


Eddie


All original content copyright, © 2011-2021.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Monday, August 9, 2021

Numworks: Finding a Numeric Target Game

Numworks:  Finding a Numeric Target Game


Happy Monday!


Introduction


The Python script target.py is a game where the player is tasked to guess a mystery number.   The game has four levels:


Level 0:  Easy.  Range of 50, number between 100 and 999.

Level 1:  Medium.  Range of 100, number is between 1,000 and 9,999.

Level 2:  Difficult.  Range of 250, number is between 10,000 and 99,999. 

Level 3:  Challenge.  Range of 500, numbers if between 100,000 and 999,999.


After each guess you will be told whether the target is higher or lower than your guess.   At the beginning you are given a range where your target number is.


Trick:  I fit a quartic curve to the points (0,50), (1,100), (2,250), and (3,500) and Numworks came up with y = 50*x^2 + 50.   


The script page on my Numwork's account is here:  https://my.numworks.com/python/ews31415/target


Numworks Python Script: target.py


from math import *

from random import *

# 2021-08-03 EWS

# target finding game


# set up

print("**** TARGET ****")

print(" EWS 2021")

print(" ")

print("SELECT MODE")

print("0. EASY")

print("1. MEDIUM")

print("2. DIFFICULT")

print("3. CHALLENGE")

c=int(input())


# variables

# range

r=50*c**2+50

# lower limit

x=10**(c+2)

# upper limit

y=10**(c+3)-1

# score

s=0

# target, limits

t=randint(x+r,y-r)

lx=t-r

ly=t+r


# the game

g=-1

print("The target is between")

print(str(lx)+" and "+str(ly)+".")


while g!=t:

  s+=1

  g=int(input("Guess "+str(s)+"? "))

  if g>t:

    print("LOWER")

  else:

    print("HIGHER")

  

print(str(g)+" is the target!")

print("Your score is: "+str(s))


Good luck!  


Testing News


According to their website, numworks.com the Numworks calculator is now permitted for SAT, AP, PSAT, and ACT.  Click here for more information:  https://www.numworks.com/calculator/exams/

Note: Some Python Scripts can be Transferred to Different Calculators as is - Check the modules!  

You can download the Python file here.   I was able to transfer the file to a TI-84 Plus CE Python and it runs fine.  Because of the modules used, it should be able to run on any calculator with Python.  Please be aware that the calculator must have the modules installed before attempting to transfer Python scripts between different kinds of calculators.  

Link:  https://drive.google.com/file/d/1g2JjxkeKbk14Pm-qZR_LdW-0B4_BcZik/view?usp=sharing

Eddie


All original content copyright, © 2011-2021.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Sunday, March 14, 2021

Retro Review: Radio Shack EC-21 (Blackjack Calculator)

Retro Review: Radio Shack EC-21 (Blackjack Calculator) 







Welcome to my birthday blog.  44 years today (March 14, 1977).  

Quick Facts:

Models:  EC-21
Company:  Radio Shack
First Manufactured: 1978
Memory Register:  1 independent memory
Battery:  3 AAA

The Calculator and The Game

The Radio Shack EC-21 is a dual-purpose calculator:  a 10-digit calculator and full blackjack game.

The Calculator

The calculator is a 10 digit, four function calculator with something extra:  a parenthesis [ ( ) ] key.   The parenthesis key allows the user to put certain calculations in higher priority.   The calculator operates in chain mode, the order of operations is not taken into consideration.

Example:  

2 x (3 + 9) = 24

Keystrokes:  2 [ x ] [ ( ) ] 3 [ + ] 9 [ ( ) ] [ = ]

The calculator has a square root function, but it does not have a memory register.

The Game:  Blackjack

In GAME mode, the EC-21 is a one player blackjack game.  It is you against the house.  The house stands on 17 - 21.   

Enter a bet and press the [ √ ] (BET) key.   You are not limited in bankroll.  Once you place the bet, the screen shows all zeroes as the calculator shuffles a deck of 52 playing cards.  Kings, queens, jacks, and tens are shown on the display as an F (face card).  Aces, shown by an A, count as either 1 or 11.  The ace is counted to the player's best benefit.  

If you get a blackjack (Ace and a Face card) you automatically win, the payout is 3:2.  

The game keys are:

[ = ] (HIT): Hit: The player takes a hit.  Be careful, going over 21 will cause you to bust and lose the game.

[ - ] (INS):  Insurance:  If the Dealer's up card is an Ace, you can take insurance, which is half of your bet.  If you take Insurance and the Dealer has a blackjack (Ace and a Face card), you lose only half your bet.

[ + ] (STD):  Stand.   Press this key when you decide to take no more cards.

[ ÷ ] (SPL):  Split.  If you are dealt a pair, you can split your cards into two hands.  If you split aces, you only get one more card per ace.   In this case, any 21 pays off at 1:1.  

[ × ] (DBL):  Double Down.  If you have strong starting hand, such as a 10 or 11 against a Dealer's favorable up card, you can double your bet for one more card.  

After each hand, press the total key ( [ ( ) ] (TOL) ) to check your earnings.  

Keyboard

The keyboard has a solid feel.  However, the keys require a firm press to register.  I have the best luck of holding the calculator in my hand.  In my experience, laying the keyboard down flat did not allow me to register all the keys, particular the zero key.  If wish the keys were not hard to press.  It may be the luck of the draw when I made the purchase. 

I love the colors:  green for the number keys, red of the clear keys, blue for the function keys.  

Verdict

The calculator is stored in a beautiful leather case, and the green display is awesome.  I also like the two-in-one calculator/game.  I wish the keyboard is better, but buying it is not expensive, and I am happy to have this in my collection.  

Source:

Flow Simulation, Ltd.  "Radio Shack EC-21 (Blackjack 21)"  Retrieved January 22, 2021.  https://americanhistory.si.edu/collections/search/object/nmah_334462 

National Museum of American History Behring Center.  "Radio Shack EC-21 Handheld Electronic Calculator, Blackjack"  Washington D.C. Retrieved January 23, 2021.  https://americanhistory.si.edu/collections/search/object/nmah_334462

Eddie

All original content copyright, © 2011-2021.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 

Tuesday, March 24, 2020

Puzzle and Games: Guess The Digit

Puzzle and Games:  Guess The Digit 

Here's a game that you can play with students or to sharpen your wits.   I will let you figure out the solution and how you tackle these puzzles is up to you.

Each of the blanks, ____, needs a digit, from 0 to 9.  One of the digits fills in all the blanks in the puzzle.

Have fun!

Easy Level: One Blank

Example:  ___2 + 15 = 47

The missing digit is 3, since 32 + 15 = 47

3___ + 50 = 82 9___ + 27 = 120

___8 + 36 = 94 40 + 5___ = 97

__0 + 82 = 112 ___9 + 33 = 52

5___ + 48 = 104 42 + 3___ = 78

28 + 7___ = 103 52__ + 33 = 559

1__4 + 37 = 221 380 + __7 = 437

Medium Level: Two Blanks

Example:  8___ + ___6 = 119

Answer:  3, since 83 + 36 = 119


5__  + ___8 = 80 ___6 + ___4 = 150

8__ + ___1 = 136 7___ + 3___ = 116

5___ + ___3 = 64 ___8 + ___7 = 55

4___ + ___3 = 98 8___ + 3___ = 124

___8 + 3__ = 137 1__5 + __3 = 248

__4__ + 88 = 330 __43 + __6 = 819

7__3 + 1__6 = 969 45___ + 5__6 = 956

3__8 + __62 = 480 45___ + __45 = 798

51__ + 36___ = 878 4__8 + 38__ = 810


Harder Level: Three Blanks

4__ + 5__ + __2 = 128 5__ + __6 + 3__ = 98

3__ + __4 + __7 = 146 8__ + __5 + __3 = 172

5__ + __3 + __ 5 = 226 4__ + 5___ + 6__ = 159

__4 + __7 + ___0 = 281 __50 + 3__ + 4__ = 732

__4__ + 50___ = 846 __3___ + __6 = 147

__8__ + 5__ = 742 51__ + __6__ = 876


Eddie

All original content copyright, © 2011-2020.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Thursday, March 19, 2020

Puzzle and Games: Guess the Operation

Puzzle:  Guess The Operation

Everyone, please stay safe, sane, and most importantly, healthy.  We are in unprecedented times.  My blessings to all of you, always.

Blog entries will continue to be published every Saturday and Sunday, and most Fridays, through the end of April.  I will be working on content for May soon.

Here's a game that you can play with students or to sharpen your wits.   I will let you figure out the solution and how you tackle these puzzles is up to you.

Each of the blanks, ____, needs an arithmetic operation:

+   add
-    subtract
×   multiply
÷   divide

Have fun!

Easy Level

Example:  82 ____ 24 = 1968

Fill in the box by either +, -, ×, or ÷. 

Answer:  82 × 24 = 1968

Try these puzzles:

12 ____ 38 = 50 1334 ____ 58 = 23

425 ____ 25 = 17 27 ____ 15 = 405

68 ____ 46 = 22 631 ____ 399 = 1030

108 ____ 34 = 142 1200 ____ 750 = 450

Medium Level

Example:  49 ____ 58 ____ 20 = 87

Answer:  49 + 58 - 20 = 87

Hint:
The answer for the first box is either:  +, -, ×, ÷
The answer for the second box is either: +, -

Try these puzzles:

45 ____ 52 ____ 36 = 133 51 ____ 16 ____ 36 = 852

208 ____ 34 ____ 102 = 72 18 ____ 24 ____ 58 = 100

5 ____ 8 ____ 6 = 46 500 ____ 100 ____ 300 = 305

11 ____ 3 ____ 9 = 24 764 ____ 195 ____ 420 = 989

52 ____ 49 ____ 68 = 71 44 ____ 28 ____ 250 = 982

399 ____ 3 ____ 15 = 148 582 ____ 6 ____ 50 = 47

Harder Level

Good luck and happy solving.

Hint:  In this level, the choice of operations are +, -, ×

61 ____ 49 ____ 36 ____ 50 = 24

58 ____ 76 ____ 34 ____ 53 = 4495

99 ____ 39 ____ 49 ____ 59 = 50

88 ____ 76 ____ 46 ____ 50 = 6684

63 ____ 26 ____ 100 ____ 305 = 1433

402 ____ 118 ____ 386 ____ 453 = 217

153 ____ 38 ____ 500 ____ 205 = 5109


Eddie

All original content copyright, © 2011-2020.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Saturday, July 13, 2019

TI-84 Plus and Casio fx-CG50: Which Die Wins?

TI-84 Plus and Casio fx-CG50: Which Die Wins?

Introduction:  Which Die Wins? 

The program DICEODDS compares a pair of dice against each other.  Each die, having values on its six faces and a different distribution of those values, is rolled against each other.  The program determines which die has a better chance of winning.

The face of each die can have any value, and values can repeat.  These dice can and usually are  different from the standard dice (1, 2, 3, 4, 5, 6).

Example 1:

Die 1 is your standard die:  {1, 2, 3, 4, 5, 6}
However, Die 2 has all threes:  {3, 3, 3, 3, 3, 3}

If we roll Die 1 against Die 2, Die 1 wins if a 4, 5, or 6 is rolled.  The odds of Die 1 having a higher value is 1/2. 

Example 2:

Die 1:  {3, 3, 3, 4, 4, 4}
Die 2: {2, 2, 2, 2, 7, 7}

Die 1 wins when a 2 is rolled on Die 2, which occurs 4/6 or 2/3 of the time.  If a 7 is rolled from Die 2, then Die 2 wins, and this has a probability of 1/3. 

DICEODDS compares each value of Die 1 against Die 2 on a single roll of each die.

This is an idea based on a article from James Grime, mathematician who is part of Numberphile. (see Source below)  Numberphile has a YouTube channel which discusses mathematics.   

Grime starts the article by presenting a game where two players choose one of three dies.  The red die has five 3s and one 6, the blue die has three 2s and three 5s, and the olive has one 1 and five 4s.  By comparing dies against each other, the red has a better chance of winning over blue, the blue has better chance of winning over olive, and olive has a better chance of winning over red.  It happens that the dice in this game represent paper-rock-scissors.

Grime also covers games where a chosen die is rolled twice during a game.  There is Efron Dice, a game involving choosing one of four dice (all 3s, half 0s and half 4s, half 1s and half 5s, half 2s and half 6s).  Grime also presents a game involving five dice, each die with an equal chance of winning. 

Dice are considered to be non-transitive when in a game of comparing dice, no die is dominant.

Running DICEODDS

DICEODDS compares two dice on a single role and their probability of winning.  The user is allowed to either enter their own values or generate two random dice, with values ranging from 0 to 9.  Values can repeat, and if you want, do not have to be positive integers.  The screen shots below are from the Casio fx-CG50 version of DICEODDS. 




TI-84 Plus Program DICEODDS

"2019-06-03 EWS"
Menu("WHICH DIE WINS?","RANDOM DICE",1,"ENTER DICE",2)
Lbl 1
seq(randInt(0,9),X,1,6)→L₁
seq(randInt(0,9),X,1,6)→L₂
Goto 3
Lbl 2
Disp "ENTER DIE OF 6 VALUES"
Input "DIE 1: ",L₁
Input "DIE 2: ",L₂
Lbl 3
0→P
For(I,1,6)
sum(L₁(I)>L₂)/6*1/6→F
P+F→P
End
ClrHome
Disp "DIE 1,2",L₁,L₂,"ODDS DIE 1 WINS",P▶Frac,"ODDS DIE 2 WINS",(1-P)▶Frac

Casio fx-CG50 Program DICEODDS - (text file format)

'ProgramMode:RUN
"2019-06-04 EWS"
Menu "WHICH DIE WINS?","RANDOM DICE",1,"ENTER DICE",2
Lbl 1
6->Dim List 1
6->Dim List 2
For 1->I To 6
RanInt#(0,9)->List 1[I]
RanInt#(0,9)->List 2[I]
Next
Goto 3
Lbl 2
"ENTER DIE: 6 VALUES"
"DIE 1:"?->List 1
"DIE 2:"?->List 2
Lbl 3
0->P
For 1->I To 6
Sum (List 1[I]>List 2)/6*1/6->F
P+F->P
Next

ClrText
Red Locate 1,1,"DIE 1:"
Blue Locate 1,2,"DIE 2:"
For 1->I To 6
6+2*I->J
Red Locate J,1,List 1[I]
Blue Locate J,2,List 2[I]
Next
Locate 1,4,"ODDS DIE 1 WINS:"
Red Locate 1,5,P
Locate 1,6,"ODDS DIE 2 WINS:"
Blue Locate 1,7,1-P

Source:

Grime, James "The Bizzare World of Nontransitive Dice: Games for Two or More Players" from:
Pritici, Micrcea (editor) "The Best Writing on Mathematics 2018"  Princeton University Press: Princeton, NJ.  2019  ISBN 978-0-691-18276-6

The article can also be found on the web:  https://singingbanana.com/dice/article.htm
(Retrieved June 5, 2019)

Eddie

All original content copyright, © 2011-2019.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Spotlight: Calculated Industries QR Calc

Spotlight: Calculated Industries QR Calc <Title> Quick Facts Model: 3375 Name: QR Calc Company: Calculated Industries ...