Showing posts with label TI-84 Plus CE. Show all posts
Showing posts with label TI-84 Plus CE. Show all posts

Saturday, April 25, 2026

TI-84 Plus CE: Beam Pattern for Uniform Array

TI-84 Plus CE: Beam Pattern for Uniform Array




Introduction



The following formula calculates an antenna’s normalized beam response in decibels given the following:



* the number of sensors of an antenna

* the wavelength of the beam pattern

* the angle incident of the wavelength from the ground, in degrees.

* the steering angle of the array, in degrees; which is measured from the zenith, starting directly upwards with the angle going downwards.



The program calculates the response in from a range of incident angles.



R(ΘI) = [ sin(180 * n * d * (sin(ΘI) – sin(ΘS) ÷ λ ] ÷ [ n * sin(180 * d * (sin(ΘI) – sin(ΘS) ÷ λ ]

If the denominator is 0, then the response is 0 dB.



Variables:

n = number of sensors

d = spacing between sensors

λ = wavelength

ΘI = incident angle

ΘS = steering angle



TI-84 Plus CE Code: BEAMPTN



ClrHome

Degree

Disp “BEAM PATTERN”, “BY STEPHEN A HERTZ”, “(HP 67 ANTENNAS)”

Input “NO. SENSORS? “, N

Input “INTERIOR SPACING? “, D

Input “WAVELENGTH? “, L

Input “STEERING Θ°? “, S

Input “STARTING ΘI? “, I

Input “NO. PTS? “, K

Input “CHG Θ°? “, J

For(Θ, I, I+K*J, J)

180 * D / L → A

sin(Θ) – sin(S) → B

N * sin(A * B) → R

If R=0

0 → R

Else

sin(N * A * B) / R → R

20 * log(abs(R)) → R

End

ClrHome

Disp “ΘI=”, Θ, “R (DB)=”, R

Pause

End



Example



Input:

n = 6

d = 36 ft

λ = 100 ft

ΘS = 0° (steering angle)

Range: ΘI = starting at 0°, 5 calculations, in increments of 5°



Results:

K =

ΘI =

R(ΘI) =

0

0

0

1

5

-0.4983317822

2

10

-2.056358346

3

15

-4.9617921711

4

20

-9.809670689



The negative response signifies that there is a reduction of signal strength.



Source



Hertz, Stephen A. “Beam Pattern for Uniform Array” HP-67/HP-97: Users’ Library Solutions: Antennas. Hewlett Packard. Corvallis, OR. Rev. D. April 1979. pp. 24-27




Eddie


All original content copyright, © 2011-2026. 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, April 4, 2026

TI-84 Plus CE: Signal to Noise Ratio and Shannon’s Law

TI-84 Plus CE: Signal to Noise Ratio and Shannon’s Law



Signal to Noise Ratio (SNR)


The program SNR calculates the signal to noise ratio for inputs in one of the three units:


Decibels

S – N

Watts

20 * log( S ÷ N )

Voltage

10 * log(S ÷ N )

S: desired signal level

N: noise level


Cadence PCB Solutions (see source) provides a scale of signal to noise ratios and their effectiveness, which is summarized here:


5 dB to 10 dB

No connection is made, the ratio is too low

10 dB to 15 dB

The connection is unreliable

15 dB to 25 dB

Minimum acceptable level

25 dB to 40 dB

Good connection

41 dB and above

Excellent connection


In general, the higher the SNR, the better.


TI-84 TI-Basic Code: Signal to Noise Ratio

Program Title: SNR



Menu(“SIGNAL NOISE RATIO”,”DECIBELS”,1,”WATTS”,2,”VOLTAGE”,3)

Lbl 1

Input “SIGNAL DB? “, S

Input “NOISE DB? “, N

S – N → R

Goto 0

Lbl 2

Input “SIGNAL (W)? “, S

Input “NOISE (W)? “, N

20 * log(S / N) → R

Goto 0

Lbl 3

Input “SIGNAL (V)? “, S

Input “NOISE (W)? “, W

10 * log(S / N) → R

Goto 0

Lbl 0

Disp “SNR (DB): “, R



Examples



Example 1: S: -10 dB, N: -50 dB (from Source)

Results: 40 dB



Example 2: S: 400 W, N: 60 W

Results: 16.47817482 dB



Example 3: S: 300E-3 V (300 millivolts), N: 2E-6 V (2 microvolts)

Result: 51.76091259 dB (*source erroneously had 62 DB)





Shannon’s Law



The program SHANNON makes two calculations: signal to noise ratio in decibels and the capacity of the channel in bits per second. Shannon’s Law was discovered by Claude Shannon during World War II.



C = W * log(1 + S ÷ N) ÷ log(2)



W: bandwidth of the signal in Hertz

S: average signal received in Watts

N: average noise signal in Watts

C: maximum channel capacity in Bits per Second





TI-84 TI-Basic Code: Shannon’s Law

Program Title: SHANNON



Disp “SHANNON’S LAW”

Input “REC’D POWER (W)? “, S

Input “NOISE POWER (W)? “, N

Input “BANDWIDTH (HZ)? “, W

20 * log(S / N) → R

Disp “SIGNAL NOISE RATIO: “, R

W * log(1 + S / N) / log(2) → C

Disp “CHANNEL (BITS/S):”, C



Example



Inputs:

Average Received Signal Power (S): 49.2 W

Average Noise Power (N): 2.2 W

Bandwidth: 200 Hz



Results:

Signal Noise Ratio (SNR): 26.99084844 dB

Channel capacity: 909.2385861 bits/s



Source



Cadence. “What is Signal to Noise Ratio and How to calculate it?” Cadence PCB Solutions. 2020. Accessed November 30, 2025. https://resources.pcb.cadence.com/blog/2020-what-is-signal-to-noise-ratio-and-how-to-calculate-it



Eddie


All original content copyright, © 2011-2026. 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, March 7, 2026

TI-84 Plus CE and Swiss Micros DM32: Blood Alcohol Level

TI-84 Plus CE and Swiss Micros DM32: Blood Alcohol Level


Just in time for the upcoming St. Patrick’s Day in a few weeks…


Introduction


The blood alcohol level is calculated by the following approximation by Walter L. Gregory Jr. using data from the CRC Handbook of Tables for Applied Engineering (1970). The program is based off the HP-97/HP-67 program listed in their Medical Practitioner pac (1979). (see source):


BAC ≈ ((ALC * OZ) ÷ 50 – T) * (3.751 ÷ WT)


ALC: Percentage of alcohol consumed. Enter as a whole number. For example, if the drink has 40% alcohol, ALC = 40. If the alcohol is measured in proof, divide the proof by 2.

OZ: The total amount of ounces consumed within the period of time. For example: six 12-oz beers total 72 ounces.

WT: The weight of the person in pounds.

T: The number of hours drinks are consumed. If T > 1, then T = hours – 1. Otherwise T = 0.


If calculated BAC is below 0, then set BAC = 0.


TI-84 Program CE: ALCOHOL

Type: TI Basic


Disp “BLOOD ALCOHOL (US)”

Input “WEIGHT (LB)? “, W

Input “OUNCES? “, O

Input “PERCENTAGE? “, P

Input “HOURS OF DRINKING? “, H

If H≤1 : Then : 0 → H

Else : H – 1 → H : End

(P * O / 50 – H) * 3.751 / W → A

Disp “BLOOD ALCOHOL: “, A


Swiss Micros DM32 (HP 32SII): ALCOHOL


A01 LBL A

A02 INPUT W

A03 INPUT O

A04 INPUT P

A05 INPUT H

A06 RCL H

A07 1

A08 x≥y?

A09 SF 1

A10 STO- H

A11 FS? 1

A12 Cl x

A13 FS? 1

A14 STO H

A15 CF 1

A16 RCL P

A17 RCL× O

A18 50

A19 ÷

A20 RCL- H

A21 3.751

A22 RCL÷ W

A23 ×

A24 x<0?

A25 Cl x

A26 RTN


Notes:


A07 1, A08 x≥y?, A09 SF 1: If hours > 1, set Flag 1. Using flags can sometimes eliminates the need for additional labels.


A24 x<0?, A25 Cl x: If the number in the display (x stack) negative, change it to zero.


Examples


Example 1:

Inputs:

Weight: W = 150 lbs

Ounces: O = 4 oz

Percentage: P = 20%

Hours: H = 0.5 hours (T = 0)

Output: 0.0400


Example 2:

Inputs:

Weight: W = 180 lbs

Ounces: O = 45 oz

Percentage: P = 50%

Hours: H = 2.5 hours (T = 1.5)

Output: 0.9065

(typo:  Thank you, Pedro Leiva)


Be sure to check your local laws for legal blood alcohol levels. This program is not suited to be evidence in legal matters.


One thing remains: DON’T DRINK AND DRIVE



Source


Hewlett Packard. HP-67/HP-97. User’s Library Solutions: Medical Practitioner. Corvallis, OR. April 1979. pp. 9-12



Eddie


All original content copyright, © 2011-2026. 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, February 28, 2026

TI-84 Plus CE: Logistic Map

TI-84 Plus CE: Logistic Map


It feels like forever since I with the TI-84 Plus CE.


Introduction


The program LOGISTIC plots the sequence


x = r * x * (1 – x)


where x is initially in the interval (0, 1) and r is a parameter. The sequence traces out the path of recursion.


Depending on the value of r, the sequence can eventually stabilize to a single point, fluctuate then stabilize, eventually bounce between two stable points, or going into the chaos. The higher the r, chance of the latter two possibilities increase. Typically, for any r < 3, the sequence will most likely stabilize.



TI-84 Plus CE Program: LOGISTIC.8xp


Type: TI-Basic Program


ClrHome

Disp “LOGISTIC MAP”

Disp “X1=R*X0*(1-X0)”

Seq

FnOff

Menu(“LAMBDA (R)”, “ENTER”, 1, “RANDOM”, 2)

Lbl 1

Input “0<R≤4: “, R

Goto A

Lbl 2

randInt(1,80) / 20 → R

Pause R

Goto A

Lbl A

Menu(“U(1)=”, ”ENTER”, 3, “RANDOM”, 4)

Lbl 3

Input “U(1)? “, U

Goto B

Lbl 4

rand → U

Pause U

Goto B

Lbl B

{U} → u(nMin)

SEQ(n+1)

“R*u(n)*(1-u(n))” → u

FnOn 1

1 → nMin

50 → nMax

0 → Ymin

1 → Ymax

0 → Xmin

50 → Xmax

DispGraph



Notes:


The Time setting is assumed: x-axis = n, y-axis = u__n


nMin: Sets the counter and the index of the first argument. Typically the counter starts with 0 or 1. Keystrokes: [ vars ], 1. Window, scroll to U/V/W, 4. nMin.


Seq: Sets Sequence mode.


I use R for λ since the TI-84 does not have Greek characters (except for π and σ).


randInt(1,80) / 20 → R: Selects random values from 0.05 and 4 with a tick mark of 0.05.


u(nMin): Store the initial conditions. The conditions are entered as a list, even there is only one initial condition. Keystrokes: [ vars ], 1. Window, scroll to U/V/W, 1. u(nMin)


SEQ(n+1): In the program editor, I had to select this from the catalog. It is listed under “SEQ(n+1) Type”. This allows for the recurring sequence to be in the format u(n+1) = f(u(n),n).

R*u(n)*(1-u(n))” → u: The u is type from the keyboard: [ 2nd ] [ 7 ].

FnOn 1: Turns the sequence u(n) on.



Examples




Left: r = 3.67, initial point = 0.2. This looks like total chaos as n grows.


Right: r = 3.1, initial point = 0.5. This sequence does not converge to a single value, but eventually provides a bifurcation between two points.


Caution: If r is too high, even if the u(1) is with in the interval [0, 1], the sequence can “escape” and an overflow can occur. I don’t recommend an r higher than 4.


Source


“Logistic map”. Wikipedia https://en.wikipedia.org/wiki/Logistic_map Retrieved October 20, 2025.



Eddie


All original content copyright, © 2011-2026. 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 5, 2025

HP 21S and TI-84 Plus CE: Normal Distributions and Hypothesis Tests

HP 21S and TI-84 Plus CE: Normal Distributions and Hypothesis Tests


Let’s compare how calculations involving the normal distribution are done between a classic calculator and a current one. The classic calculator is the rare HP 21S calculator from 1988 and the current calculator is the TI-84 Plus CE.


In 2017 (how time flies!) I wrote a review for the HP 21S (along with it’s cousin HP 20S):

https://edspi31415.blogspot.com/2017/04/retro-review-hewlett-packard-hp-20s-and.html.


Normal Distribution Calculations


z = z-score, point; p = probability, area


Assumptions: The mean is assumed to be 0 while the standard deviation is 1. (μ = 0, σ = 1).


Lower Tail (-∞, z)



HP 21S

TI-84 Plus CE*

Example

Given z, find p

Keystrokes:

1 [ - ] z [ ←| ] (Q(z)) [ = ]

normalcdf(-1E99, z)

Input: z = 0.77
Result:
p ≈ 0.7794

Given p, find z

Keystrokes:

[ ( ] 1 [ - ] p [ ) ] [ |→ ] (zp)

invNorm(p)

Input: p = 0.77
Result:
z ≈ 0.7388


* also includes TI-83 Plus, TI-84 Plus, TI-83 Premium (Python), TI-82 Advanced, and I do believe it is the same syntax for TI-89/Nspire family


Upper Tail (z, +∞)


HP 21S

TI-84 Plus CE*

Example

Given z, find p

Keystrokes:

z [ ←| ] (Q(z))

normalcdf(z, 1E99)

Input: z = 0.49
Result:

p ≈ 0.3121

Given p, find z

Keystrokes:

p [ |→ ] (zp)

InvNorm(1 - p)

Input: p = 0.49
Result:

z ≈ 0.0251


Two Tail (-z, z)


HP 21S**

TI-84 Plus CE*

Example

Given z, find p

Keystrokes:

z [ STO ] [ 0 ] [ +/- ]

[ ←| ] (Q(z)) [ - ]
[ RCL ] 0 [ ←| ] (Q(z)) [ = ]

normalcdf(-z, z)

Input: z = 1
Result:

p ≈ 0.6827

Given p, find z

Keystrokes:

p [ ÷ ] 2 [ = ] [ STO ] 0
Lower Limit:

[ ( ] 0.5 [ - ] [ RCL ] 0 [ ) ] [ |→ ] (zp)
Upper Limit:

[ ( ] 0.5 [ + ] [ RCL ] 0 [ ) ] [ |→ ] (zp)

InvNorm(p, 0, 1, CENTER)

Input: p = 0.25
Result:

Upper: z ≈ 0.3186

Lower: z ≈ -0.3186


** HP 21S: A memory register is needed for this particular algorithm. I use register 0 for this example.



Sample Test of the Mean: Is the Proposed Mean the True Mean? (μ0 = μ)


Perform a significant test of whether a proposed mean (μ0) is the true mean (μ) given data from a sample:


x-bar: arithmetic mean of a sample

σ: population deviation of the sample

n: sample size


In this test, the null or default hypothesis is μ =μ0, while the alternate hypothesis is μ ≠ μ0.


Your confidence level and critical level, α, are complimentary. For example, if you want a 95% confidence level, your critical level, or α, is: α = 1 – 0.95 = 0.05 (5%). This is a two-tail test.


HP 21S

TI-84 Plus CE

[ ←| ] [ ← ] (LOAD) (A) (1-Stat)
n [ XEQ ] D

μ [ R/S ]

σ [ R/S ]



Test Method # 1:

α [ ÷ ] 2 [ = ] [ |→ ] (zp) (= critical value)

μ0 [ XEQ ] B (= test value)


Null: μ0 = x-bar, Alternative: μ0 ≠ x-bar

If test value < critical value, do not reject null hypothesis

If test value > critical value, reject null hypothesis and accept the alternate hypothesis


Test Method # 2:

μ0 [ XEQ ] B [ ←| ] [ 1 ] (Q(z)) (= p)


Null: μ0 = x-bar, Alternative: μ0 ≠ x-bar

If p > α / 2, do not reject null hypothesis

If p < α / 2, reject null hypothesis and accept the alternate hypothesis


Note:

LBL D: store summary statistics for the test of one sample mean or probability. For this test, the standard error that is shown will not be used.


LBL B: calculate the z-score:

z = (x-bar – μ0) / (σ / √n)

[ stat ], TESTS, 1: Z-Test…

Inpt: Stats
(Input shown as Inpt)

μ0: enter μ0

σ: enter σ

x-bar: enter x-bar

n: enter n

Select μ ≠ μ0 (alternate hypothesis)

Select Calculate


Test Method # 1:

critical value: normalcdf(α/2, 1E99)

test value: [ vars ], 5: Statistics…, TEST, 2: z


Null: μ0 = μ, Alternative: μ0 ≠ μ

If test value < critical value, do not reject null hypothesis

If test value > critical value, reject null hypothesis and accept the alternate hypothesis


Test Method # 2:


Compare p to α


Null: μ0 = x-bar, Alternative: μ0 ≠ x-bar

If p > α, do not reject null hypothesis

If p < α, reject null hypothesis and accept the alternate hypothesis


One line command:

Z-Test(μ0, σ, x-bar, n, alt)

alt: -1 for μ0 < μ, 0 for μ0 ≠ μ, 1 for μ0 > μ


Example:

n = 515, μ = 7.65, σ = 3.56

α = 5% = 0.05, μ0 = 7.7, α / 2 = 0.025

[ ←| ] [ ← ] (LOAD) (A)
515 [ XEQ ] D

7.65 [ R/S ]

3.56 [ R/S ]


0.05 [ ÷ ] 2 [ = ] [ |→ ] (zp)

(critical value = 1.9600)

7.7 [ XEQ ] B

(z ≈ -0.3187 < 1.9600)


7.7 [ XEQ ] B [ ←| ] [ 1 ] (Q(z))

(p ≈ 0.6250 > 0.025)


Do not reject null hypothesis

Example:

n = 515, μ = 7.65, σ = 3.56

α = 5% = 0.05, μ0 = 7.7


[ stat ], TESTS, 1: Z-Test…

Inpt: Stats

μ0: 7.7

σ: 3.56

x-bar: 7.65

n: 515

Select μ ≠ μ0

Select Calculate


Results:

μ≠7.7

z=-0.3187304977

p=0.7499310153

x-bar=7.65

n=515



p ≈ 0.7499 > 0.05

z ≈ -0.3187 < 1.9600


Do not reject null hypothesis


This is one of several z-tests that can be performed.


Confidence Interval


Determine a confidence level of where the true mean is located given data from a sample:


x-bar: arithmetic mean of a sample

σ: population deviation of the sample

n: sample size


Confidence Mean:

x-bar ± (z * σ) / √n


z: absolute value of the z-score where the two tail probability equals c.

Using TI-84 Plus CE commands: invNorm(c, 0, 1, CENTER)


HP 21S

TI-84 Plus CE

[ ←| ] [ ← ] (LOAD) (A)
n [ XEQ ] D

μ [ R/S ]

σ [ R/S ]


Confidential Interval:

[ ( ] 1 [ - ] c [ ) ] [ ÷ ] 2 [ = ]

[ |→ ] [ 1 ] (zp)

[ XEQ ] C

→ precision [ R/S ]

→ lower limit [ R/S ]

→ upper limit


Note:

LBL C: Confidence interval

precision = (z * σ) / √n

lower limit = x-bar – precision

upper limit = x-bar + precision

[ stat ], TESTS, 7: Zinterval…


Inpt: Stats (Input is shown as Inpt)

σ: enter σ

x-bar: enter x-bar

n: enter n

C-Level: enter confidence level as a decimal

Calculate


One line command:

ZInterval σ, x-bar, n, c

n = 389, μ = 88.84, σ = 10.25

c = 90% = 0.9

[ ←| ] [ ← ] (LOAD) (A)
389 [ XEQ ] D

88.84 [ R/S ]

10.25 [ R/S ]

[ ( ] 1 [ - ] 0.9 [ ) ] [ ÷ ] 2 [ = ]

[ |→ ] [ 1 ] (zp)

[ XEQ ] C

→ 0.8548 [ R/S ]

→ 87.9852 [ R/S ]

→ 89.6948

n = 389, μ = 88.84, σ = 10.25

c = 90% = 0.9

Inpt: Stats

σ: 10.25

x-bar: 88.84

n: 389

C-Level: 0.9


Result:

(87.985, 89.695)

x-bar = 88.84

n = 389



Sources


CalcBlog “Hypothesis Testing using Z-Test on the TI-83 Plus, TI-84 Plus, TI-89, and Voyage 200” February 6, 2011. https://www.calcblog.com/hypothesis-testing-z-test-on-ti84-ti89-graphing-calculator/ Accessed January 30, 2025.


Hewlett Packard HP-21 Stat/Math Calculator: Owner’s Manual Edition 3. June 1990.


TI-Basic Developer “The Z-Test( Command” http://tibasicdev.wikidot.com/z-test Accessed January 30, 2025.

Enjoy! Until next time,


Eddie


All original content copyright, © 2011-2025. 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.

TI-60 and HP 65: Distance by Stadia Tacheometry

TI-60 and HP 65: Distance by Stadia Tacheometry Introduction The stadia calculation measures the distance from the level or theod...