Saturday, November 13, 2021

TI-92 Plus: Solving Problems Step by Step

 TI-92 Plus:  Solving Problems Step by Step


This program should work with the TI-89 family (TI-89, TI-89 Titanium, Voyage 200).  





Some CAS Tricks Used


With the help of the TI-89/92 Plus manual and adding restrictions with the with ( | ) command:


ln(x^y) | x>0 and y>0 returns x


expand(ln(x∙y)) | x>0 and y>0 returns ln(x)+ln(y)


sin^-1(sin(x)) | x≥-π/2 and x≤π/2 returns x


tan^-1(tan(x)) | x≥-π/2 and x≤π/2 returns

(mod(2∙x-π,2∙π)/2) - π/2


√(x^2) | x≥0 returns x


Also, the part command can be used to pick out parts of an equation or expression.  Using left and right can extract sides of an equation.


Example:


left(2∙x+5 = 3∙y) returns 2∙x+5


right(2∙x+5 = 3∙y) returns 3∙y


TI-92 Plus Program: steps


The equations offered in this program are:


a∙x+c = b

a∙x+b = c∙x+d

a∙x^2 + c = b

y = a∙b^x

√(a∙x+c) = b∙x+d

x^2+(2∙a)∙x = b

1/x+1/a = 1/b

sin(a∙x)∙cos(a∙x) = b



Click on the picture below for the code:




Or you can download the file (.9xf) here:


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



Take care,


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, November 8, 2021

Derivatives with Surprisingly Imaginary Results

Derivatives with Surprisingly Imaginary Results



Here are three derivatives of functions where complex numbers are involved with further algebraic simplification.  




d/dx √(a - x)^(1/2)



d/dx √(a- x)^(1/2)


= 1/2 ∙ (a - x)^(-1/2) ∙ -1


= -1/2 ∙ 1 ÷ (√(a - x))


Going a step further...


= -1/2 ∙ 1 ÷ (√(-1) ∙ √(x - a))


With √(-1) = i ,  1/i = -i


= i ÷ (2 ∙ √(x - a))



d/dx  arcsin(x + a)



d/dx arcsin(x + a)


= 1 ÷ √(1 - (x + a)^2)


= 1 ÷ √(1 - (x^2 + 2 ∙ a ∙ x + a^2))


= 1 ÷ √(-x^2 - 2 ∙ a ∙ x + 1 - a^2)


Factoring out -1 in the denominator: 


= 1 ÷ √((-1) ∙ (x^2 + 2 ∙ a ∙ x - 1 + a^2))


= 1 ÷ (i ∙ √(x^2 + 2 ∙ a ∙ x - 1 + a^2))


= -i ÷ √(x^2 + 2 ∙ a ∙ x - 1 + a^2)



d/dx e^(√(a - x)) 



d/dx e^(√(a - x)) 


= e^(√(a - x)) ∙ d/dx √(a - x)


= -e^(√(a - x)) ÷ (2 ∙ √(a - x))


With:  √(a - x) = i ∙ √(x - a) and e^(i ∙ Θ) = cos Θ + i ∙ sin Θ


= -e^(i ∙ √(x - a)) ÷ (2 ∙ i ∙ √(x - a))


= -e^(i ∙ √(x - a)) ÷ (2 ∙ i ∙ √(x - a))


=  i ∙ e^(i ∙ √(x - a)) ÷ (2 ∙ √(x - a))


