Operation Manual

Chapter 17: Activities 312
Using a Program to Guess the Coefficients
Setting Up the Program
This program graphs the function A sin(BX) with random integer coefficients between 1 and 10. Try to
guess the coefficients and graph your guess as C sin(DX). The program continues until your guess is
correct.
Note: This program changes the graph window and graph styles. After you run the program, you can
change individual settings as needed or you can press y L
7 2 2 to return to default settings.
Programs typically do not restore your settings in MODE, Y=, WINDOW and other locations that were used by
the program. This is dependent on who created the program.
Program
PROGRAM:GUESS
:PlotsOff :Func
:FnOff :Radian
:ClrHome
:AxesOn
:Sequential
:GridOff
:Background Off
:DetectAsym Off
:"Asin(BX)"
!Y1
:"Csin(DX)"
!Y2
Define equations.
:GraphStyle(1,1)
:GraphStyle(2,5)
:GraphColor (1, BLUE)
:GraphColor (2, RED)
Set line and path graph styles.
:FnOff 2
:randInt(1,10)
!A
:randInt(1,10)
!B
:0
!C:0!D
Initialize coefficients.
:L2p!Xmin
:2
p!Xmax
:
2!Xscl
:
L10!Ymin
:10
!Ymax
:1
!Yscl
Set viewing window.