= (i ∙ (cos √(x - a) + i ∙ sin √(x - a)) ÷ (2 ∙ √(x - a))


= (-sin √(x - a) + i ∙cos √(x - a)) ÷ (2 ∙ √(x - a))




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, November 7, 2021

Solving Equations with Radicals and Extraneous Solutions

Solving Equations with Radicals and Extraneous Solutions 


Introduction 


For equations such as:


x^2 = a 


Solving for x requires us to take the root of both sides with the solutions:


x = +a and x = -a.   


However when have something in the form of:


√(f(x)) = a


we can take the square of both sides and solve for x.


f(x) = a^2


Sometimes our solutions of x may not work out.  This is where we run into the case of extraneous solutions.  


What is an extraneous solution? This is a solution that may appear to be a valid solution by solving an equation through valid methods, but the catch is that this solution does not solve the equation.   Think of an extraneous solution as a "false solution".  We are going to see some examples in the next section. 


Principal Square Root


When we refer to the square root of a number, most of the time we are referring to the principal square root.   That is, the principal square root only refers to the non-negative square root.  


Example:  The principal square root of 256 is:

√256 = 16


Calculators use the principal square root for their square root function.  


Example Problems where Extraneous Solutions May Exist


In all the examples, √ is used for the principal square root.  In fact, unless when specified, the √ symbol will always refer to the principal square root.   Other root operators, such as cube root and quartic root, will operating the same way. 


Example 1:

x - 3 = √(3x - 9)


Start by squaring both sides: 

x^2 - 6x + 9 = 3x - 9


Subtract (3x - 9) from both sides:

x^2 - 9x + 18 = 0


The left side can be factored into:

(x - 6)(x - 3) = 0


Giving potential solutions of:

x = 6 and x = 3.


Checking both solutions:

x = 6:   6 - 3 = 3;  √(6*3 - 9) = 3

x = 3:   3 - 3 = 0;  √(3*3 - 9) = 0


In this first case, both solutions, x = 3 and x = 6, are valid.


Example 2:

√(5x - 1) + 7 = 3


An attempt to solve for x:

√(5x - 1) = -4

5x - 1 = 16

5x = 17

x = 17/5


But checking for when x = 17/5:


√(5 * 17/5 - 1) + 7 = √(16) + 7 = 11 ≠ 3


In this case, x = 17/5 is an extraneous solution, and does not solve the equation.  


Example 3:

x + √(4x + 1) = 5


An attempt to solve for x:

√(4x + 1) = 5 - x

4x + 1 = 25 - 10x + x^2

0 = 24 -14x + x^2

0 = (x - 2)(x - 12)


Possible solutions:  x = 2, x = 12


Checking:

x = 2:  2 + √(4*2 + 1) = 2 + √(9) = 5

x = 12:  12 + √(4*12 + 1) = 12 + √(49) = 19 ≠ 5


Hence only x = 2 is a true solution, as x = 12 is extraneous.


The bottom line: when solving equations involving radicals and roots, it is best to check your answers.  This is not a good practice in school, but in life.  


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. 


Saturday, November 6, 2021

TI-92 Plus and TI-Nspire CX II: List Filters

TI-92 Plus and TI-Nspire CX II:  List Filters




For this particular post, I also have a TI-Nspire CX II CAS document which can be downloaded here:  https://drive.google.com/file/d/1Rm5vIWdUMg5OEyXi4VecNfuIGdiGRtan/view?usp=sharing


The functions are public and are available in the catalog.  Examples and syntax are included.  


The Filters


filters(list, criteria): filters out a list 

sumfilt(list, criteria): sum of selected elements of a list

avgfilt(list, criteria): arithmetic average of elements of a list

prdlist(list, criteria): product of selected elements of a list

dimfilt(list, criteria): returns a count of list elements that fit a criteria


This is similar to Excel functions filter, sumifs, averagefits, and countifs; there is no productifs in Excel.  


The criteria is a string, using x as a variable.  Examples:

"x<10": select elements less than 10

"x≥20": select elements greater than or equal to 20

"10<x and x<20": select elements between 10 and 20, not including 10 or 20

"10≤x and x≤20": select elements between 10 and 20, including 10 or 20


TI-92 Plus Functions: Filters


Note:  I am using the symbol [| for comment; in the program editor, select F2, option 9.  


TI-92 Plus Function:  filters


filters(list1,cr) 

Func

[| list, criteria string with x

[| EWS 2021-08-13

[| filter function

Local list2,d,i,t,x

{}→list2

dim(list1)→d

For i,1,d

expr(cr)|x=list1[i]→t

If t Then

augment(list2,{list1[i]})→list2

EndIf

EndFor

Return list2

EndFunc


TI-92 Plus Function: sumfilt


sumfilt(list1,cr) 

Func

[| list, criteria string with x

[| EWS 2021-08-14

[| sum-if filter function

Local list2,d,i,t,x

{}→list2

dim(list1)→d

For i,1,d

expr(cr)|x=list1[i]→t

If t Then

augment(list2,{list1[i]})→list2

EndIf

EndFor

Return sum(list2)

EndFunc


TI-92 Plus Function: avgfilt


avgfilt(list1,cr) 

Func

[| list, criteria string with x

[| EWS 2021-08-14

[| average-if filter function

Local list2,d,i,t,x

{}→list2

dim(list1)→d

For i,1,d

expr(cr)|x=list1[i]→t

If t Then

augment(list2,{list1[i]})→list2

EndIf

EndFor

Return sum(list2)/(dim(list2))

EndFunc


TI-92 Plus Function:  prdfilt


prdfilt(list1,cr) 

Func

[| list, criteria string with x

[| EWS 2021-08-14

[| product-if filter function

Local list2,d,i,t,x

{}→list2

dim(list1)→d

For i,1,d

expr(cr)|x=list1[i]→t

If t Then

augment(list2,{list1[i]})→list2

EndIf

EndFor

Return product(list2)

EndFunc


TI-92 Plus Function:  dimfilt


dimflt(list1,cr) 

Func

[| list, criteria string with x

[| EWS 2021-08-13

[| count-if filter function

Local list2,d,i,t,x

{}→list2

dim(list1)→d

For i,1,d

expr(cr)|x=list1[i]→t

If t Then

augment(list2,{list1[i]})→list2

EndIf

EndFor

Return dim(list2)

EndFunc


Examples:


list0 = {2,4,5,6,9,10,11,13,14,15,18}


filters(list0,"x≤10"):  {2,4,5,6,9}

filters(list0,"5≤x and x≤15"):  {5,6,9,10,11,13,14,15}


sumfilt(list0,"x≤10"):  36

sumfilt(list0,"5≤x and x≤15"):  83


avgfilt(list0,"x≤10"):  6

avgfilt(list0,"5≤x and x≤15"):  83/8


prdfilt(list0,"x≤10"):  21600

prdfilt(list0,"5≤x and x≤15"):  2700


dimfilt(list0,"x≤10"):  6

dimfilt(list0,"5≤x and x≤15"):  8


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, October 31, 2021

Happy Halloween: Belphagor's Prime and Triple Digit Integers

 Happy Halloween: Belphagor's Prime and Triple Digit Integers


Greetings everyone.  And a very Happy Halloween to you, hopefully you are all celebrating, having a great time, staying safe and sane.   


Today, I'm going there, talking about a number with a very dark and evil repetition, better known to religions as the "number of the beast":  six hundred and sixty six.  And to try to balance things out, I'm also going to be talking about a holy number.  


A Prime Evil:  Belphegor's Prime - Starring the Triple Six 


Belphegor's Prime is a large palindrome number:


1000000000000066600000000000001


that has three sixes in the middle of 13 zeroes on other side enclosed by a 1.  A two for one deal, not only the number of the beast but also the presence of a number with a unlucky repetition, 13.  Engineer and mathematician Harvey Dubner determined this monster of a number to be a prime integer.   However, the number received its nefarious name from well-known mathematics and science author Cliff Pickover.   


Who is Belphegor?   In religion, Belphegor is a prince of Hell, whose purpose in demonhood was to trick people into discovery (with a heavy price attached).  


Other connections to the infamous triple six include:


* The sum of the integers 1 to 36.  


* Multiply 2/3 by 1000 and take the integer part (without rounding) to get this number.


*  The triple six can be written has every roman numeral less than 1,000.  


*  It make can property very valuable, such as 666 5th Ave in New York City selling for a then record $1.8 billion, only to be changed to 660 5th Ave sometime later.  

 


Triple Digit Integers - The Glory of Triple Seven


Triple sixes aren't the only number to receive a mythological, metaphysical, or religious repetition.   


For instance, triple sevens, 777, is said to be a very heavenly number.  In Christianity, 777 represents the perfection of Trinity, made up of the Father, Son (Jesus Christ), and the Holy Spirit.  


Maybe the prime factorization of 777, 3 × 7 × 37, is what lead Judaism to declare the numbers 3 and 7 to be "perfect".


Finally, 777 is what brings much happiness to slot players. If you have been a casino, you know why. 


In numerology, triple numbers are promoted to have significance in the new age religion.  111, 222, 333, and so on, are given various meanings depending on the new age writer.  111 and its four digit number "relative", 1111, are very popular in the new age industry, often suggesting completion, oneness with the universe, and positive attraction thoughts. 


Generating Triple Digit Palindrome Numbers


You can generate integers 1 [ n number of zeros ] ddd [ n number of zeroes ] 1, where d is the digit 0 through 9 through the following formula:


10^(2n+4) + d × 111 × 10^(n+1) + 1


Examples:


n = 1, d = 9:   1099901


n = 2, d = 2:   100222001


n = 3, d = 3:   10003330001



No guarantees that the integer you get is prime.  Use at your own risk.  


Sources:


Grundhauser, Eric.  "How a Mathematician Turned an Obscure Number Into a Scary Story"  Atlas Obscura.  August 23, 2016.   Accessed August 1, 2021.  https://www.atlasobscura.com/articles/how-a-mathematician-turned-an-obscure-number-into-a-scary-story


"660 Fifth Avenue".  Wikipedia Last Edited. August 11, 2021.  Accessed August 11, 2021.  https://en.wikipedia.org/wiki/660_Fifth_Avenue


"666 (number)" Wikipedia.  Last Edited July 31, 2021.  Accessed August 9, 2021.  https://en.wikipedia.org/wiki/666_(number)


"777 (number)" Wikipedia.  Last Edited August 6, 2021.  Accessed August 9, 2021. https://en.wikipedia.org/wiki/777_(number)


Three very infamous tarot cards: The Tower, The Devil, Death.  (Gilded Tarot Deck - Ciro Marchetti)

Happy Halloween,


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. 


Saturday, October 30, 2021

Swiss Micros DM41X and HP 41CX: Advanced String Programs

Swiss Micros DM41X and HP 41CX:  Advanced String Programs





Introduction and Generating Random Integers


This blog entry features three programs for the Swiss Micros DM41X and HP 41CX (or a HP 41C with an extended module):


ACODE:  generate a code of random letters


ASAMP:  generate a sample of numbers of digits 0 to 9, where no numbers repeat.  ASAMP accepts up to 9 numbers.   


CRYPT:  allows the user to "add" or "subtract" a code to a word to encrypt it.   CRYPT is a basic form of encryption.   


Both ACODE and ASAMP use a random number generator.  Unfortunately, the HP 41C does not have a random number generator and one must be programmed.  I wanted to avoid reinventing the wheel.   The following formula, obtained from the book An Atlas of Functions (see source), generates random numbers of value 0 ≤ r < 1:


r_n+1 = [ ( (4561 * int(243000 * r_n) + 51349 ) mod 243000 ] ÷ 243000


To convert this into a random integer from a to b: 


randint = int( (b - a + 1) * r) + a


int is the integer function.   The second formula is useful because we don't have to change display modes to execute the calculation.  


Note:


XTOA takes an integer from the stack and appends the associated code to the alpha string.


ATOX takes the left most character, converts it to code, and deposits it on the X stack.  The length of the alpha string is reduced by one.


Codes:

Alphabet:  65 is code for A, 90 is code for Z (all letters inclusive)

Numbers:  48 is code for 0, 57 is code for 57 (all letters inclusive)

# 35

$  36

%  37

&  38

:  58

@  64

[  91

]  93

Σ 126


The system's DATE and TIME are used to generate an initial seed


Swiss Micros DM41X Program:  ACODE


Instructions:

Enter the length, execute ACODE


Example (results will vary):

10 ACODE (may) return CDSJHPNWLD  (10 letters)

11 ACODE -> NVJZJMVVBSV


01 LBL^T ACODE

02 CLA

03 STO 01

04 DATE

05 TIME

06 +

07 2

08 /

09 FRC

10 STO 02

11 LBL 00

12 RCL 02

13 XEQ 01

14 XEQ 02

15 XTOA

16 DSE 01

17 GTO 00

18 AVIEW

19 RTN

20 LBL 01

21 RCL 02

22 243 E3

23 *

24 LASTX

25 X<>Y

26 INT

27 4561

28 *

29 51349

30 +

31 X<>Y

32 MOD

33 LASTX

34 /

35 STO 02

36 RTN

37 LBL 02

38 26

39 *

40 INT

41 65

42 +

43 RTN

44 END


Swiss Micros DM41X Program: ASAMP


Instructions:

Enter the length, execute ASAMP


If the length is greater than 9, an error is generated.  


Example (results will vary):

4 ASAMP can generate results such as 4381, 0361, 4920

7 ASAMP can generate results such as 6732145, 9852067, 1963542

 

Results are returned as an alpha string


01 LBL^T ASAMP

02 CLA

03 STO 01

04 9

05 X<Y?

06 GTO 03

07 DATE

08 TIME

09 *

10 FRC

11 STO 02

12 LBL 00

13 XEQ 01

14 STO 03

15 POSA

16 -1

17 X=Y?

18 GTO 02

19 GTO 00

20 LBL 02

21 RCL 03

22 XTOA 

23 DSE 01

24 GTO 00

25 AVIEW

26 RTN

27 LBL 01

28 RCL 02

29 243 E3

30 *

31 LASTX

32 X<>Y

33 INT

34 4561

35 *

36 51349

37 +

38 X<>Y

39 MOD

40 LASTX

41 / 

42 STO 02

43 10

44 *

45 INT

46 48

47 +

48 RTN

49 LBL 03

50 0

51 1/X

52 RTN

53 END


Swiss Micros DM41X Program:  CRYPT


Syntax:

Store your word in the Alpha register

Give a key (integer), can be positive or negative

XEQ CRYPT


Example:

Starting alpha string:  MATHS

10 CRYPT returns WKDRC

-10 CRYPT returns MATHS (where you started from)

This allows for two people to have short encoded messages and a secret key.


01 LBL^T CRYPT

02 STO 01

03 ALENG

04 STO 02

05 LBL 00

06 ATOX

07 65

08 - 

09 RCL 01

10 +

11 26

12 MOD

13 65

14 + 

15 XTOA

16 DSE 02

17 GTO 00

18 AVIEW

19 RTN 


You can download all three files (in .raw format) here:  

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


Thanks to Albert Chan (MoHPC) for feedback on the the programs.  



Source for the Random Number Formula:


Keith Oldham, Jan Mayland,  Jerome Spainer  An Atlas of Functions 2nd Edition Springer:  New York, NY.  2009.  ISBN 9780387488066


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, October 24, 2021

Swiss Micros DM41X: Health Calculations

 Swiss Micros DM41X: Health Calculations




These programs also apply to the HP 41C or almost any emulator.  I don't believe that you will need the Extended Functions Module for these programs.  


Mean Arterial Pressure


Generally, when we take our blood pressure we get a ratio:  systolic blood pressure over diastolic blood pressure.   The Mean Arterial Pressure (MAP) can  be calculated by the following formula:


MAP = (Systolic BP + 2 × Diastolic BP) ÷ 3


Example:

Systolic BP = 124

Diastolic BP = 86


Result:  MAP ≈ 98.6667


Swiss Micros DM41X Program:  MAP


01 LBL^T MAP

02 ^T SYS BP?

03 PROMPT

04 ^T DIA BP?

05 PROMPT 

06 2

07 *

08 +

09 3

10 /

11 ^T MAP = 

12 ARCL X

13 AVIEW

14 RTN


Source:

Lung, Johnny.   Respiratory Therapy Formulas and Calculations Respiratory Therapy Zone 2020


Body Surface Area:  The Mosteller Formula


There are several ways of calculating BSA (body surface area) which is used as a person's metabolic mass, which in turn is used in other clinical and respiratory calculations such as the cardiac output.  Several formulas to estimate BSA exist, including formulas from Haycock, Fujimoto, Body, Du Bois, and Mosteller.  The calculations depend on two factors:  the person's height in centimeters (cm), and the person's mass in kilograms (kg).    The BSA is measured in squared meters (m^2).


The Mosteller formula provides a simple calculation:


BSA ≈ √(mass × height) ÷ 60


The program presented will allow for U.S. units, as amounts are converted when necessary.  Using U.S. units, enter height in inches (in) and mass in pounds (lb).  The result will be in square feet (ft^2).


Conversions:

1 in = 2.54 cm

2.2406 lb ≈ 1 kg

1 m^2 ≈ 10.7639 ft^2


The program will prompt you "IN/LB? Y=1" if you want to use U.S. units, enter 1 then press [R/S] for yes, entering any other number then [R/S] defaults to SI units.  In U.S. units mode, flag 1 is turned on (there will be a 1 indicator on the screen). 


Examples:


Height = 70 in (5'10")

Mass = 240 lb

BSA ≈ 24.9589 ft^2


Height = 177.8 cm

Mass = 108.8622 kg

BSA ≈ 2.31874 m^2


Swiss Micros DM41X Program:  BSA


01 LBL^T BSA

02 CF 01

03 ^T IN/LB? Y=1

04 PROMPT

05 1

06 X=Y?

07 SF 01

08 ^T HEIGHT?

09 PROMPT

10 FS? 01

11 2.54

12 FS? 01

13 *

14 ^T WEIGHT?

15 PROMPT

16 FS? 01

17 2.2046

18 FS? 01

19 /

20 *

21 SQRT

22 60

23 /

24 ^T BSA=

25 AVIEW

26 PSE

27 PSE

28 FS? 01

29 10.7639

30 FS? 01

31 *

32 FS? 01

33 ^T FT^2:

34 FC? 01

35 ^T M^2:

36 ARCL X

37 AVIEW

38 CF 01

39 RTN


Source:

"Body Surface Area".  Wikipedia.  Edited July 22, 2021.  Accessed on August 9, 2021.  https://en.wikipedia.org/wiki/Body_surface_area


Cardiac Output with Fick's Equation


Given the following variables:


VO_2:  total oxygen consumption in L/min

CaO_2:  arterial oxygen content in ml/L

CvO_2:  venous oxygen content in ml/L

HR: heart rate (BPM)


The following can be calculated:


CO:  Cardiac Output in l/min


CO = (VO_2 × 100) ÷ ((CaO_2 - CvO-2) × 1000)


SV:  Stroke Volume in ml/beat


SV = (CO × 1000) ÷ HR


Example:

Inputs:

VO_2: 248 ml/min 

CaO_2:  22%  (enter 22)

CvO_2:  18% (enter 18)

HR: 84 BPM


Results:

CO = 6.2000 l/min

SV = 73.8095 ml/beat 


Swiss Micros DM41X Program:  FICK


01 LBL^T FICK

02 ^T VO.2?

03 PROMPT

04 ^T C.A 0.2 %?

05 PROMPT

06 ^T C.V 0.2 %?

07 PROMPT

08 - 

09 1000

10 *

11 /

12 100

13 *

14 STO 01

15 ^T CO = 

16 ARCL 01

17 AVIEW

18 STOP

19 1000

20 *

21 ^T HR?

22 PROMPT

23 /

24 STO 02

25 ^T SV =

26 ARCL 02

27 AVIEW

28 RTN


Sources:


"Fick Cardiac Output" HP 67/97 User's Library Solutions:  Cardiac.   Corvallis, OR.  1976.  pp. 20-23 https://literature.hpcalc.org/community/hp6797-ul-cardiac.pdf


"Fick's Cardiac of cardiac output measurement" Deranged Physiology.  Updated December 1, 2020.   Accessed August 9, 2021.  https://derangedphysiology.com/main/cicm-primary-exam/required-reading/cardiovascular-system/Chapter%20811/ficks-principle-cardiac-output-measurement


Download the .raw files here:  https://drive.google.com/file/d/1VJCkwSk9QpbBFsxoh6H0G8dRfAuuVU7j/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. 


Saturday, October 23, 2021

Swiss Micros DM41X and HP Prime: The Exit Game

Swiss Micros DM41X and HP Prime: The Exit Game





Introduction


We have two entities in an area:  A and B.   Unfortunately, that area isn't big enough for A and B to stay.  If both A and B stay, they suffer a loss (think economical loss, but it can apply to morality loss, emotional loss, etc.).   Neither A nor B want to leave and each of them want their opponent to leave instead.  


If A and B both leave, neither have any benefits from staying in the area.


The program EXTGAME/EXITGAME calculates four probabilities:


P(A):  probability A stays if A is indifferent of whether B stays or leaves


K_a =  G_a ÷ (G_a - L_a)


P(B):  probability B stays if B is indifferent of whether A stays or leaves


K_b =  G_b ÷ (G_b - L_b)


P(both):  probability that both A and B stay, given they are indifferent about what their opponent does


P(both) = K_a × K_b


P(neither):  probability that both leave, given they are indifferent about what their opponent does 


P(neither) = (1 - K_a) × (1 - K_b)



DM41X Program:  EXTGAME


01 LBL^T EXTGAME

02 ^T A LOSS?

03 PROMPT

04 STO 01

05 ^T A GAIN?

06 PROMPT

07 STO 02

08 ENTER

09 ENTER

10 RCL 01

11 -

12 /

13 STO 05

14 ^T P<A>=

15 ARCL 05

16 AVIEW

17 STOP

18 ^T B LOSS?

19 PROMPT

20 STO 03

21 ^T B GAIN?

22 PROMPT

23 STO 04

24 RCL 04

25 ENTER

26 ENTER

27 RCL 03

28 -

29 / 

30 STO 06

31 ^T P<B>=

32 ARCL 06

33 AVIEW

34 STOP

35 RCL 05

36 RCL 06

37 *

38 ^T P<BOTH>=

39 ARCL X

40 AVIEW

41 STOP

42 1

43 RCL 05

44 -

45 1

46 RCL 06 

47 -

48 *

49 ^T P<NONE>=

50 ARCL X

51 AVIEW 

52 END



HP Prime Program: EXITGAME


EXPORT EXITGAME()

BEGIN

// 2021-07-30 EWS

MSGBOX("Game of Chicken/Exit: Either A

 or B must leave or they both lose.");


LOCAL la,lb,ga,gb,ka,kb,m;


INPUT({la,ga},"A is indifferent",

{"Loss/B stays: ",

"Gain/B leaves: "});


INPUT({lb,gb},"B is indifferent",

{"Loss/A stays: ",

"Gain/A leaves: "}); 


ka:=ga/(ga-la);

kb:=gb/(gb-lb);


m:=[[la,lb,0,gb],[ga,0,0,0]]; 

  

PRINT();

PRINT("*** Matrix ***");

PRINT2D(m); 

PRINT("*** Results ***");

PRINT("---------------");

PRINT("Prob. A Stays: "+STRING(ka));

PRINT("Prob. B Stays: "+STRING(kb));

PRINT("Prob. Both Stays: "+

STRING(ka*kb));

PRINT("Prob. Both Leave: "+

STRING((1-ka)*(1-kb)));

  

END;



Example


Example:  For players A and B:


A is indifferent:

A's Loss if B Stays:  -45  (DM41X prompt:  A LOSS?)

A's Gain if B Leaves:  +50 (A GAIN?)


B is indifferent:

B's Loss if A Stays: -35 (B LOSS?)

B's Gain if A Leaves: +60 (B GAIN?)


Results:

Probability A Stays:  0.526315789474  (P<A>)

Probability B Stays:  0.631578947368 (P<B>)

Probability both A and B stay:  0.332409972299 (P<BOTH>)

Probability both A and B leave: 0.174515235457 (P<NONE>)






Source:

Ivan Pastine, Tuvana Pastine, Tom Humberstone.  Introducing Game Theory: A Graphic Guide Icon Books Ltd:  London, United Kingdom.  2017  ISBN 9781785780820


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, October 17, 2021

Σ(1 / (a^n)) from n=1 to m

 Σ(1 / (a^n)) from n=1 to m


This blog entry covers the sum of the series:


Σ[1 / (a^n), n=1 to m] with n and m positive integers


Specific Cases:  a = 2 and a = 3


When a = 2:


m = 1:   1/2


m = 2:   1/2 + 1/4  = (2 + 1)/4 = 3/4


m = 3:   1/2 + 1/4 + 1/8 = (4 + 2 + 1)/8 = 7/8


m = 4:   1/2 + 1/4 + 1/8 + 1/16 = (8 + 4 + 2 + 1)/16 = 15/16


Going from the pattern,


Σ[1 / (2^n), n=1 to m] = 1/(2^m) * Σ[(2^n), n=0 to m-1] = (2^m - 1) / 2^m 


When a = 3:


m = 1:  1/3


m = 2:  1/3 + 1/9  = (3 + 1)/9 = 4/9


m = 3:  1/3 + 1/9 + 1/27 = (9 + 3 + 1)/27 = 13/27


m = 4:  1/3 + 1/9 + 1/27 + 1/81 = (27 + 9 + 3 + 1)/81 = 40/81


Going from the pattern,


Σ[1 / (3^n), n=1 to m] = 1/(3^m) * Σ[(3^n), n=0 to m-1]



Finding the General Formula and Proof


Let's presume that, for any a:


Σ[1 / (a^n), n=1 to m-1] = 1/(a^(m-1) * Σ[(a^n), n=0 to m-2]


Let's add 1/(a^m) to the series:  


Σ[1 / (a^n), n=1 to m-1]  + 1/(a^m)


= (1 + a + a^2 + ... + a^(m-3) + a^(m-2)) / (a^(m-1)) + 1 / (a^m)


= (a * (1 + a + a^2 + ... + a^(m-3) + a^(m-2)) + 1) / (a^m)


= (a + a^2 + a^3 + ... + a^(m-2) + a^(m-1) + 1) / (a^m)


= 1/(a^(m)) * Σ[(a^n), n=0 to m-1]



The general formula is now: 


Σ[1 / (a^n), n=1 to m] = 1/(a^(m)) * Σ[(a^n), n=0 to m-1]


Until next time,


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. 


RPN HP 12C: Fibonacci and Lucas Sequences

  RPN HP 12C: Fibonacci and Lucas Sequences Golden Ratio, Formulas, and Sequences Let φ be the Golden Ratio: φ = (1 + √5) ÷ 2...