hp 39g+ graphing calculator Mastering the hp 39g+ A guide for teachers, students and other users of the hp 39g+, hp 39g & hp 40g Edition 1.
Table of Contents Introduction................................................................................................. 12 How to use this Manual.............................................................................. 13 Early High School......................................................................................................... 13 Pre-Calculus ................................................................................................................. 14 Calculus.............
The Function Aplet ..................................................................................... 51 Choose the aplet .......................................................................................................... 51 The SYMB view ............................................................................................................. 52 The XTθ button ............................................................................................................. 52 ing your function ....
Problems when evaluating limits .................................................................................. 88 Gradient at a point........................................................................................................ 90 Finding and accessing polynomial roots ...................................................................... 91 The VIEWS menu ........................................................................................ 92 Plot-Detail ..................................
The Stats Aplet - Univariate Data ............................................................ 122 Uni vs. Bi-variate data ................................................................................................ 122 Clearing data .............................................................................................................. 122 Sorting data ................................................................................................................ 123 The STATS key ...............
The Finance aplet ..................................................................................... 160 Parameters ................................................................................................................. 160 Straightforward compound interest ............................................................................ 161 Annuity........................................................................................................................162 Loan calculations............
Using, Copying & Creating aplets........................................................... 189 Creating a copy of a Standard aplet. ........................................................................... 190 Copying and adding to the Function aplet.................................................................. 190 Copying and adding to the Stats aplet ....................................................................... 191 Some examples of saved aplets ............................................
The Graphics commands ............................................................................................. 237 The Loop commands .................................................................................................... 237 FOR = TO [STEP] END ..................................... 237 DO UNTIL................................................................................................................... 237 WHILE REPEAT..................................
The ‘Tests’ group of functions..................................................................................... 259 The ‘Trigonometric’ & ‘Hyperbolic’ groups of functions........................................... 259 COT, SEC etc............................................................................................................. 259 EXP ............................................................................................................................260 ALOG............................
The ‘Polynomial’ group of functions ........................................................................... 277 POLYCOEF ................................................................................................................ 277 POLYEVAL................................................................................................................. 277 POLYFORM ...............................................................................................................278 POLYROOT............
Appendix C: The hp 40g & its CAS ......................................................... 310 Introduction.................................................................................................................... 310 What is a CAS? .......................................................................................................... 310 What is the difference between the hp 39g, hp 40g & hp 39g+? ............................... 312 Using the CAS................................................
INTRODUCTION This booklet is intended to help you to master your hp 39g+ calculator but is also aimed at users of the hp 39g and hp 40g. These are very sophisticated calculators, having more capabilities than a mainframe computer of the ’70s, so don’t expect to come to grips with its abilities in one or two sessions. However, if you persevere you will gain efficiency and confidence. The majority of readers may only have used a Scientific calculator before so explanations are as complete as possible.
HOW TO USE THIS MANUAL It has been attempted to design this manual to cover the full use of the hp 39g+ calculator. This means explanations which will be useful to anyone from a student who is just beginning to use algebra seriously, to one who is coming to grips with advanced calculus, and also to a teacher who is already familiar with some other brand of graphic calculator. Readers may encounter one of two difficulties.
means and to display histograms. In the MATH menu, read about the functions ROUND, POLYFORM and POLYROOT. Make sure you know how to save and transfer aplets. Learn about the Sketch view and the Notes catalog for a bit of fun.
WHERE’S THE ON BUTTON? Let’s begin by looking at the fundamentals - the layout of the keyboard and which are the important keys that are used frequently. The sketch below shows most of the important keys. These are the ones which control the operation of the calculator - others are used to do calculations once the important keys have set up the environment to do it in. These six screen keys change their function in different contexts. The bar at the bottom of the screen labels them.
SOME KEYBOARD EXAMPLES Shown below are snapshots of some typical screens you might see when you press each of the keys shown on the previous page. Exactly what you see depends on which aplet is active at the time. The aplet used below to illustrate this is the Function aplet, which is used to graph and analyze Cartesian functions. Notice how the meanings of the row of blank screen keys under the screen changes in different views.
KEYS & NOTATION CONVENTIONS There are a number of types of keys/buttons that are used on the hp 39g+. Some essential keys The basic keys are those that you see on any calculator including scientific ones, such as the numeric operators and the trig keys. Most of these keys have two or more functions. Take for example the COS key shown left. If you just press the key, you get the COS function.
The ALPHA key The next modifier key is the ALPHA key. This is used to type alphabetic characters, and these appear in orange just below most keys. The Screen keys A special type of key unique to the hp 39g+ and family is the row of blank keys directly under the screen. These keys change their function depending on what you are doing at the time. The easiest way to see this is to press the APLET key. As you can see right, the functions are listed at the bottom of the screen.
Try this… If you haven’t already, out of the menu from the previous screen. Press the HOME key to see the screen on the right. Yours may not be blank like mine but that doesn’t matter. Press 12 and then press the screen key labeled . Now press the ALPHA key and then the alphabetic D key (on the XTθ key). Finally, press the ENTER key. Your screen should look like mine on the right. You have now stored the value 12 into memory D. Each alpha key can be used as a memory.
You should now be back HOME, with the function ROUND( entered in the display as shown right. You can also achieve the same effect by using ALPHA to type in the word letter by letter. Some people prefer to do it that way. Now type in: 4+D/18,3) and press ENTER As you can see, the effect was to round off the answer of 4.666666.. to 3 decimal places. There are shortcuts for obtaining things from the MATH menu that are covered later (see page 47).
EVERYTHING REVOLVES AROUND APLETS! A set of “aplets” is provided in the APLET view on the hp 39g+. This effectively mean that it is not just one calculator but nine (or more), changing capabilities according to which aplet is chosen. The best way to think of these aplets is as “environments” or “rooms” within which you can work.
The Quadratic Explorer aplet (see page 164) This is a teaching aplet, allowing the student to investigate the properties of quadratic graphs. The Sequence aplet (see page 107) Handles sequences such as Tn = 2Tn −1 + 3; T1 = 2 or Tn = 2n −1 . Allows you to explore recursive and non-recursive sequences. The Solve aplet (see page 113) Solves equations for you. Given an equation such as A = 2π r ( r + h ) it will solve for any variable if you tell it the values of the others.
The PLOT view is used to display the function as a graph… The key gives access to a number of other useful tools allowing further analysis of the function. Although these views are superficially different in other aplets, the basic idea is usually similar. Having said that aplets are best thought of as “working environments”, it is equally true that aplets are essentially programs, with the standard ones simply being built into the calculator.
Once an aplet is transferred onto any one calculator, transferring it to another takes only seconds using the built in infra-red link at the top of each calculator. This is exactly like the remote control of a VCR, and allows two calculators to talk to each other. In the interests of security in examinations the distance over which they can communicate is limited to about 8 - 10cm (about 3 - 4 inches). See page 197 for details on this process.
THE HOME VIEW In addition to these aplets, there is also the HOME view, which can best be thought of as a scratch pad for all the others. This is accessed via the HOME key (just below the APLET key) and is the view in which you will do your routine calculations such as working out 5% of $85, or finding √35. The HOME view is the view that you will most often use, so we will explore that view first. What is the HOME view? This is the HOME base for the calculator.
Exploring the keyboard It is worth familiarizing yourself with the mathematical functions available on the keyboard. If we examine them row by row, you will see that they tend to fall into two categories - those which are specific to the use of aplets, and those which are commonly used in mathematical calculations. The screen keys The first row of blank keys are context defined. The reason they have no label is that their meaning is redefined in different situations - they are the ‘screen keys’.
The APLET key is used to choose between the various different aplets available. Everything in the calculator revolves around aplets, which you can think of either as miniature programs or as environments within which you can work. The hp 39g+ comes with ten standard aplets Finance, Function, Inference, Parametric, Polar, Quadratic Explorer, Sequence, Solve, Statistics and Trig Explorer. Which one you want to work with is chosen via the APLET key.
The VIEWS menu is provided for two purposes… Intro to the VIEWS menu Firstly, within the standard aplets (Function, Sequence, Solve etc.) it provides a list of special views available to enhance the PLOT view. For example the standard PLOT screen provides a graph, but the VIEWS menu lets you use a split screen such as shown right. Information on the VIEWS menu is given in the chapter dealing with the Function aplet.
The MATH key next to VARS provides access to a library of mathematical functions. The more common functions have keys of their own, but there is a limit to the number of keys that one can put on a calculator before it takes too long to find the key required. The MATH menu lists all those functions that would not fit onto the keyboard plus some which also appear on the keyboard. Shown in the screen snapshot above is a small selection of the total list.
The SETUP views The SETUP views, above PLOT, SYMB and NUM, are used to customize their respective views. For example, the PLOT SETUP screen controls things like axes, labels etc. Their use changes in different aplets, so for more information see the explanations in the chapters dealing with the various aplets, particularly with the Function aplet on page 55. In particular, the SYMB SETUP key is only used in one place, which is to choose the data model for bivariate statistics in the Statistics aplet.
Numeric formats The choices for ‘Number format’ are shown on the right. Standard is probably the best choice in most cases, although it can be a little annoying to constantly have 12 significant figures displayed. In Standard mode, very large and very small numbers are displayed in scientific notation. The Fixed, Scientific and Engineering formats all require you to specify how many decimal places to display. The screenshot right shows Fixed 4, which rounds everything off to 4 decimal places.
The setting of Fraction can be quite deceptive to use and is discussed in more detail on page 40. The next alternative in the MODES view of ‘Decimal Mark’ controls the character which is used as a decimal point. In some countries a comma is used instead of a decimal point. If you opt to use a comma rather than a full stop then any places where a comma would normally be used (such as in lists) will swap to using a full stop.
An alternative to using the ANS key is to use the History facility and the function. This is discussed on page 43. The negative key Another important key is the (-) key (shown right). If you want to calculate the value of (say) −2 − (−9) then you must use the (-) key before the 2 and the 9 rather than the subtract key. If you press the subtract key before the 2 instead of the (-) key, then the calculator will enter instead: Ans - 2, meaning, subtract 2 from the previous answer.
The DEL and CLEAR keys The next important key is the DEL key at the top right of the keyboard. This serves as a backspace key when typing in formulas or calculations, erasing the last character typed. If you have used the left/right arrow keys to move around within a line of typing, then the DEL key will delete the character above the cursor. The CLEAR key above DEL can be thought of as a kind of ‘super delete’ key.
Angle and Numeric settings It is critical to your efficient use of the hp 39g+ that you understand how the angle and numeric settings work. For those upgrading from the hp 38g this is particularly important, since the behavior is significantly different. On the hp 39g+, when you set the angle measure or the numeric format in the MODES view, it applies both to the aplet and to the HOME view. However, this setting applies only to the currently active aplet (the one highlighted in the APLET view).
Suppose we define a trig function in the Function aplet as shown. The default setting for the Function aplet is radians, so if we set the axes to extend from - π to π , the graph would look as shown right. In the PLOT view shown, the first positive root has been found (see page 63) as x=1.0471… On the hp 39g+, if we now change to the HOME view and perform the calculation shown right, we expect that the answer should be zero, as indeed it is.
This setting also applies to the appearance of equations and results displayed using the SHOW command. Calculator Tip Under the system used on the HP39+, if you want to work in degrees then you will need to choose that setting in the MODES view and possibly set it again if you change to another aplet. Some people choose to go through and change the setting on all the aplets at once so that they don’t have to remember that it might change. However, if you the aplet the default setting will return.
As you can see in the screen snapshot on the previous page, my calculator has a number of extra aplets. Two of them, Statistics2 and Statistics3 are simply copies of the normal Statistics aplet containing data that I did not want to lose. The top two aplets Curve Area and Coin Tossing are teaching aplets that I have downloaded from the internet.
The History entry will take you to the HOME view, where pressing SHIFT CLEAR will clear the History. The GRAPHICS MANAGER There are two views, shown right, for which the only access is via the MEMORY MANAGER screen. The first of these, the GRAPHICS MANAGER, shows some memory in use on my calculator due to the screen captures I am performing to show you these views. Yours will probably be empty.
Fractions on the hp 39g+ Earlier we examined the use of the MODES view, and the meaning of Number Format. We discussed the use of the settings Fixed, Scientific and Engineering, but left the setting of Fraction for later. The Fraction setting can be a little deceptive. Most calculators have a fraction key, often labeled a b input, for example, 1 2 , that allows you to c as 1¬2¬3 or something similar. What these 3 calculators usually won’t do is allow you to mix fractions and decimals.
Some examples are… (using Fraction 4 or higher) 1. 1 4 17 + = 3 5 15 2. 3 1 1 1 − 4 = −1 3 2 6 The second point to remember involves the method the hp 39g+ uses when converting decimals to fractions, which is basically to generate (internally and unseen by you) a series of continued fractions which are approximations to the decimal entered. The final fractional approximation chosen for display is the first one found which is ‘sufficiently close’ to the decimal.
The Fraction setting is thus far more powerful than most calculators but can require that you understand what is happening. It should also be clear why a special fraction button was not provided: the ‘fractions’ are never actually stored or manipulated as fractions at all! Pitfalls to watch for As you can see in the screenshot right, a setting of Fraction 4 produces a strange (but actually correct) result for 0.666, while adding one more 6 (to take the decimal beyond 4 d.p.
If you use a setting of only Fraction 2 to perform this, you will find to your amazement that 1/3 + 4/5 = 8/7 , whereas using Fraction 6 gives the correct answer. The reason for this ‘error’ is that the 1/3 and 4/5 were converted to decimals and added to give 1.133333…. This was converted back to a fraction to give 8/7 (1.1428..) matching sufficiently closely in Fraction 2 to be accepted. The HOME History The HOME page maintains a record of all your calculations called the History.
At this point you can use the left and right arrows and the DEL key to edit the calculation by removing some of the characters and/or adding to it. For example, in the screenshot right, the calculation of 3*2*COS(35) has been edited to 3*COS(35). Clearing the History Pressing enter will now cause this new calculation to be performed. Calculator Tip ! Pressing ON during editing will erase the whole line. ! Pressing SHIFT CLEAR erases the whole history.
Storing and Retrieving Memories Each of the alphabetic characters shown in orange below the keys can function as a memory. Some examples of this are shown in the third and fourth examples above where the values of 1, -3 and -4 are stored into A, B and C and the value of 3 is stored into X. All of this ‘storing’ of values is done with the key, which is one of the screen keys listed at the bottom of the HOME view.
Referring to other aplets from the HOME view. Once functions or sequences have been defined in other aplets, they can be referenced in the HOME view. e.g. 1 Suppose we use the Function aplet to define F1(X)=X²-2 and F2(X)=e^X as shown right. These functions now become accessible not only from within the HOME view but also within any other aplet also. This is shown by the screen shots below. The results shown will (of course) depend on your settings in the MODES view.
An introduction to the MATH Menu The MATH menu holds all the functions that are not used often enough to be worth a key of their own. There is a very large supply of functions available, many of them extremely powerful, listed in their own chapter later in the book. When you press the MATH key you will see the pop up screen shown right. The left hand menu is a list of topics.
Resetting the calculator It is probably inevitable as the line between calculators and computers becomes blurred that calculators will inherit one of the more frustrating characteristics of computers: they crash! If you find that the calculator is beginning to behave strangely, or is locking up then there are a number of ways to deal with this. Calculator Tip If you are a user of external aplets then you may find that one will stop working with the message “Invalid syntax. Edit program?”.
Just on the rare chance that you may find that the calculator locks up so completely that the keyboard will not respond a method of reset is provided which is independent of the keyboard. This should never happen but it is important to know how to deal with it in case it happened during a test or an exam. Soft reboot (Hardware) On the back of the calculator is a small hole. Poke a paper clip or a pin into this hole and press gently on the switch inside.
Summary 1. The up/down arrow key moves the history highlight through the record of previous calculations. When the highlight is visible, the key can be used to retrieve any earlier results for editing using the left/right arrow keys and the DEL key. 2. Care must be taken to ensure the your idea of order of operations agrees with the calculator’s. For example, (-5) 2 must be entered as (-5) 2 rather than as -52, and 5 + 4 must be entered as √(5+4) rather than √5 + 4. 3.
THE FUNCTION APLET The Function aplet is probably the one that you will use most of all.
The SYMB view Now press the key. When you do, your screen should change so that it appears like the one on the right. This is the SYMB view. Notice the screen title so that you will know where you are (if you didn’t already). Calculator Tip Pressing ENTER here would have had the same effect. Whenever there is an obvious choice pressing ENTER will usually produce the desired effect. The XTθ button Whenever you enter an aplet, one of the keys which usually changes its function is the key labeled XTθ.
Try turning the check on and off for function F1(X). Remember, the highlight has to be on the function before the check can be changed. Make sure it’s checked when you have finished. The NUM view If you now press the NUM key, you will see the screen on the right. It shows the calculated function values for F1(X), starting at zero and increasing in steps of 0.1 Make sure the highlight is in the X column, and then press 4 and ENTER. You will find that the numbers will now start at 4 instead of zero.
Auto Scale Press the VIEWS key. Use the arrow keys to scroll down to Auto Scale and press ENTER. The calculator will adjust the y axis in an attempt to fit as much of the graph on to the screen as possible. Some points to bear in mind; ! the y axis is scaled only on the first function which has a ! the y axis is scaled for the x axis you have chosen in PLOT SETUP. If you’ve not chosen wisely then your result will not be good. ! it doesn’t choose ‘nice’ scales such as we would choose (going up in 0.
The PLOT SETUP view If you press SHIFT then PLOT you will see something like the view on the right. The highlight should be on the first value of ‘XRng:’. Enter the value -4. Calculator Tip Don’t use the subtract key to input a negative. You MUST use the negative key labeled (-) which is in the same row as the ENTER key. Type in 4 for the other ‘XRng:’ value, then -20 and 20 for the ‘YRng:’ values. When you’ve done this use the arrow keys move to ‘Ytick:’ and change it to 5. Detail vs.
Let's have a look at the meaning of the CHKs (check marks) on the second page of PLOT SETUP. Although they are not used often they can be quite useful and I recommend highly that you use Simult: Simultaneous The first option Simult: controls whether each graph is drawn separately (one after the other) or whether they are all drawn at the same time, sweeping from left to right on the screen. My preference is to turn this off.
The default axis settings The default scale is displayed in the PLOT SETUP view shown right. It may seem a strange choice for axes but it reflects the physical properties of the LCD screen, which is 131 pixels wide by 63 pixels tall. A ‘pixel’ is a ‘picture element’ and means a dot on the screen. The default scale means that each dot represents a ‘jump’ in the scale of 0.1 when tracing graphs. The y value is determined by the graph, of course, and has nothing to do with your choice of scale.
The Menu Bar functions In the examples and explanations which follow, the functions and settings used are: Trace is quite a useful tool. The dot next to the word means that it is currently switched on. If yours isn’t then press the key underneath to turn it on. Leave it on for now. Press the left arrow 5 or 6 times to see a similar display to that shown right. Pressing up or down arrow moves from function to function.
Goto This function allows you to move directly to a point on the graph without having to trace along the graph. It is very powerful and useful. Suppose we begin with the cursor at x=0 on F1(X) as shown right. Press and then form shown right. to see the input Type the value 3 and press ENTER. The cursor will jump straight to the value x = 3, displaying the (X,Y) coordinates at the bottom of the screen.
The Zoom Sub-menu The next menu key we’ll examine is . Pressing the key under pops up a new menu, shown right. The menu is longer than will show in one screen, so two screen shots have been included to show most of the menu. The list which follows covers the purpose of each of the ten options shown right. The four extra options which follow these are covered as part of the detailed examination of the VIEWS menu on page 92.
Box… This is the most useful of the commands. When you choose this option a message will appear at the bottom of the screen asking you to Select first corner. The cursor positioned at one corner of a If you use the arrow keys to move the cursor to one corner of a rectangle containing the part of the graph you want to zoom into and then press ENTER, the message will change to Select second corner.
X-Zoom In/Out x4 and Y-Zoom In/Out x4 These two options allow you to zoom in (or out) by a factor of 4 on either axis. The factors can be set using the Set Factors… option, which gives you access to the view shown above right. You will also see a CHK mark next to an option called Recenter. If this is CHKed then the graph will be redrawn after zooming in or out with the current position of the cursor as its center. Changing the x factor is reflected in the the second screen snapshot.
The FCN menu Before continuing, set the axes back to the way we set them at the start of the section on the Menu bar. Looking at the menu functions again, you will see that the only one we have . This key pops up the Function not yet examined is the one labeled Tools FCN menu. Move to about this position. Before you use this key, make sure is switched on and move the cursor so that it is in roughly the position shown right. Root Press the key.
Intersection The next function tool in the menu is Intersection. If you choose this option, then you will be presented with a choice similar to the one in the screen shown right. Exactly what is in the menu depends on how many functions you have showing. In the case shown here we only have two, so the choice is of finding the intersection of F1(X), which is the one the cursor is on, with either the X axis, or the other function F2(X). The results of choosing F2(X) are shown right.
Signed area… Another very useful tool provided in the menu is the Signed Area… tool. Before we begin to use it, make sure that is switched on, and that the cursor is on F1(X) - the quadratic. The Signed Area… tool is similar to the Box Zoom in that it requires you to indicate the start and end points of the area to be calculated.
If you now press ENTER again to accept the end point, the hp 39g+ will calculate the signed area and display the result at the bottom of the screen. Calculator Tip It should be clearly understand that although the label at the bottom of the screen is Area it is a little misleading. What has actually been calculated is the definite integral (right), with ‘areas’ below the x axis included as negatives. This is why the label on the original menu reads “Signed area” instead of just “Area”.
Press and again, choosing Signed Area… as before. Use the left/right arrow keys key to move the cursor to x = -2. or the Press ENTER to accept the starting point. This time, choose the boundary as F2(X) instead of the x axis so that we will be finding the ‘area’ between curves instead of the area under one. Again, the result will be a signed area (definite integral) not a true area. See page 83 for a simple method of finding true areas. We now need to choose the end point.
Extremum The final item in the menu is the Extremum tool. This is used to find relative maxima and minima for the graphs. Ensure that is switched on and that the cursor is positioned on the cubic F2(X) in the vicinity of the left hand maximum (turning point) as shown right. Press and choose Extremum from the menu. You should find that the cursor will jump to the position of the maximum.
TIPS & TRICKS - FUNCTION Finding a suitable set of axes This is probably the most frustrating aspect of graphical calculators for many users and there is unfortunately no simple answer. Part of the answer is to know your function. If you know, for example, that your function is hyperbolic then that immediately gives information about what to expect. If you don’t have knowledge then here are a few tips: 1. Try just plotting the function on the default axes.
5. Another possible strategy for graphing which works quite well and, perhaps importantly, always gives ‘nice’ scales is to use ZOOM. ! Enter your graphs into the SYMB view. Remember that Auto Scale only works on the first ticked graph. ! Press VIEWS and choose Decimal, or press SHIFT CLEAR in the PLOT SETUP view. This will give you the default axes, probably not showing the graph very well. ! Place the cursor so that it is in the center of the area you are most interested in.
Composite functions The Function aplet is capable of dealing with composite functions such as f ( x + 2 ) or f ( g ( x ) ) in its SYMB view. The this. and keys are particularly helpful with For example, if we define F1( x) = x 2 − 1 and F 2( x) = x , then we can use these in our defining of F3, F4. See the screen shot on the left below. key If the highlight is now positioned on each of these in turn, and the pressed then the substitution is performed.
On the other hand there is a way to further simplify the expression. If you now the result and enclose it with the POLYFORM function as shown right (note the final ‘,X’), then highlight it and press , the hp 39g+ will expand the brackets and gather terms. Calculator Tip These functions can all be graphed but the speed of graphing is slowed if you don’t press first.
Differentiating There are different approaches that can be taken to differentiating, most of which are best done in the SYMB view of the Function aplet. The syntax of the differentiation function is: ∂X ( function) , where function is defined in terms of X. The function can either be already defined in the SYMB view of the Function aplet, or entered into the brackets as above. The ∂ symbol most easily obtained by pressing the key labeled d/dx.
The process is easiest in the SYMB view of Function. When done this way the result is algebraic rather than numeric. The best method is to define your function as F1 and its derivative as F2 (see below)… press …but you can also perform the whole process in one line. press then . As you can see the calculator’s algebraic abilities do not extend to differentiating f ( x ) = 2 x as f ′ ( x ) = ln ( 2 ) .2 x , but at least it is numerically correct.
The simplest way to deal with this is to use scales which are multiples of the default scales. For example by using −13 ≤ x ≤ 13 and −6.2 ≤ y ≤ 6.4 (scale factor 2). You can also use the ‘Square’ option on the ZOOM menu. This adjusts the y axis so that it is ‘square’ relative to the x axis chosen. The second issue is caused by the domain of the circle being undefined for some values. The screen on your calculator is made up of small dots called pixels and is 131 pixels wide and 64 pixels high.
However, for the scale of -6 to 6 the pixels are no longer 'nice' values of 0.1. If you try to trace the circle you'll see that the pixels fall on 0, 0.0923077, 0.1846154..... In particular, near x=3 the pixel values are 2.953846 and 3.046154. This means that the calculator can't draw anything past 2.953846 because the next value doesn't exist, being outside the circle. This is what causes the gap in the circle. There's nothing to join to past that last point.
Retaining calculated values When you find an extremum or an intersection, the point is remembered until you move again even if it is not actually on a value that would normally be accessible for the scale you have chosen. For example, if you find an intersection and then return to the menu and choose Slope, the slope calculated will be for the intersection just found rather than for the nearest pixel point. If you have recently found a root then key and entering the value Root will return the cursor to it.
Firstly, one can change the start value and the step size for the view. NumStart & NumStep For example, values of 10 and 2 give: Automatic vs. Build Your Own Looking at the NUM SETUP view you will see an entry called NumType: with the default value of Automatic. The only alternative to Automatic is the setting of Build Your Own. Under this setting the NUM view will be empty, waiting for you to enter your own values for X.
Pressing the key pops up the menu on the right. The first option of In causes the step size to decrease from 0.1 to 0.025. This is a factor of 4 and is changeable via the NUM SETUP view. I find a zoom factor setting of 2 or 5 to be more useful. The second option of Out causes the opposite effect, changing the step size upwards by whatever the Zoom Factor is set to. The Decimal option restores the default settings. It changes from whatever is showing back to the step size of 0.
Integration: The definite integral using the ∫ function The situation for integration is very similar to that of differentiation. The difference is that both the HOME view and the Function aplet require the use of a “formal variable” S1. As with differentiation, the results are better in the Function aplet. The ∫ symbol is obtained via the keyboard. The syntax of the integration function is: ∫ (a, b, function, X ) where: a and b are the limits of integration and function is defined in terms of X.
Integration: The algebraic indefinite integral Algebraic integration is also possible (for simple functions), in the following fashions: i. If done in the SYMB view of the Function aplet, then the integration must be done using the symbolic variable S1 (or S2, S3, S4 or S5). If done in this manner then the results are very good, except that there is no constant of integration ‘c’.
A caveat… This substitution process has one implication which you need to be wary of and so it is worth examining the process in more detail… x = S1 x3 ∫0 x − 1 dx = 3 − x x =0 S1 2 S13 03 = − S1 − − 0 3 3 3 S1 = − S1 3 The potential problem lies with the second line, where the substitution of zero results in the second bracket disappearing. This will not always happen.
Integration: The definite integral using PLOT variables As was discussed earlier, when you find roots, intersections, extrema or signed areas in the PLOT view, the results are stored into variables for later use. For example, if we use Root to find the x intercept of f ( x) = x 2 − 2 then the result is stored into a variable called Root, which can be accessed anywhere else. Similar variables called Isect, Area, and Extremum are stored for the other tools.
Suppose we want to find the area between f ( x) = x 2 − 2 and g ( x) = 0.5 x −1 from x = -2 to the first positive intersection of the two graphs. From the shaded screenshot shown above right it can be seen that to find the area we need to split it into two sections, with the boundaries being -2 and the two intersections. Intersection The shortcut here is to use to find the first intersection, storing the results into memory variable A.
Piecewise defined functions It is possible to graph piecewise defined functions using the Function aplet, although it involves literally splitting the function into pieces. For example: x + 3 f ( x) = x 2 − 2 3 − x ; x < −2 ; −2 ≤ x ≤1 ; x ≥1 To graph this we need to enter it into the SYMB view as three separate functions: F1(X)=(X+3)/(X < -2) F2(X)=(X2-2)/(X ≥ -2 AND X ≤ 1) F3(X)=(3-X)/(X ≥ 1) Note: AND can be found on the (-) key.
‘Nice’ scales As discussed earlier, the reason for the seemingly strange default scale of -6.5 to 6.5 is to ensure that each dot on the screen is exactly 0.1 apart. There are other scales, basically multiples of these numbers, that also give nice values if you want to along the graph. For example, halving each of -6.5 and 6.5 will place the dots 0.05 apart. To zoom out instead of in simply double the values, producing dots that are 0.2 apart.
This can be solved by changing the x axis scale to -6.4 to 6.4, which gives table values of 0.2. Using -3.2 to 3.2 is even better since it makes the graph ‘square’ again, with both axes proportional. Another good choice of scale for the Plot-Table view is -8 to 8, giving table values of 0.25. Basically any power of 2 is a good choice. Again, adding or subtracting a constant from each end of the axes will produce a graph where the y axis is not centred.
Problems when evaluating limits In evaluating limits to infinity using substitution, problems can be encountered if values are used which are too large. For example: ex x →∞ 2 e x + 6 lim It is possible to gain a good idea of the value of this limit by entering the function F1(X)=e^X/(2*e^X+6) into the Function aplet, changing to the NUM view and then trying increasingly large values. As you can see (right) the limit appears to be 0.5, which is correct.
The problem lies in the fact that the slow convergence will mean that people will often try to graph this function for very large values of x. The first graph on the right shows the graph of this function for the domain of 0 to 100. The second graph shows how instability develops in the domain 0 to 1E11 (1×1011 ). This apparent instability is caused by the internal rounding of the calculator.
Gradient at a point This can be introduced via the Function aplet. In the Function aplet, enter the function being studied into F1(X). To examine the gradient at x=3, store 3 into memory A in the HOME view as shown right. Return to the SYMB view, un-CHK F1(X) and enter the expression F2(X)=(F1(A+X)-F1(A))/X in F2(X). This is the basic differentiation formula with X taking the role of h and A being the point of evaluation.
Finding and accessing polynomial roots The POLYROOT function can be used to find roots very quickly, but the results are often difficult to see in the HOME view, particularly if they include complex roots. This can be dealt with easily by storing the results to a matrix. For example, suppose we want to find the roots of f ( x) = x3 − 3x2 + 3 . We will use the POLYROOT function and store the results into M1. The advantage of this is that you can now view the roots by changing to the Matrix Catalog.
THE VIEWS MENU In addition to the views of PLOT, SYMB and NUM (together with their SETUP views), there is another key which we have so far only used very fleetingly the VIEWS key. It may seem odd to devote an entire chapter to what might appear to be an inconsequential key. In fact, however, this button is very useful to the effective use of the calculator, and crucial if you intend to use aplets downloaded from the internet.
Plot-Detail Choosing Plot-Detail from the menu splits the screen into two halves and re-plots the graph in each half. The right hand side can now be used to without affecting the left screen. For example a Box zoom shows the result on the right allowing easy comparison of ‘before’ and ‘after’ views. The left hand graph is always the active one, with results of actions shown on the right.
Plot-Table The next item on the VIEWS menu is PlotTable. This option plots the graph on the right, with the Numeric view on the right half screen. Using the left/right arrow keys moves the cursor in both the graph and the numeric windows. See page 95 for information on how to keep nice scales in the table view. When more than one function defined in the SYMB view, pressing the up or down arrows changes the table focus from one to another. In this case, with only one, it centers the table.
Nice table values What makes this view even more useful is that the table keeps its ‘nice’ scale even while the usual ‘FCN’ tools are being used. As you can see in the screenshot left, the table is automatically repositioned to show the closest pixel value to that of the extremum found. The Signed Area… tool is also available in this view and when the cursor is moved the values in the table follow it.
Auto Scale Auto Scale is an good way to ensure that you get a reasonable picture of the graph if you are not sure in advance of the scale. After using Auto Scale you can then use the PLOT SETUP view to adjust the results. It is important to understand two points about how Auto Scale works. 1. It works by using the X-axis range that is currently chosen in PLOT SETUP to adjust the Y-axis range to include as much of the graph as possible. It will not adjust the x axis. 2.
Decimal, Integer & Trig The next option of Decimal resets the scales so that each pixel (dot on the screen) is exactly 0.1. The result is an X scale of −6 ⋅ 5 ≤ x ≤ 6 ⋅ 5 and a Y scale of −3 ⋅1 ≤ y ≤ 3 ⋅ 2 . This may not give the best view of the function. Personally I don’t often use it, as it is generally easier to go to the PLOT SETUP view and press SHIFT CLEAR. The Integer option is similar to decimal, except that it sets the axes so that each pixel is 1 rather than 0.
The default axes under the Trig option is −2π to 2π . If you are primarily interested in the first 2π of the graph then simply change Xmin to zero. Alternatively you can move the cursor to π (the middle) and then zoom in. The example below uses zoom factors of 2x2 with Recenter: ed. Calculator Tip In the graphs above the cursor is at x = π.
Downloaded Aplets from the Internet The most powerful feature of the hp 39g+ is that you can download aplets and programs from the internet to help you to learn and to do mathematics. Two quick examples of aplets that are available are shown here. More are listed in the supplementary appendix on “Teaching Calculus using the hp 39g+”. Notice that in each case the aplet is controlled by a menu.
THE PARAMETRIC APLET This aplet is used to graph functions where x and y are both functions of a third independent variable t. It is generally very similar to the Function aplet and so we will look mainly at the way it differs. An example of a graph from this aplet is: x(t ) = 5cos ( t ) 0 ≤ t ≤ 2π y (t ) = 3sin ( 3t ) which gives: Although it you can graph equations of this type, only some of the usual PLOT tools are present.
The effect of TRng The X and Y ranges control the lengths of the axes. They determine how much of the function, when drawn, that you will be able to see. For example… gives a graph of: whereas.. gives a graph of: Notice that in both cases, is on and shows the T value, followed by an ordered pair giving (X,Y). Unlike XRng & YRng, the effect of TRng is to decide how much of the graph is drawn at all, not how much is displayed of the total picture.
Calculator Tip ! Decreasing TStep beyond a certain point will only slow down the graphing process but not smooth the graph further. ! Since trig functions are often used in parametric equations, one should always be careful that the angle measure chosen in MODES is correct. The default for all aplets is radian measure. As usual, the NUM view gives a tabular view of the function. In this case there are three columns, since X1 and Y1 both derive from T.
TIPS & TRICKS - PARAMETRIC EQUATIONS Fun and games Apart from the normal mathematical and engineering applications of parametric equations, some interesting graphs are available through this aplet. Three quick examples are given below.
Vectors The Parametric aplet can be used to visually display vector motion in one and two dimensions. Example 1 A particle P is moving in a straight line. Its velocity v (in ms-1) at any time t (in seconds, t>0) is given by v(t ) = 2t 3 − 5t 2 + 2t − 3 . Illustrate its motion during the first 2.5 seconds. Enter the motion equation from (v) as X(T) and enter Y(T)=T. The only purpose of this second equation is to move the particle up the y axis as it traces out its path, thereby making it easier to view.
Example 2 Two ships are traveling according to the vector motions given below, where time is in hours and distance in kilometers. Illustrate their motion during the first ten hours. Ship A : Ship B : −100 20 x! A = + t 500 −30 200 −15 x! B = + t 400 −20 Enter the equations of motion as shown right. Now change to the PLOT SETUP view and set the axes to suitable values. Possible values are shown below. Now press PLOT to see the ships’ path appear.
THE POLAR APLET This aplet is used to graph functions of the type where the radius r is a function of the angle θ (theta). As with the parametric aplet, it is very similar to the Function aplet and so the space devoted to it here is limited mainly to the way it differs. Some examples of functions of this type, together with their graphs are: R1(θ ) = 4 cos(3θ ) R 2(θ ) = 0.
THE SEQUENCE APLET This aplet is used to deal with sequences, and indirectly series, in both nonrecursive form (where Tn is a function of n) and implicit/recursive/iterative form (where Tn is a function of Tn-1 ). Recursive or non-recursive Examples of these types of sequences are: (explicit/non-recursive) Tn = 3n − 1 ..... Tn = n 2 ..... Tn = 2n ..... {2,5,8,11,14,.....} {1,4,9,16, 25,.....} {2,4,8,16,32,.....} (implicit/recursive) Tn = 2Tn−1 − 1 ;T1 = 2 ..... Tn = 5 − Tn−1 .....
As they do, marks appear on all three, but any one does the same for all three. ing or un- ing Convenient screen keys provided There are a number of very convenient extra buttons provided at the bottom of the screen when entering sequences. and - are Two of these available as soon as the cursor moves onto the U(N) line (see right). Pressing either will enter the appropriate text into the sequence definition. The rest become visible once you have begun to enter the sequence definition.
The NUM SETUP view offers more useful features. Change to that view now and change the NumStep value to 10. If you then swap back to the NUM view you will see (as right) that the sequence jumps in steps of 10. In case you don’t realize… 2.1475E9 is 9 ‘computer speak’ for 2 ⋅ 1475 ×10 . Now go back to the NUM SETUP view and change the Automatic setting to Build Your Own by moving the highlight to it and pressing the + key or by using .
TIPS & TRICKS - SEQUENCES & SERIES Defining a generalized GP and the sum to n terms. If we define our GP using memory variables then it becomes far more flexible. The advantage of this method is that you now need only change the values of A and R in the HOME view to change the sequence. Defining a series (sum to n terms of a sequence) is fairly straightforward using a similar method. Note the reference to U1 in the definition of U2. Once U2 is defined in this way you can change both U1 & U2.
Population type problems are also easily dealt with in this way. For example, “A population of mice numbers 5600 and is growing at a rate of 12.5% per month. How long will it be until it numbers more than one million?” Pressing CLEAR (above DEL) clears out the existing expressions, and I can enter my formula. The two values of 5600 and 6300 are automatically calculated. All we need do now is switch to the Numeric view to find, with some experimenting, that U1(46) is the first to exceed one million.
Modeling loans I need to see the progress of a loan of $10,000 at a compound interest of 5.5% p.a., starting Jan. 1 1995, with a quarterly repayment rate of $175. Set up U1 and U2 as shown above. You can now follow the progress of the loan, with U1 containing time and U2 the amount owing at the start of each time period, showing it is repaid during the first quarter of 2023.
THE SOLVE APLET This aplet will probably rival the Function aplet as your ‘most used’ tool. It solves equations, finds zeros of expressions involving multiple variables, and even involving derivatives and integrals. Equations vs. expressions To ensure that we are using the same terminology, let's define our terms first. An equation includes an = sign, and can usually be solved: v 2 = u 2 − 2ad b a + 3 …are all equations. +1 = c d x 2 − 6 x + 5 = 0 y = x2 eg.
Suppose you had the problem: “What acceleration is needed to increase the speed of a car from 16 ⋅ 67 m/s (60kph or ~38mph) to 27 ⋅ 78 m/s (100kph or 60mph) in a distance of 100m (~110 yd)?” We’ll assume that you have already entered the equation into E2 (as above) ed. and have made sure that it is Solving for a missing value If you press NUM to change to the NUM view, you will see something similar to the screen on the right.
Multiple solutions and the initial guess Our first example was fairly simple because there was only one solution so it did not much matter where we began looking for it. When there is more than one possible answer you are required to supply an initial estimate or guess. The Solve aplet will then try to find a solution which is ‘near’ to the estimate. Example 1 The volume of a cylinder is given by V = 2π r ( r + h ) . Find the radius of a cylinder which has a volume of 1 liter and a height of 10cm.
Graphing in Solve In the SYMB view, enter the equation Y=X^3-2X2-5X+2 into E1. In the NUM view, enter the known value of Y=1, ensure that the highlight is on X, making it the active variable, and then press PLOT. The PLOT view shows two curves. The horizontal line is the left side of the equation which, when the known value of Y=1 is substituted, forms a constant straight line. The other curve is the right hand side of the equation which, since X is the active variable, forms a cubic.
Referring to functions from other aplets The Solve aplet can be used in conjunction with any of the functions available through the MATH menu, and can also reference any equations or functions defined in other aplets. Example 3 a “Find a so that Set E1 to: ∫2 x 3 − x dx = 4 ” ∫ ( 2, A, X ^ 3 − X , X ) = 4 In the NUM view, set A to an initial guess of 3, and position the highlight on A. Ignore X since it is not really involved except as a temporary variable during the integration.
A detailed explanation of PLOT in Solve The PLOT view in the Solve aplet is a little more complex than most others, since the active variable (x, t, theta etc) changes according to the value for which you are trying to solve. As an example, we will enter the equation A * B 2 + C = ⋅5* B into E1. Suppose that we know the values of A and C but need to find B. Now change to the NUM view and enter the values shown right. Ensure that the highlight is on B as shown and then press PLOT.
Move the cursor near to the left hand intersection and then change back to the NUM view. When you do so, the approximate value you chose with the cursor is transferred as your first ‘guess’. and you will see the hp 39g+ Now press find the nearest solution to your guess. Finish by pressing to verify that the solution is valid. See page 114 regarding this. Obviously the next step is to change back to the PLOT view, move the cursor near to the second intersection and for that one too.
The meaning of messages On pages 115, the values used were V= 27 ⋅ 78 , U= 16 ⋅ 67 and D=100 and we were solving for A. Thus: became: v 2 = u 2 − 2ad 2 2 ( 27 ⋅ 78) − (16 ⋅ 67 ) + 2 × a ×100 = 0 when substituted. ‘Zero’ - The calculator tried to find a value of A which made this zero and, in the message shown above, it is reporting that it succeeded.
TIPS & TRICKS - SOLVE Easy problems Have you ever thought “There has to be an easier way!” when confronted in a test with something like: ( x − 1) − 1 = 2 − ( 3 − x ) 3 9 4 If you’re sure there is only one answer to a problem, as there is in this case, then solving it is simply a matter of entering the equation into the SYMB view and solving it. Harder problems When you know or suspect that there is going to be more than one solution to a problem then the PLOT view can help you to obtain estimates.
THE STATS APLET - UNIVARIATE DATA One of the major strengths of the hp 39g+ is the tools it provides for dealing with statistical data. The Statistics aplet and its companion the Inference aplet provide very powerful yet easy to use tools with which to analyze statistical data.
Looking at the bottom of the screen you will see a series of tools provided for you. is not really worth bothering with. It is generally easier just to retype a number than it is to press and then use the arrow keys and DEL to change it. Sorting data The key labeled inserts space for a new number by shifting all the numbers down one does exactly what it says… it space. sorts the data into ascending or descending order.
Functions of columns Let's create a second column of data, and cheat by making all its values double the values in the first column. We can use the HOME view to avoid having to retype the values as follows… * Change to the HOME view and type the command shown right, then press ENTER. * Press the NUM key to change back to the NUM view. You should find your new column created and ready. If you now use the key, you will find that you still only see statistics for the first column (H1).
You may be wondering why the SYMB view is organized around histograms H1, H2..H9 rather than simply around the columns C1, C2..C9. The reason is that it allows you to easily cope with a frequency table by setting up one column to represent values and another to represent the frequencies. If not using a frequency table, the frequencies are normally set, by default, to 1 as can be seen on the previous page. Working with frequency tables Let's set up columns C3 and C4 to represent the table below. xi freq.
Plot Setup options The setting of Statplot controls what type of graph is drawn. There two choices are Hist (short for histogram) or BoxW (Box and Whisker). Pressing the + key while Statplot is highlighted will switch between these two, or you use the key to pick from the menu that pops up. Box and whisker graphs Unlike histograms, it is possible to have more than one box and whisker graph plotted. This makes comparisons between data sets very easy.
The effect of HRng The effect of HRange is rather different. It controls what range of data is analyzed in calculating the frequencies, and is normally set automatically to be the maximum and minimum values for the data. For example H1 (shown right) has an HRange of -2 to 7. If I go into PLOT SETUP and change this to 0 to 7 then the graph loses the left hand column representing the value of -2. The advantage of this is that it allows you to eliminate outliers from your graph quite easily.
However this can be fixed by using the setting HWidth. This variable controls the width of the columns, with the initial starting value and end value set by HRng. The PLOT SETUP views shown above will produce the graph shown below.
TIPS & TRICKS - UNIVARIATE DATA New columns as functions of old You have already seen the use of one trick when we created a new column C1 by storing 2*C1 into C2 using the HOME view. This can easily be extended to create new columns as functions of any number of others. For example, a set of data that you suspect is exponential could be ‘straightened’ by storing LN(column) into a fresh column. Changes of scale and origin can be investigated in this way by storing (say) -2*C1 + 3 into C2.
The expression INT(RANDOM*6+1) will simulate one roll of the die. This means that MAKELIST(INT(RANDOM*6+1),X,1,500,1) will simulate 500 rolls of a normal die. We therefore need only store the resulting list into a Statistics aplet column to analyze and graph it. This is shown in the series of screen shots to the right.
Example 4: Simulate 100 obs. on a normal N(µ=80, σ2=50). Ensure that MODES is set to radian measure and type: MAKELIST(80+ 50*( (-2*LN(RANDOM))*sin(2*RANDOM)), X,1,100,1) C2 Example 5: Simulate 50 obs. on an exponential distribution (mean = 2). In the HOME view type: MAKELIST(-2*LN(1-RANDOM),1,50,1) C2 As an illustration, the result of this particular simulation is shown graphically on the right. Its mean turned out to be 2.067 (3 decimal places.).
THE STATS APLET - BIVARIATE DATA As mentioned in the Univariate section, one of the major strengths of the hp 39g+ is the tools it provides for dealing with statistical data. Unlike the others, the Statistics aplet begins in the NUM view which offers easy input and editing of values, while the SYMB view is reserved for specifying which columns contain data and which ones frequencies, as well as for indicating pairing of columns for bivariate data. Uni vs.
Move the highlight into column C1 and enter the xi values, pressing the ENTER key after each one. Now do the same for the yi values in C2. Entering data as ordered pairs Looking at the bottom of the screen you will see a series of tools provided for is not worth bothering with. you. As before, Calculator Tip You can enter the xi and yi data into both columns simultaneously if you enter it as ordered pairs in brackets. i.e. as ( 1 , 5 ) ENTER ( 3 , 10 ) ENTER etc.
If you have more than one data set displayed on the screen then the up/down arrows move from one set to the other, unless the fit line is also showing in which case the behavior is slightly different. Information is given later on how to display the fit curve and to choose the type of curve. key produces a list of further options. The key labeled As usual, the inserts space for a new number by shifting all the numbers down one space.
Choosing from available fit models On the hp 39g+ the Statistics aplet is the only one which has a SYMB SETUP view, and even then only in mode. This view is supplied to allow you to specify what type of fit equation is to be used.
This may seem to be a useless model but it can be quite useful. For example, suppose you had collected a set of data using a data logger and a motion detector which you suspected might represent simple harmonic motion. There is no trig model supplied in the list of models built-in but some work and experimentation may allow us to find a valid model and test its fit. If we change into SYMB SETUP view and select User Defined and then change back to SYMB view then we can insert our model as the fit curve.
Calculator Tip If you have trouble seeing the small dots that the hp 39g+ uses in its scatter-graphs by default then you will be interested in the settings circled on the right. If you move the highlight onto the mark for the data set you are using and press then you will see the menu shown right from which you can choose a different mark. The contrast is illustrated below. Two Variable Statistics As with univariate statistics, summary statistics are available through the key in the NUM view (see right).
Enter the data into the NUM view and then switch to the SYMB view. Make sure that S1 (data set 1) is set to C1 and C2, ed, and that the fit is linear. If not, the fit can be changed in the SYMB SETUP view. Now change to PLOT SETUP view and set the axes to be as shown right. From the NUM view, press the in the two screens shown below. key and you will obtain the results listed Calculator Tip Make sure that your data set is defined and ed in the SYMB SETUP view before you try to obtain these results.
In the SYMB view (see right) the equation is given to so many decimal places that it doesn’t fit onto the screen. The simplest way to see the entire equation is to position the highlight on the equation and press the key. When you do you will obtain the view seen right which gives the equation of the line of best fit as yˆ = 0.8199 x + 1.1662 . With a correlation coefficient of 0.7829 (from the summary stats seen previously) this would probably not be regarded as reliable.
We can make predictions from our line of best fit in two places - the HOME view and the PLOT view. The hp 38g was able to do this only from the HOME view. Predicting using PREDY In the HOME view we use the functions PREDY and PREDX from the Stat-Two section of the MATH menu. The functions PREDX and PREDY use whatever was the last line of best fit calculated. It is up to you to ensure that the one you want used was the one last graphed.
There are two methods of dealing with this. The first is to use another measure of goodness of fit. The second is to ‘linearize’ the data (discussed below). The hp 39g+ provides an alternative measure of goodness of fit via the RelErr value in the view. RelErr as a measure of non-linear fit n ( yi − yˆ )2 ∑ i =1 RelErr is defined as the measure of the relative error RelErr = n yi2 in predicted values when compared to data values, ∑ i =1 and has the formula shown right.
The curve which results in the PLOT view is exactly what is required and the equation comes out as Y = 1 ⋅ EXP (0.693147 X ) This “EXP(“ is the calculator’s notation for Y = 1⋅ e0.693147 X which then changes to Y = 2 X . key shows that the correlation is unchanged at 0.9058 Checking the even when the new equation clearly fits the data perfectly. The value of RelErr on the other hand has changed from 0.09256 for the linear fit, to a value of zero for the exponential model.
TIPS & TRICKS - BIVARIATE DATA New columns as functions of old As with univariate statistics, you can use functions of old columns as new sets of data. See the Univariate version of this section for two different ways of doing this. For example, a set of data (C1,C2) that you suspect is exponential could be straightened by setting up S2: as (C1,LN(C2)). The effects of changes of scale and origin on data and summary statistics can be investigated in this way by storing (say) -2*C2+3 into C2.
As you can see on the right, the values of the mean and standard deviation are given in the screen to 12 significant digits. If we now switch to the HOME view, we can recall these values and use them in a calculation to find the upper and lower cut off points for acceptance of data. As you can see on the left, the range for acceptance is -3.46 to 10.38, which makes the value of 55 almost certainly an error. There are two ways to obtain these values.
Obtaining coefficients from the fit model Coefficients can be obtained from the chosen fit model algebraically. The function PREDY from MATH gives a predicted y value using the last line of best fit that was calculated.
Correct interpretation of the PREDX function The PREDX function in the MATH menu simply reverses the line of best fit. For example, the equation Yˆ = 0 ⋅ 8199 X + 1 ⋅1662 earlier would use (Y − 1.1662) to predict the X values. Xˆ = 0.8199 Whether this is mathematically correct depends on how you interpret the PREDX function. If, as HP intended, you interpret it to mean “give me an x value which, if used in the PREDY function, would give me this y value”, then it is correct.
Assigning rank orders to sets of data It is occasionally handy to be able to assign rank orders to a set of data. You might be running a Quiz Competition Night, or recording times for the 100 meter sprint, but in either case it is handy to be able to sort the data into descending order and assign rankings. This is easy for small sets of data, but becomes difficult for larger sets.
Using Stats to find equations from point data eg. 1 Find the equation of the quadratic which passes through the points (1,5), (3,15) and (-5,71). In the Statistics aplet, choose mode and enter the data. Now change to the SYMB SETUP view and choose the Quadratic data model. Change to the PLOT view using the VIEWS Auto Scale option and press the key. Don’t worry that the scale is not good because we don’t care about the graph. It only needs to be drawn in order to calculate the fit equation.
Either use the VIEWS Auto Scale option, or change to the PLOT SETUP view and adjust it so that it will display the data. This is not really needed, since the line of best fit is what we need and it will be calculated even if the data doesn’t show. Now change to the PLOT view and press Wait while the line draws. . Change to the SYMB view, move the highlight to the equation of the regression line and press . Rounded to 4 dec. places, this gives an equation of N = 13 ⋅ 8950 e0⋅6579t .
THE INFERENCE APLET This aplet is a very flexible tool for users investigating inference problems. It provides critical values for hypothesis testing and confidence intervals, and does this not only quickly but in a visually helpful format. Before we look at the Inference aplet in detail I am going to take a small digression to look at a simple inferential problem which can be solved using only the Statistics and Solve aplets.
The values can be seen by changing to the NUM view. In the MATH menu, Probability section, there is a function called UTPC (Upper-Tailed Probability Chi-squared) which will give the critical X2 probability for a supplied number of degrees of freedom and a value. See page 283. In this case we would like the value for a given probability so we will enter the formula into the Solve aplet. Change to the NUM view, enter the known for parameters of D=4 and P=0.05, and 2 the critical X value.
Choose the test and the alternate hypothesis in the SYMB view of the Inference aplet. In this case we are working with a single sample and we do not know the standard deviation of the underlying population, so we will use the Student-t test and the alternate hypothesis that the mean of the real underlying population from which the sample was drawn is not equal to that of the proposed underlying population. Change now to the NUM SETUP view to enter the required values. Rather than entering key.
The test value for the Student-t and the sample mean are listed in the middle of the screen and the rough position of these values is shown by a vertical line in both the upper and lower diagrams. The regions for rejection of the null hypotheses are shown at the very top of the screen by the ‘ R’ and ‘R ’. We assume, by statistical theory, that the distance ( x − µ ) is normally distributed. If the null hypothesis is true then the mean of this new distribution should be zero.
As before, a more visual display can be seen in the PLOT view. Thus the sample data indicates in our two examples that: ! we can be confident the average number of matches is not 50 with less than a 5% chance of being wrong, and ! we can conclude, with a confidence of 95%, that the true average number of matches is between 50.16 and 52.44.
We are dealing with two independent samples in this case and so we need to choose from those tests which involve two samples. Since we know the standard deviations of only these samples, we must again use a Student-t test. We then change to the NUM SETUP view to import the summary statistics.
Hypothesis test: Z-Test 1-µ A teacher has developed a new teaching technique for hearing-impaired students which he believes is producing significantly better results. He wishes to publish a paper on this and needs to check his results statistically. A standardized test is available for which it is known that the normal performance of hearing-impaired students at the same stage of study has a mean of 53.6% and a standard deviation of 12.2%.
Enter the values for the mean and standard deviation of the standardized test, and the significance level of 0.05 (5%). If we now change to the NUM view we can see that the test z score is less than the required critical z*, and the probability of obtaining a mean of the value found is 0.1080, which is larger than the required test value of 0.05. In the PLOT view, we can see visually that the vertical line representing the sample mean is not within the region of rejection marked by the R .
TIPS & TRICKS - INFERENCE Importing from a frequency table The import ( ) facility of the Inference aplet has a small weakness in that it can’t import from paired columns defining a frequency table. For example, suppose we use columns C1 and C2 to define a frequency table, ensuring that it is registered in the SYMB view as shown right.
Now change into the Program Catalogue and the program you created. Assuming that it has no errors you will see a running count as it creates the new column. This is just to give you something to watch while it works. If you then change to the NUM view you will find that column C0 contains the result. You can now import that column’s mean and standard deviation into the Inference aplet. After you have used the column you will probably also want to delete columns C8, C9 and C0 to save space.
THE FINANCE APLET This aplet is designed to allow users to solve time-value-of-money (TVM) and amortization style problems quickly and easily, as well as ordinary compound interest problems. Compound interest problems involve bank accounts, mortgages and similar situations where “money earns money”. TVM problems involve the use of the idea that the value of money changes with time - a dollar today is worth more than the same dollar some years from now.
PV - This is the present value of the initial flow of cash. In a loan, this is the amount of the loan. In an investment, the amount invested. PV is always the amount at the start of the first period, however long that may be. PMT - This is the size of the periodic payment. The assumptions made are that all payments are the same size and that no payments will be skipped. Payments can occur at the beginning or the end of a compounding period, depending on the setting of Mode.
Annuity An engineer retires with $650,000 available for investment. She invests the money in a portfolio which is expected to have an average return of 5% per annum. She wants to have the account pay a monthly income to her and asks the accountant to assume that the income must last for 20 years. What income can be withdrawn? The PV for this problem is negative because, from the point of view of the engineer, the money flow is outward from her to the investment portfolio.
Amortization The second page of this aplet allows amortization calculations in order to determine the amounts applied towards the principal and interest in a payment or series of payments. Suppose we borrow $20,000 at an interest rate of 6.5% and make monthly payments of $300. The initial situation is as shown in the screen on the right. Press the button to change to the amortization screen. The initial appearance is as shown. As can be seen, the default number of payments to amortize over is 12.
THE QUAD EXPLORER TEACHING APLET Rather than being a multi-purpose aplet, this is a teaching aplet specialized to the single use of exploring graphs of quadratics. Objectives Using the Quadratic Explorer aplet, the student will investigate the behavior 2 of the graph of y = a ( x + h ) + v as the values of a, h and v change. This can be done both by manipulating the equation and seeing the change in the graph, and by manipulating the graph and seeing the change in the equation.
As can be seen in the screen shots right, the bottom half of the screen shows the roots (if any), the value of the discriminant and the equation in the form y=ax2+bx+c. The key labeled changes the ‘step size’ of the movements on the screen. Possible values for the increment are 0.5, 1 and 2. Pressing SYMB on the calculator, or the screen key labeled will change the emphasis from the graph to the equation in the right hand half of the screen.
The + and - keys are disabled in mode, since their effects are controlled instead by the ↑ and ↓ keys once the highlight is on the ‘a’ coefficient. The (-) key controls the sign of ‘a’. Self test mode The final key is labeled . This key will present the student with a series of graphs for which they must supply the equation. The type of graph is governed by the current setting of .
THE TRIG EXPLORER TEACHING APLET Rather than being a multi-purpose aplet like most of the others covered so far, this is a teaching aplet specialized to the single use of exploring the graphs of trigonometric functions. Objectives Using the Trig Explorer aplet, the student will investigate the behaviour of the graph of y = a sin(bx + c) + d as the values of a, b, c and d change.
The operation of the two modes is summarized below. PLOT mode The underlying concept in PLOT mode is that the graph controls the equation. The user has control of the graph via two manipulation points (see above and below) and any changes to the graph are reflected in the equation at the top of the screen. Looking at the screens on the right it will be seen that the third screen key toggles the point of control for the graph. It is only visible in PLOT mode.
The c coefficient is shown as a multiple of π in radian mode rather than as a decimal. The currently active coefficient is highlighted and can be changed using the up/down arrow keys in increments of 0.1 for the coefficients a, b and d. The default increment for c is π 6 but this can be changed using the key labeled to π π either 9 or 4 . When in mode, the increments are 20o, 30o or 45o with 30o being the default. The ranges of values available for the four coefficients are shown below: Coeff.
USING MATRICES ON THE HP 39G+ The hp 39g+ deals very well with matrices. It offers many powerful tools as well as a special MATRIX Catalog with full editing facilities. The MATRIX Catalog The MATRIX Catalog is entered by pressing the MATRIX key (located above the 4). It allows for the storage of ten matrices (M1,M2,..M9,M0) which can be any size, depending only on available memory. In the example shown right, the catalogue contains two matrices, a 3 x 3 and a 3 x 1.
If you look at the list of screen keys on the bottom of the view, you will see one labeled . This determines which way the highlight will move (across or down) when you enter a number. If you press the key repeatedly you will see it change from (across), to (down), to (no movement). You will also see the usual key, and an key that can be used to insert an extra row or column into an existing matrix. The keyboard DEL key can be used to delete a row or column.
Another method is to store the result into a third matrix and then to view it through the Edit screen of the MATRIX Catalog. This is shown below. Matrix M3 is created left and edited right. Probably the most common functions that you will use are INVERSE, DET and TRN (transpose), so some worked examples are included which use them. There are also a number of further worked examples involving matrices in the section at the back of the book. Solving a system of equations Eg.
The method for doing this on the hp 39g+ is as follows… Step 1. Enter the MATRIX Catalogue. Use SHIFT CLEAR to erase all matrices. Step 2. Enter the 3x3 matrix of coefficients in M1. Step 3. Enter the 3x1 matrix of into M2. in order to Note the change to make entering numbers easier. Step 4. Change to the HOME view, evaluate A−1 × b using any of the following three methods (all of which are acceptable to the hp 39g+), and store the result into M3.
Finding an inverse matrix Eg. 2 Find the inverse matrix A −1 2 1 4 for the matrix A = 1 1 3 −2 4 −1 The first step is to store the matrix A into M1. If you now simply store its inverse into M2 you will find, depending on the determinant, that the result is probably a collection of decimal values (see right). While correct, this is hardly the best way to display the answer. The fact that the determinant is incorporated into the inverse makes whole numbers unlikely.
The dot product Eg. 4 Find the angle between the vectors a = (3, 4) and b = (4,1) . Using the formula that 5 4 (3,4) 3 2 θ 1 -5 -4 -3 -2 -1 -1 -2 -3 1 2 3 a • b = a . b .cos θ (4,1) 4 5 where a • b is the dot product, we can rearrange to obtain: a•b cos θ = a.b -4 cos θ = -5 Therefore: = (3, 4) • (4,1) (3, 4) . (4,1) 3 × 4 + 4 ×1 32 + 42 . 42 + 12 16 = 5 17 θ = 39 ⋅ 09" On the calculator, the functions DOT and ABS give the dot product and magnitude respectively, when fed with vectors.
USING LISTS ON THE HP 39G+ A list in the hp 39g+ is the same mathematically as a set. As with a set, it is written as numbers separated by commas and enclosed with curly brackets. Eg. {2,5,-2,10,3.75} The list variables Using the HOME view these lists can be stored in special list variables. There are ten of these L1,L2,..L9,L0. Eg. {2,5,-2,10,3.75} L1 Operations on lists Typing L1 and then ENTER will then retrieve the list.
There are also a number of special functions available for list variables which are contained in the List group of functions in the MATH menu. See page 265. List functions A special List Catlogue is provided which allows easier entering and editing of lists. If you look above the 7 key you will see a label of LIST which gives you access to this catalog. When you enter this catalog you will see the screen on your right.
USING THE NOTEPAD CATALOG The hp 39g+ provides access to Notes which can be either attached to an aplet or created as independent notes for any use. The notes belonging to the standard aplets are blank unless you add to them, but copies you transfer from another calculator may have had notes added to them. In particular, any special aplets you download to your calculator from the internet (perhaps via a teacher) may have instructions as a note and/or perhaps a sketch. Aplet notes vs.
If you the menu and press NOTE then you would see the Note attached to the aplet. This is common with these aplets. Since they are non-standard, the author ensures you have some instructions, although most of the documentation is generally in a Word® or PDF® document that comes with the aplet. This particular set of notes consists of a number of pages, but most are not that extensive.
Transferring notes using IR Notes can be shared between friends since they can be transmitted over the infra-red link in the same way as can be done for aplets, lists, matrices and programs. It is worth pointing out that this will not help you in a test situation, since the strength of the infra-red link in the hp 39g+ is such that it will only operate over extremely short distances.
Software For the hp 38g, hp 39g & hp 40g The HP Connectivity Kit, called HPGComm, is discussed in detail on page 204. It allows users to transfer aplets and all other HP objects such as notes from calculator to PC via the serial port. It does not let you edit them in any way. However there is also a free piece of software called the Aplet Development Kit available over the internet from HP’s web site (http://www.hp.com/calculators) or The HP HOME view (at http://www.hphomeview.
Creating a Note Let’s create a small Note containing some commonly used formulas. Press SHIFT NOTEPAD (not SHIFT NOTE ) and you will see the Notepad Catalog shown right. Yours will probably be empty. The keys at the bottom of the screen allow you to an existing Note, one or to and Notes to or from another hp 39g+ (or create a a computer). A Note is deleted using the DEL key, while the SHIFT CLEAR key will delete all Notes in the catalog. Press the key to begin a fresh Note.
Use the keys discussed above to type in the screen shown on the right. The arrow keys can be used to move around in the text and insert or delete characters. The CHARS view In this case we don’t need it as all the characters are on the keyboard, but you should remember that additional characters can be obtained through the CHARS view. The three pages of the CHARS view are shown below. As you can see, there are many special characters available for use.
USING THE APLET SKETCHPAD If you have not already done so, read the previous chapter. As is explained there, every aplet has associated with it a Sketch, consisting of up to ten pages. It can be viewed by pressing SKETCH, which is located above the VIEWS key. Sketches for the standard aplets start blank but you may find that an aplet that you download from the Internet will have a Sketch attached. Remember a Sketch is always attached to an aplet, so changing aplets makes it inaccessible.
There are two font sizes available via the key, with the default size being large. If you press the key then it will change to . Although there is no apparent change when you are typing in the text, the font will become smaller when it appears in the window. Only uppercase is available in this small font. New sketch pages can be produced by pressing the The DRAW menu The key gives access to a slightly enlarged menu of simple drawing tools.
CIRCLE The circle command is similar. You should position the cursor at the center of the proposed circle. Pressing , move the cursor outwards from the center, forming a radius. As you do so you will see a small arc appear, giving you an indication of the curvature of the circle. Pressing the circle. Finally, press (or ENTER ) will then complete to leave the drawing tools view. Cut and paste (sort of…) key you can capture part of the Using the screen and store it into any of ten graphics memories G1,G2.
Move down through the menu until you reach Graphic and across to the particular GROB you chose. Now also press the key labeled and then press . You will now find yourself back in the graphics screen with a rectangle representing the size of the GROB to be pasted in. Move the rectangle to the desired position and press . The GROB will appear.
Having pasted it into the Sketch page, you can now modify it by adding text and other information. One has to question however whether the time needed to do this and the crudity of the result make the whole process worthwhile. If you’re intending to do this to produce a set of ‘cheat notes’ for your next test or exam, you would do better to spend the time studying! Calculator Tip The screen capture facility demonstrated here can be used to capture any screen as a GROB, not just a PLOT screen.
USING, COPYING & CREATING APLETS Before you read this chapter, you should be reasonably familiar with the majority of the built-in aplets. As has been discussed before, the designers of this calculator provided a set of standard aplets for you to use, changing the capabilities of the calculator as you change aplet. These standard aplets will cover most, if not all, of your requirements but to a certain extent you can also modify them to suit your needs and copy them for your friends.
Creating a copy of a Standard aplet. Imagine either of these two scenarios…. (i) you are a student and you have filled the Function aplet with a set of equations needed for tonight’s homework and set up the PLOT screen so that it looks exactly the way you want it to. Now you find that you need the Function aplet to do something else equally important which will mean wiping all that work.
Our student’s newly created copy of the Function aplet is now totally independent of its parent aplet. She can now (if she wants to) the original Function aplet back to factory defaults and go on with the extra work that she wanted to do. A saved aplet cannot be . Copying and adding to the Stats aplet Our second scenario had a teacher not wanting to waste the time that would be needed for his students to type in five sets of data.
Indeed, if the students have access to the Internet and a Connectivity Kit themselves, then there is no reason that the teacher could not post the aplet on the department’s web page for downloading by any students who need access. In both of these cases, the procedure has been to save a copy of one of the standard aplets under a different name.
E6: E7: E8: E9: E0: P=e^-(K*A)-e^(-K*B) P=UTPN(M, S2,X) P=1-UTPN(M,S2,X) P=UTPN(M,S2,A)-UTPN(M, S2,B) P=UTPN(M,S2,M-K)+ UTPN(M,S2,M+K) These formulas can be used in the NUM view to solve problems involving the probability distributions listed earlier. Details on use Equations E1 and E2 can be used for calculations involving individual and cumulative Binomial probabilities. eg. Find the probability of at most 3 heads when tossing a coin 10 times.
Equation E6 gives P ( a ≤ x ≤ b ) for an exponential distribution. Equations E7 to E0 concern the Normal distribution, with E7 giving P ( X ≥ x ) , E8 giving P ( X ≤ x ) , E9 giving P ( a ≤ x ≤ b ) and E0 aiding investigation of questions such as “what distance either side of the mean will give a probability of 0.45?”. Notes: (i) In equations E1 and E2, N!/((N-R)!R!) is used rather than the more compact formula COMB(N,R). Doing it this way allows the user to solve for N, whereas the second option does not.
The result is a triangle with corners at (1,1), (2,1) and (1,3), along with its image after reflection in the x axis. We can now matrix M1 so that it contains another matrix. For example: −1 0 0 1 To see the effect of this new matrix, simply return to the HOME view, the previous calculation and press ENTER. The new image will be stored into matrix M3.
To use a different shape you need only change the points in matrix M2. If your new shape has more than three vertices you will need to change the TRange values in the PLOT SETUP view. It is not a good idea to use shapes that are symmetrical, like squares, as it makes it harder to recognize transformations. Calculator Tip Warning: Due to a bug which existed in the hp 38g and hp 39g, this aplet cannot be sent from one hp 39g to another using the infra-red link.
Copying from hp 39g+ to hp 39g+ via the infra-red link. Any aplet can be copied from one hp 39g+ to another via the built in infra-red link at the top of the calculator. Indeed it is not only aplets which can be copied, but lists, notes, sketches, matrices and programs. Of the family of related models, only the hp 40g does not have this capability. The key to this ability is the presence of a and its companion screen key labeled key . This is shown in the APLET view on the right.
To send an aplet, both calculators should be showing the APLET view, with the highlight on the aplet you wish to send. Now press the key on the sending calculator and the key on the receiving calculator. On both screens you will see the pop-up list choices shown below. Ensure that the highlight is on HP39+ (IrDA). The other choices are: • HP39/40G (Wire) • Disk drive… Note that the calculators are not directly in line with each other.
Time out If you see a message saying that there has been a “Time-out”, it may mean that you did not line the calculators up precisely enough or pressed on one without pressing on the other. The first thing they do is say the electronic equivalent of “Hi there” to each other, and if there is no answer from the other machine within about 30 seconds, this is the message you receive. Calculator Tip The main cause of failure in communications is low batteries.
Apart from curiosity, there is one important respect in which you need to know about these programs, and that is when it comes time to delete an aplet. The helper programs must be deleted from the Program Catalog after deleting the main aplet in the APLET view by highlighting the aplet and then pressing the DEL key. For more information on this see page 207.
Generally you will be able to click on a link for each aplet and see a summary on screen, together with a link that lets you download that aplet as a ZIP file. A ZIP file is a special type of file which contains one or more compressed files. The reason for the compression is simply to allow you to download them from the Internet more quickly, and you should de-compress them as soon as you have them onto your PC or Mac. There are many programs which will de-compress ZIP files.
For example, at my school I set up a structure containing directories for each of the courses being run. In each of these directories I then set up further directories containing all the aplets which were relevant to that course. In many cases that involved storing copies of aplets in more than one place since some of them were relevant to more than one course.
Software for the hp 39g+ At the time of writing the hp 39g+ had only just been released and new software was in the process of being developed. An image of the current Windows version is shown right but the final version may differ in appearance, perhaps significantly. The hp 39g+ is sold with a cable included, unlike the earlier models. This cable lets it link to the USB port on a PC or a Mac.
The HPGComm Connectivity Program At this stage I will assume that you have an hp 38g, hp 39g or hp 40g and you have installed the Connectivity software on your computer and have run it. If you have an hp 39g+ then the software will be similar in behavior although the appearance of the screens may be different. See page 181. When you run the software you should see the screen shown above. If you receive the error message right then it means that the default serial port COM1 is unavailable.
The first task is to tell the program where to find the aplet. Press the Change Directory button and use the window that pops up to select the directory which contains the aplet you want to transfer to the calculator. Your program’s window won’t be the same as mine. At the top of the window you’ll see a message saying “Please choose a directory” and, once you’ve chosen a directory you should see “This directory contains hp 39g files” (if there are files there to be downloaded).
Using downloaded aplets If you press the VIEWS key on your hp 39g+ you will see a list of options which vary according to which aplet is currently active. The VIEWS menu for Function is shown right. Any aplet that has been created by a programmer, such as the Curve Areas aplet shown right, will generally have had its VIEWS menu modified by the person who created it. The new VIEWS menu is used to control the aplet, offering a series of choices.
Deleting downloaded aplets from the calculator As was mentioned earlier, most of the aplets you download will have ‘helper’ programs associated with them. These are stored in the Program Catalog. Apart from curiosity, there is one important respect in which you need to know about these programs and how to locate them, and that is when it comes time to delete an aplet. As you would expect, this is initially done in the APLET view by highlighting the aplet and then pressing DEL.
Saving notes, aplets and sketches via the Connectivity Kit The following information applies to the HPGComm program for the hp 38g, hp 39g or hp 40g. If you have an hp 39g+ then the software will be similar in behavior although the appearance may be significantly different (page 203). Sending aplets, programs, notes etc back to a computer is simply the reverse of the process covered so far. The only difference is that you need to create a directory to hold them first.
If the directory is currently empty, then the calculator will display the image shown right. Calculator Tip The meaning of the question about “Initialize directory?” is that the calculator has tried to find the two special files HP39DIR.000 and HP39DIR.CUR which tell it what files are in the directory and has, of course, been unable to retrieve them since it is an empty directory. It is asking if it can go ahead and create them itself. The program will respond with message shown right.
Capturing screens using the Connectivity Kit One of the most powerful abilities of the Connectivity Kit is its ability to capture images of the calculator screen. These images can be pasted into a document or into a Paint program for further processing. This allows teachers to create worksheets that include images of what the student should see. Students can create reports that include graphs and tables from your calculator. Any screen can be captured at any moment, even if it is only partially drawn.
A variation of this capture process is useful if you want to retain the image on your calculator. Pressing ON+PLOT stores the image into graphics object G0. This can then be pasted into a sketch using the VARS menu. From the Sketch view, press VARS and then key. Scroll down to the Graphics variables and select G0. Now the press and then ENTER. The image will be pasted into your sketch and you can then use the drawing tools to edit it. Using a Paint program is easier and quicker.
PROGRAMMING THE HP 39G+ The design process An overview Although you can choose to simply create programs which are self sufficient the whole point of working on the hp 39g+ is to use aplets. Hence this chapter will concentrate on the process of creating aplets with enhanced powers provided by attached ‘helper’ programs. The key to the entire process of creating completely new aplets is the VIEWS menu and its controlling command function SETVIEWS.
If your new aplet is going to be concerned with analyzing data then your best choice for a parent would probably be the Statistics aplet. On the other hand if you were planning to write an aplet to teach the behavior of graphs then the Function or Parametric aplets would obviously be best. All the tools of the parent are available to the child, so consider carefully what tools you require. Calculator Tip When designing aplets you should consider using the ADK as it makes the process far easier.
Planning the VIEWS menu It is very important to the usefulness of your aplet that you carefully plan the VIEWS menu to be clear, concise and user-friendly. It is possible to have sub-menus in the VIEWS menu by having your option call a program which then pops up another menu of options. This is usually denoted by an placing an ellipsis (…) following the VIEWS option, such as the one below. An example of the VIEWS menu from an aplet is shown right.
You should therefore also think about what you want the user to be looking at once the program they have triggered stops running.
The linking process performed by the SETVIEWS command (or by the ADK) is also important in that it tells the calculator which programs are to be transmitted with the aplet when it is copied via cable or infra-red link. Only those programs named in the SETVIEWS command (or linked by the ADK) will be transmitted. Special entries in the SETVIEWS command In addition to the lines which form the menu for your aplet, there are some special entries which are treated differently. i.
The ‘Start’ entry It is a very good idea to include a “Start” entry, since it will be automatically run when the user presses and it thus allows you to enter pre-set values in variables, or to pre-set axes, so that the aplet runs smoothly. Additionally, if you terminate the “Start” entry with a view number of 7 then as soon as the user runs the aplet the VIEWS menu will be displayed (it is view number 7). This makes the aplet more friendly since the controlling menu is the first thing the user sees.
Spend a moment to go through the code and ensure that you are clear in your own mind the menu it will create, the programs it will run, and the views it will enter after the running of each program. You will be told at a later stage in this example when to run this program and create the menu. We’ll now create the associated ‘helper’ programs (shown below). Their names/titles are supplied above the code for each one. .MSG.1 .MSG.
Swap back to the Program Catalog, position the highlight on the program .MSG.SV and the program. Apart from the screen going blank for a moment nothing will appear to happen, but in fact the link to the normal VIEWS menu which ‘Message’ inherited from its parent aplet Function has been severed and a link to the new menu you built in .MSG.SV has been substituted. Press VIEWS to check. Providing that you have done everything correctly, this is now the end of the process - the aplet is now ready to be run.
The next option in the menu is ‘Input value’. Choosing this option will create an input screen. The statement controlling this was: INPUT N;"MY TITLE";"Please enter N..";"Do as you're told.";20: Examine the snapshot on the right and notice the connection between the various parts of the INPUT statement and their effect. Note the suggested value of 20, and note also that the prompt of “Please enter N..” was too long to be displayed.
The final option is ‘Show function’. The program this runs is a little more complex than the ones shown so far and illustrates a useful technique. The line: '((X+2)^3+4)/(X-2)' ( x + 2) + 4 ( x − 2) F1(X): 3 stores the expression into the function F1(X). Notice the way the function is in single quotes so that the algebraic expression itself is used rather than its value when evaluated using the current contents of memory X.
Example aplet #2 If you haven’t already, read pages 194 which explain how to create a copy of the Parametric aplet to explore geometric transformations using matrices. We will now look at using programming to enhance this aplet by automating the process. Start by highlighting the Parametric aplet and . Now the aplet under pressing the new name ‘Transformer’. Press SHIFT NOTE (not NOTEPAD) and enter some explanatory text into the aplet’s Note view. You can use the text shown right.
.TRANSF.SHAPE .TRANSF.MAT This program (left) uses the CHOOSE command to offer a list of options. Note the need to pre-load a value into C. This value determines which option is highlighted when the menu appears. If a list has only three options but the highlight is set to some other value than those three then it can crash the program. Options 1 and 2 load preset matrices while option 3 allows the user to edit their own. Note the check to ensure the matrix they entered has a valid size.
In the next example we will use the Aplet Development Kit (ADK) to re-create the same ‘Transformer’ aplet used in example 2. This will allow us to concentrate on how to use the ADK rather than the aplet. The ADK runs only on Windows computers and was originally written for Windows 3.1. Because of this it does not understand long filenames or the Desktop and this makes it difficult to use at times. It may be that when you read this text new software will have been released by HP to supercede the ADK.
Click on “View 1” in the View List window. Change the prompt to “Change matrix”, the Object name to “.TRANSF.MAT” and the Next View to “7: Views”. In the main window, enter the code for this program (see Example 2). Special characters such as can be obtained from the button. We now must save the code. Click on the “View 2” entry in the View List window and the ADK will ask if you wish to save the code you entered for the first view. Tell it ‘Yes’ and a save dialog box will appear.
The final stage is to use the ADK to create the two special files HP39DIR.CUR and HP39DIR.000. In the File menu, choose Aplet Library. You will see a list of the programs and the aplet in the window labeled “Other files”. Click on each file in the right hand bottom window in turn to highlight it and then on the “Add <=” button to add it to the library files. You can only add files which are legitimate calculator files.
In the Note view, enter the text shown right. Our VIEWS menu will only have three entries, so use the View - Custom views… command to display the menu planner and press ‘Insert’ three times. Our VIEWS menu will be as shown below. The first entry should have a Prompt of ‘Plot axes’, an Object Name of ‘.LINEXPL.AX’ and a Next View of 1 (Plot view). The full code for each of the programs is given on the next page, and other settings are shown below and right.
Save the aplet and use the File - Aplet library facility to create the two special files for the directory which allow the calculator to download it. Finally, download it to the calculator and test it. Choose the first option on the VIEWS menu to plot the axes and then the ‘Explore’ option to explore the equation of a line. On the pages following we will examine the code in detail, as it illustrates many highly important techniques. Since it is the first program run we will look first at the program .
The 2nd and 3rd lines are there to insert a function. We need a function when the axes are plotted or the normal error message will be displayed (see right), which is undesirable as it confuses the user. On the other hand we need blank axes, so we use a function ‘Ymax+1’ which is guaranteed to be off-screen for the entire x axis range no matter what axes are used. Clever, eh? The next program code we will look at belongs to the 1st option on the VIEWS menu of ‘Plot axes’.
Still referring to the code on the previous page, you will see that it refers to PageNum. The sketches in the hp 39g+’s SKETCH view are numbered 1, 2, 3…etc. Sketch number 1 is always present but after that only sketches that have been created are available and the program will crash if you try to access one that does not exist. The aplet variable PageNum is the pointer to the sketch you want and the actual sketch is called Page.
The DISPXY command allows you to place a string of text at any position on the screen using two different fonts. Until this command was added to the language the only way to do this was to: - save the current screen into a graphics variable. create a special GROB which contained the text. superimpose the GROB onto the stored image. redisplay the modified image onto the screen.
If the left or right arrows have been pressed (keys 34.1 or 36.1) then the line is ‘twisted’ by changing the value of M. If the up or down arrows have been pressed (keys 25.1 or 35.1) then the line is raised or lowered by changing the value of C. See the manual for more information on the GETKEY and CASE commands and on key values. The final check in the line UNTIL K==105.1 END: is to see if the user has pressed the ENTER key. If so then the loop will terminate and the screen will erase.
PROGRAMMING COMMANDS All programming commands can by typed in by hand but, as with the MATH commands, can also be obtained from a menu. Press SHIFT CMDS to display this. In this section I will only be covering those commands which I have used regularly and so regard as important. These may not be the same as the ones you regard as important. If so, consult the manual. The Aplet commands These control aspects of the aplet.
SETVIEWS ;; This absolutely critical command is covered in great detail on page 214. The Branch commands IF THEN [ELSE ] END Note the need for a double = sign when comparing equalities. Any number of statements can be placed in the true and false sections. Enclosing brackets are not required. CASE …END: This command removes the need for nested IF commands but is only worth it if you have more than two or three nested IFs.
RUN This command runs the program named, with execution resuming in the calling program afterwards. If a particular piece of code is used repeatedly then this can be used to reduce memory use by placing the code in a separate program and calling it from different locations. See the SETVIEWS command for information on how to link a program to an aplet when it does not appear on the primary menu. Note that if the name has spaces in it then it must be enclosed in quotes.
ERASE This command erases the current display screen. FREEZE This command halts execution until the user presses any key. LINE ;;; This draws a line on the screen using (x1,y1) and (x2,y2) as the ends. The coordinates are relative to the current settings in the PLOT SETUP view. PIXON ; and PIXOFF ; This command turns a pixel point on or off at the specified point. The coordinates are relative to the current settings in the PLOT SETUP view.
The Graphics commands See the chapter “Programming the hp 39g+” on page 226 for examples illustrating some of the graphics commands used regularly. The Loop commands FOR = TO [STEP ] END This is a standard FOR…NEXT command. The STEP value is optional and is assumed to be 1 if not stated.
BREAK This command will exit from the current loop, resuming execution after the end of it. There is no GOTO
The Print commands These commands are supplied for use with the battery operated HP infra-red thermal printer that is designed for use with the hp 38g, hp 39g, hp 40g and hp 39g+. PRDISPLAY If you place this command in a program then the current display will be sent to the infra-red printer. PRHISTORY This command, whether issued in the HOME view or in a program, will send the entire contents of the History to the infra-red printer.
The Prompt commands BEEP ; This will use the piezo crystal in the calculator to create a sound of the specified frequency for the specified duration (in seconds). The resulting frequency is not terribly accurate, varying by up to 5% from one calculator to the next and depending also on the temperature. The frequencies of the twelve semi-tone jumps in the harmonic scale form a geometric sequence, and since the ratio from C to C' is 2, the ratio for each semi-tone must be 12 2 .
This value must be a valid one. Assigning an initial value outside the range of the menu may crash the program. If the user presses CANCL then a value of zero is returned but the program will still continue to execute from that point unless you include code to terminate it. DISP ; This command breaks the display up into 7 lines and allows output to them. Using the DISP command on a line wipes that entire line to the right hand end of the screen before display.
INPUT ;;;; This command puts up an input view which can be used to obtain responses from the user. The degree of control over appearance is quite high as can be seen in the example. If you want the default value to be whatever the user last input then use INPUT N;……..;N instead. If you do this then you will need to store and initial reasonable value into N before the first use of the INPUT command.
THE MATH MENU FUNCTIONS The MATH menu is accessed via the key below the APLET key. Any time that you are typing a value into any formula or setup screen you can insert mathematical functions via the MATH key. The MATH menu is divided up into sections by mathematical topics. These topics are: Real Stat-Two Symbolic Tests Trig Calculus Complex Constants Hyperb. List Loop Matrix Polynom. Prob. - rounding, roots, conversions and % functions. - bivariate functions.
We could use the arrow keys to scroll down to the Polynomial functions but it is far faster to simply press the key labeled with the letter ‘P’ (on the ‘5’ key). It is not necessary to press the ALPHA key first. You will notice in the screen on the right that there are two groups of functions beginning with a ‘P’ - being Polynomial and Probability. To reach Probability press the ‘P’ key again.
On the pages which follow we will look at most of the functions in each group. Some of the functions are not likely to be used at school level and so will not be covered since this book is primarily aimed at teachers and students of high school, as is the hp 39g+. If you need the higher level commands then consult the manual. You can obtain ‘help’ for any function in the HOME view by using the SYNTAX key to obtain the word HELPWITH and then typing the function name.
The ‘Real’ group of functions CEILING() This is a ‘rounding’ function but different in that it always rounds up to the integer above. Mainly of interest to programmers. Eg. CEILING(3.2) = 4 CEILING(32.99) = 33 CEILING((12+ 6)/7) = CEILING(2.0642…) = 3 Note: CEILING(-2.56) = -2 not -3. The CEILING function rounds up to the next integer above, which is -2. See also: ROUND, TRUNCATE, FLOOR, INT DEG RAD() This function converts degrees to radians. Eg. DEG RAD(30) = 0.5235… DEG RAD(180) = 3.
FNROOT(express.,guess) This function is like a mini version of the Solve aplet. If you feed it an algebraic expression and an initial guess it will start from your guess and find the value which makes the expression zero. Don’t bother. It’s a lot easier to use the Solve aplet. This is a tool for programmers so that they can access the Solve abilities within programs. You need to tell it what variable to expect in the expression, in addition to providing it with an initial guess.
HMS (dd.mmss) This function works with time and angles. It converts degrees, minutes and seconds to degrees, and also hours, minutes and seconds to decimal time. The calculator can convert a value such as 45" 23′17′′ if you put it into the form 45.2317 and then use the HMS function. Eg. sin( 45" 23′17′′ ) would be done as SIN(HMS (45.2317)) " cos( 5 3′7′′ ) would be done as COS(HMS (5.0307)) This function, together with HMS, can also be used to deal with time. Eg. What time will it be 1 hr 34 min.
INT(num) This function is related to the FLOOR and CEILING functions. Unlike those two, which consistently move down or up respectively, the INT function simply drops the fractional part of the number. Eg. INT(3.786) = 3 INT(-5.84) = -5 See also: FLOOR, CEILING, ROUND, TRUNCATE, FRAC MANT(num) This function returns the mantissa (numerical part) of the number you feed it when transformed into scientific notation.
MIN(num1,num2) As with MAX, this function is used mainly by programmers. It returns the smaller of the two numbers entered. Eg. MIN(3,5) = 3 See also: MAX num MOD divisor For those not familiar with modulo arithmetic, it will suffice to say that this function gives you the remainder when one number is divided by another. It is considered to be an mathematical operator in the same way that a plus, minus, times or divide sign is.
%CHANGE This function calculates the percentage change moving from X to Y using the formula 100(Y-X)/X. It can be used to calculate (for example) percentage profit and loss. Eg. I buy a fridge for $400 and sell it for $440. What is my profit as a percentage? Use: %CHANGE(400,440) I sell a toy for $5.95 that normally sells for $6.50 What is the discount as a percentage? Use: %CHANGE(6.50,5.95) See also: %, %TOTAL %TOTAL To find out what percentage X is of Y, use the function %TOTAL(Y,X).
ROUND(num,dec.pts) This function rounds off a supplied number to the specified number of decimal places (d.p.). Eg. Round 66.65 to 1 d.p. Use: ROUND(66.65,1)=66.7 Round 34.56784 to 2 d.p. Use: ROUND(34.56784,2)=34.57 This function is also capable of rounding off to a specified number of significant figures (s.f.). To do this, simply put a negative sign on the second argument. Round 32345 to the nearest thousand. Use: ROUND(32345,-2) = 32000 Round 3405.63475 to 6 s.f. Use: ROUND(3405.63475,-6) = 3405.
TRUNCATE(num) This function operates similarly to the ROUND function, but simply drops the extra digits instead of rounding up or down. It is somewhat similar in effect to the FLOOR function but the TRUNCATE function will work to any number of decimal places or significant figures instead of always dropping to the nearest lower integer value. Eg. TRUNCATE(3405.6375,-6) = 3405.63 TRUNCATE(32.889,1) = 32.
The ‘Stat-Two’ group of functions PREDY(x-val) This function predicts the y value for a pair of columns set up as bivariate data in the Statistics aplet. This is discussed in more detail in the section covering the Statistics aplet, but a brief summary will be given here. It assumes that: (i) the bivariate data is entered into a pair of columns (eg.
The ‘Symbolic’ group of functions The = ‘function’ Although this is listed in the MATH menu as if it were a function, it is not really. Except in programming, the = sign is simply used in exactly the way that you would expect it to be, mainly in the Solve aplet. It’s easier to obtain the = sign directly from the keyboard. ISOLATE(expression,var-name) This function will rearrange a formula so that its subject is another variable.
LINEAR?(expression,var.name) This is another of those functions which is probably aimed more at the programmer than at the normal user. It is designed to test whether a supplied expression is linear or non-linear in the variable you specify, returning zero for non-linear and 1 for linear. Eg. Suppose we use the expression AX 2 − B + 4 If X is the variable and A and B are both constants (say A=4, B=5) then the expression AX 2 − B + 4 would become 4 X 2 − 5 + 4 which would be non-linear.
Eg. Solve x 2 − 4 x − 5 = 0 Use QUAD(X2-4X-5,X) Answer: (4+S1*6)/2 x = 4±6 2 It is now up to you to interpret this algebraically as: = 4+6 or 4−6 2 2 = 5 or − 1 If you are simply after the roots of the quadratic then it is far better to use the POLYROOT function (page 284). If you would like a solution such as 3+ 5 2 rather than 2.6180 then the advantage of QUAD is that you can COPY the result, edit the line to remove all but the decimal root and square it to find the original discriminant.
The | function written as: expression | (var1=value,var2=value,…) This is called the ‘where’ function. The reason for this is that it is used to evaluate formulas, of the type when one would say “Evaluate ….., where a = 5, b = 4 etc”. The formula must be in the form of an expression rather than an equation. You should enter the equation first, then the ‘where’ symbol and then the values of all the variables in the expression.
The ‘Tests’ group of functions These are all functions which are of interest only to programmers, and consequently we will not cover them here. An introduction to programming on the hp 39g+ is covered in an earlier chapter (see page 212) but those wanting more detail than is given there must consult the manual. If you want more information then download aplets from the internet and dismantle them.
Some further functions are available in the Hyperbolic group of functions. They are duplicates of functions available on the face of the calculator but give more accurate answers. They would primarily be of use to those people, such as architects and engineers, for whom high accuracy is paramount. These are: EXP(num) This function gives a more accurate answer than the key labeled e^ which appears above the LN key on the calculator.
LNP1(num) Since the ln( x) function is asymptotic to the y axis as x approaches zero, the natural logs of numbers close to zero are very large negatives, and possibly inaccurate. The function LNP1 (”ln plus 1”). By finding the natural log of x + 1 rather than of x , the function becomes able to do its calculations in a domain in which greater accuracy is possible. This is not something which would normally be of concern at school level.
The ‘Complex’ group of functions Complex numbers on the hp 39g+ can be entered in either of two ways. Firstly, in the same way as they are commonly written in mathematical workings: a + bi. Secondly, as an ordered pair: (a,b). For example, 3 + 2i could be entered into the calculator exactly as it is written, with the ‘i’ obtained using the ALPHA key, pressing the SHIFT key first to get a lowercase i. Alternatively you can enter it directly as an ordered pair.
In addition to the trig functions, there are other functions that take complex arguments. ABS(real or complex) The absolute function, which is found on the keyboard above the -X key, returns the absolute value of a real number. Eg. ABS(-3) returns a value of 3. When you use the absolute function on a complex number a + bi it returns the magnitude of the complex number a 2 + b2 .
ARG(complex or vector) 6 This function, also found on the keyboard, returns the size of the angle defined by regarding the complex number as a vector. For example ARG(4+2i) would be 26 ⋅ 565" . The same information can, of course, be obtained using trig. 4 The reason for the double brackets is that every function used by the calculator uses brackets (hence the outer pair) but so too do complex numbers (hence the inner pair). Using ARG(a+bi) instead avoids this.
The ‘Constant’ group of functions These ‘functions’ consist of a set of commonly occurring constants. Two of them, MAXREAL and MINREAL are mainly of use to programmers except for an important influence on the evaluation of limits (see page 88). They consist, respectively, of the largest and smallest numbers with which the calculator is capable of dealing, and are there for use by programmers as a check to ensure that calculations within a program have not overflowed the capacity of the calculator.
∆LIST({list}) This function produces a list which contains the differences between successive values in the supplied list. The resulting list has a length one less than the original. Eg. L1={1,4,7,10,13} ∆LIST(L1)={3,3,3,3} MAKELIST This function produces a list of the length specified using a rule of your choice. It is very useful, not only in programming but in statistical simulations and modeling.
The MAKELIST function can also be used to simulate observations on random variables. For example, suppose we wish to simulate 10 Bernoulli trials with p = 0.75. We can use the fact that a test like (X<4) or (Y>0.2) returns a value of either 1 (if the test is true) or 0 (if the test is false). Thus: MAKELIST(RANDOM<0.75,X,1,10,1) will return a list of 1’s and 0’s corresponding to the simulated Bernoulli trials.
SIZE({list}) and SIZE(matrix) This function returns the size of the list or matrix specified. Since normal users would probably know anyway, and could find out easily via the list catalog, this is clearly another of those functions which are of more use to programmers (who won’t know when they write their program just how long the list you will ask it to deal with will be when you eventually run the program). If the object is a matrix then the return value is a two element list as {rows, columns}.
The ‘Loop’ group of functions This is an interesting group of functions that may be of use for students studying discrete functions and sequences. ITERATE(expression,var.name,strt,num.iter.) This function evaluates an expression a specified number of times, starting with a supplied initial value an using the answer to the previous evaluation as the value for the variable in the next evaluation. Eg.
RECURSE This functions is provided for programmers to let them define functions in the Sequence aplet. For example, typing RECURSE(U,U(N-1)*N,1,2) U1(N) seemingly produces no useful result in the HOME view, but would produce the result shown right in the SYMB view of the Sequence aplet. The resulting sequence is the factorial numbers. The syntax is: RECURSE(,,<1st term>,<2nd term>) and it must be any meaning. ed into a sequence such as U1,U2..
The ‘Matrix’ group of functions This very extensive group of functions is provided to deal with matrices. The scope of functions and abilities covered in this group is in fact vastly greater than would be required by the average high school student or teacher. In many cases supplying an explanation in more detail than the manual of what the function is used for would occupy many pages to no real useful gain. Consequently many of the functions will be covered only by the comment “See User’s manual”.
DET(matrix) This function finds the determinant of a square matrix. See page 174 for an example of its use in finding an inverse matrix. Eg. 2 3 If A = then find det(A). −1 5 Ans: det (A) = 2x5-3x(-1) = 13 See also: INVERSE, RREF DOT([vector],[vector]) This function returns the dot product of two vectors. Vectors for this function are written as single row matrices. 3 For example, a = (3, 4) or would be written as [3,4]. 4 See page 175 for a worked example.
INVERSE(matrix) This function produces the inverse matrix of an n x n square matrix, where possible. A fully worked example of the use of an inverse matrix to solve a 3 by 3 system of equations is given in the chapter on using matrices on the hp 39g+ on page 172 and 288. An error message is given (see right) when the matrix is singular (det. zero).
LSQ See User’s manual LU See User’s manual MAKEMAT See User’s manual QR See User’s manual RANK See User’s manual ROWNORM See User’s manual RREF(matrix) This function takes an augmented matrix of size n by n+1 and transforms it into reduced row echelon form, with the final column containing the solution. x − 2 y + 3 z = 14 Eg. The system of equations 2 x + y − z = −3 4 x − 2 y + 2 z = 14 is written as the augmented matrix which is then stored as a 3x4 real matrix M1.
This gives the final result shown in the matrix M2 on the right, giving a solution of (1, -2, 3). The huge advantage of this function is that it allows for inconsistent matrices which can’t be solved by an inverse matrix. For example, suppose we use the system of equations below, in which the third equation is a linear combination of the first two but the constant is not consistent with this - ie no solution.
TRACE See User’s manual TRN(matrix) This function returns the transpose of an n x m matrix. 2 3 For example, if M 1 = 1 −2 then TRN(M1) would return 0 4 276 2 1 0 3 −2 4 .
The ‘Polynomial’ group of functions This group of functions is provided to manipulate polynomials. We will use the following function to illustrate some of the tools in the Polynomial group. f(x) f ( x) = ( x − 2)( x + 3)( x − 1) = x3 − 7 x + 6 14 12 10 8 6 4 2 -5 -4 -3 -2 -1 1 2 3 4 5 x -2 POLYCOEF([root1,root2,…]) -4 This function returns the coefficients of a polynomial with roots x1 , x2 , x3 ,... The roots must be supplied in vector form means in square brackets.
POLYFORM(expression,var.name) This is a very powerful polynomial function. It allows algebraic manipulation and expansion of an expression into a polynomial. The expected parameters for the function are firstly the expression to be expanded, and secondly the variable which is to be the subject of the resulting polynomial. If the expression contains more than one variable then any others are treated as constants. Eg.
POLYROOT([coeff1,coeff2,…]) This function returns the roots of the polynomial whose coefficients are specified. The coefficients must be input as a vector in square brackets. Eg. Using our earlier function of f ( x) = ( x − 2)( x + 3)( x − 1) = x3 − 7 x + 6 we can enter the coefficients as [1,0,-7,6]. As you can see in the screen shot, the roots of 2, -3 and 1 have been correctly found.
The ‘Probability’ group of functions This group of functions is provided to manipulate and evaluate probabilities and probability distribution functions (p.d.f.’s). COMB(n,r) This function gives the value of nCr using the formula Eg. n Cr = n! . (n − r )!r ! Find the probability of choosing 2 men and 3 women for a committee of 5 people from a pool of 6 men and 5 women. 6 5 2 3 p = = 0.
PERM(n,r) This function gives the value of n Pr using the n! formula n Pr = . (n − r )! Eg. How many ways can 3 Math, 4 English, and 6 German books be arranged on a shelf if all the books from a subject must be together? Ans: ( 3 P3 × 4 P4 × 6 P6 ) × 3! RANDOM This function supplies a random 12 digit number between zero and one. If you want a series of random numbers, just keep pressing ENTER after the first one. Eg. Produce a set of random integers between 5 and 15 inclusive.
UTPN(mean,variance,value) 0·1 0·1 This function, the ‘Upper-Tail Probability 65% (Normal)’, gives the probability that a normal random variable is greater than or equal to the value supplied. Note that the variance must be supplied, NOT the standard deviation. Eg. 1. Find the probability that a randomly chosen individual is more than 2 meters tall if the population has a mean height of 1.87m and a standard deviation of 10.4cm x = 1.87 m, σ = 0.104m ⇒ σ 2 = 0.010816 Ans: P(height>2m) = 0.1056 2m Eg. 2.
Calculator Tip The normal order for the arguments in the UTPN function is UTPN(mean,variance,value), giving the upper-tailed probability. However, many textbooks work with the lowertailed probability instead. Fortunately the function can easily be adapted for this. If you instead enter the function’s parameters as UTPN(value,variance,mean), reversing the normal positions of value and mean, then the probability given will be the lower-tailed value.
APPENDIX A: WORKED EXAMPLES The examples which follow are intended to illustrate the ways in which the calculator can be used to help solve some typical problems. In some cases more than one method is shown. Sometimes these problems are quoted elsewhere in the book and repeated here for convenience. Finding the intercepts of a quadratic Find the x intercepts of the quadratic equation g ( x) = 2 x 2 + 2 x − 1 Method 1 - Using the QUAD function in HOME.
Method 3 - Using the POLYROOT function The advantage of this is that it can be done in the HOME view and is quick and easy. See page 91 for a method of copying the results to a matrix so as to gain easier access to them. Finding complex solutions to a complex equation Find the roots of the complex equation f ( z ) = z 2 + z + 1 . Method 1 - Using the QUAD function Since this is a quadratic it can be done with the QUAD formula mentioned in example 1., since it is capable of giving complex results.
Finding critical points and graphing a polynomial For the function f ( x) = x3 − 4 x 2 + x + 6 … (i) find the intercepts. (ii) find the turning points. (iii) draw a sketch graph showing this information. (iv) find the area under the curve between the two turning points. Step 1. Enter the function into the SYMB view of the Function aplet, so it is available for plotting. Step 2. Use the POLYROOT function to find the roots. This function is in the MATH menu in the Polynom. group.
Step4. Because I know that part (iv) of the question requires me to re-use these extremum values in an integration (which I would like to be as accurate as possible), I am going to ‘save’ the extremum value just found. I change into the HOME view and store it as shown in memory A. Note: You MUST store the point of interest before moving the cursor in the PLOT view. As soon as the cursor moves its new position over-writes the extremum value. If you want the y coordinate, just evaluate F(X).
Solving simultaneous equations. Solve the systems of equations below: (i) 2 x − 3 y = −7 x + 4y = 2 (ii) 2x − y = 4 −3x + 2 y − z = −10.5 x − 3 y + z = 10.5 Method 1 - Graphing the lines Because the first set of equations is a 2x2 system it can be graphed in the Function aplet. To do this it is necessary to re-arrange the functions into the form y = …… and store them into F1(X) and F2(X) in the SYMB view of the Function aplet.
Step 3. Change into the HOME view and enter the calculation M1-1*M2. The result is the (x,y) coordinate of the solution. A similar method can be used to solve the second 3x3 system of equations. Third method - using the 3x3 Solver aplet This method uses an aplet which is available from the internet called the “Simult 3x3”. It allows easy solution of 2x2 and 3x3 systems of linear equations in a format which is more user friendly than the use of matrices for student who are not familiar with them.
Expanding polynomials Expand the expressions below. (i) (ii) (i) ( 2 x + 3) 5 ( 3a − 2b ) 4 Use POLYFORM((2X+3)^4,X) to expand the polynomial. Use the key to examine the result. Result: 16 x 4 + 96 x 3 + 216 x 2 + 216 x + 81 (ii) Use POLYFORM((3A-2B)^5,B) to expand the polynomial as a function of B. Then use the polynomial function again, ing the result from the first expansion and expanding this time as a function of A.
Exponential growth A population of bacteria is known to follow a growth pattern governed by the equation N = N 0 e kt ; t ≥ 0 . It is observed that at t = 3 hours, there are 100 colonies of bacteria and that at t = 10 hours there are 10,000 colonies. (i) (ii) (iii) Find the values of N 0 and of k. Predict the number of bacteria colonies after 15 hours. How long does it take for the number of colonies to double? (i) Find N 0 and k. Step 1. Start up the Statistics aplet, set it to and enter the data given.
(ii) Predict N for t = 15 hours. Change to the HOME view and use the PREDY function. Result: (iii) 268 269 colonies. Find t so that N = 1 N0 . 2 Step 1. Find the values of N 0 and k and store N 0 into memory A and k into memory K, so that it is un-necessary to re-type them. See page 145 for instructions on finding the parameters from the exponential fit curve. Step 2. Switch to the Solve aplet and enter the equation to be solved.
Solution of matrix equations Solve for the value of X in A( I − 2 X ) = B where 2 3 3 −2 A = , B = −1 5 1 4 A(1 − 2 X ) = B 1 − 2 X = A−1 B −2 X = A−1 B − I X = Store the values of A and B into M1 and M2 respectively. Finally use the HOME view to calculate the answer, using the function IDENMAT(2) to produce a 2x2 identity matrix, and making sure to store the result into M3. In this case the result is a horrible decimal.
Inconsistent systems of equations Solve each of the systems of equations below, where possible, indicating in each case the nature of the system. (a) 2 x − 3 z = −7 x + y + 4 z = 15 (b) x + 2y − z = 2 2 x − 3 z = −7 x + y + 4 z = 15 3x + y + z = 8 (c) 2 x − 3 z = −7 x + y + 4 z = 15 3x + y + z = 7 Using the RREF function In each case the most efficient method is to use the function RREF.
Finding complex roots (i) (ii) Find all roots of the complex polynomial f ( z ) = z 3 + iz 2 − 4 z − 4i . Find the complex roots of z 5 = 32 . The best way to do this is using POLYROOT. I usually the results into a matrix, since the matrices on the hp 39g+ can be complex vectors, not just real matrices. (i) The coefficients can be entered into POLYROOT in the form a+bi or as (a,b). In this case the roots are integers so there is no need to store it into a matrix.
Analyzing vector motion and collisions Ship A is currently at position vector 21i + 21j km and is currently travelling at a velocity of -4i + 6j km/hr. Ship B is at 30j and travelling at 2i + 3j km/hr. If the ships continue on their present courses, show that they will not collide and find the distance between them at the time of their closest approach. Firstly enter the equations for the ships’ paths into the Parametric aplet using the first equation pair for ship A and the second for ship B.
I want to graph this function for the first six seconds but I am not sure what y scale to use so I will set XRng to be 0 to 6 in the PLOT SETUP view and then choose VIEWS - Auto Scale. The result is shown right. Using - Extremum, I find that the time of closest approach is at t = 3.4 hours (3:24 pm) with a separation at that time of d = 1.3416 km. The y axis has been adjusted slightly to make the x axis visible.
The simplest way to show that the motion is circular is to show that the dot product of the velocity and acceleration vectors is constantly zero for all theta. This should be done algebraically, but just for fun we’ll see if we can do it with the calculator too. Use X2 & Y2 to hold the velocity and X3 & Y3 to hold the acceleration, pressing after each one to perform the differentiation. Now we go to the Function aplet and enter the formula for the required dot product as X2(X)*X3(X)+Y2(X)*Y3(X).
Inference testing using the Chi2 test A teacher wishes to decide, at the 5% level of significance, whether the performance in a problem solving test is independent of the students’ year at school. The teacher selected 120 students, 40 from each of Years 8, 9 & 10, and graded their performance in a test as either A or B. Year 8 9 10 Total Grade awarded A B 22 18 26 14 27 13 75 45 Total 40 40 40 120 The table above right shows the results.
Changing into the Solve aplet we can enter a formula which will allow us to calculate values from the Chi2 distribution using the UTPC function. With a 3 x 2 contingency table the number of degrees of freedom are 2. To find the critical 2 χ 0.05 value, we enter values of 2 for D (the degrees of freedom) and 0.05 (the probability) and then move the highlight to V (the value) and press . As it turns out, the required critical value is 5.
APPENDIX B: TEACHING CALCULUS WITH AN HP 39G+ There are many ways that the teaching of functions and calculus concepts can be enhanced with the aid of an hp 39g+ graphical calculator. Some of them are listed below: Investigating y = xn for n an integer This can be done most economically by setting an investigation, perhaps for homework. Save a copy of the Function aplet under the name of “X to the N”. Saving the aplet will allow you to send it to your students’ calculators.
Domains and Composite Functions There are a number of ways that the calculator can help with this. Examples are given below but others will no doubt occur to experienced teachers. (i) Rational functions can be investigated using the NUM view. For example, enter the functions F1(X)=X+2 and F2(X)=(X2-4)/(X-2).
(iii) (iv) Composite functions can be introduced directly in the SYMB view. For example, enter F1(X)=X2-X and F2(X)=F1(X+3). Move the highlight to F2(X) and press the button. If desirable, you can further simplify using POLYFORM. With the highlight on F2(X), press . Move the highlight to the start of the expression and use the MATH button to enter “POLYFORM(”. Now move to the end and add “,X)” to the expression and press Pressing again now will give the result shown right. .
The disadvantage of the previous method is that it is not very visual. An alternative is to use the “Chords” aplet. In this aplet, a menu is provided via the VIEWS menu to allow students to choose from a list of predefined functions or enter their own. Once the function has been graphed, the ‘Show slopes’ option will display an animated series of chords of diminishing length, with the gradient displayed at the top of the screen.
The Chain Rule If desirable, an aplet is available from The HP HOME View web site (at http://www.hphomeview.com), called “Chain Rule”, which will encourage the student to deduce the Chain Rule for themselves. It is pre-loaded with five sets of functions, of increasing complexity, the first three of which are shown right. The functions are loaded into F1, F3, F5, F7 and F9, while the functions F2, F4, F6, F8 and F0 contain an expression which, when is pressed, will differentiate the function above.
Area Under Curves This topic is most easily handled using an aplet from The HP HOME View web site (at http://www.hphomeview.com). This aplet, called “Curve Areas” will draw rectangles either over or under a curve or use trapezoids. A number of curves are supplied preset but the user can also enter their own. The user can nominate the interval width and the number of rectangles.
Inequalities The topic of inequalities is one that is sometimes included in calculus courses, particularly during the study of domains and this is often extended to graphing intersecting regions such as ( x, y ) : y ≤ 0.5 x + 1 ∩ y ≥ x 2 − 1 . { } Although the hp 39g+ does not have the in-built ability to plot inequalities, the process is easily handled using an aplet from The HP HOME View web site (at http://www.hphomeview.com) called “Inequations”.
Piecewise Defined Functions Piecewise defined functions can be graphed easily on the hp 39g+ by breaking them up into their components. For example: sin ( x ) f ( x) = x + 2 2 ( x − 2 ) − 1 ; x < −2 ; −2 ≤ x ≤1 ; x >1 Using the Function aplet, we enter three separate component functions. You can obtain the inequality signs from the CHARS menu.
Finally the calculator will give the result as shown right. The problem is that students will misinterpret it as being N=10, when in fact it is simply that the calculator has gone as far along the positive x axis as possible and stopped at MAXREAL of 1×10500 (see second screen shot). It is recommended that the teacher should deliberately provoke this error and follow with class discussion.
APPENDIX C: THE HP 40G & ITS CAS Introduction This appendix is intended to give a useful introduction and over view to the user who is new to an hp 40g. It is not intended to fully cover the topic, nor is it intended to serve as a reference text for the advanced user. For those needing a far more extensive coverage than is available here, I can highly recommend the incredibly detailed text “Computer Algebra and Mathematics with the hp 40g, Version 1.
The two values at the top of the screen represent the calculator’s successive approximations to the true solution. The chances are that one will have a ‘+’ symbol to the left of it, while the other has a ‘-‘. This is telling you that the ‘+’ value is greater than required, while the ‘-‘ value is smaller. As you watch you should see the two values converge to the true answer. But is it? The true answer is actually 3 3000 , as is shown right.
What is the difference between the hp 39g, hp 40g & hp 39g+? At the time that the hp 39g was designed, as an upgrade from the original hp 38g, there were two competing sets of requirements. The European market wanted a calculator which had a CAS system but they were highly distrustful of the infra-red communication which was standard on the hp 38g, feeling that it might allow cheating in examinations.
Using the CAS The first step is to activate the CAS. This is done from the HOME view by pressing screen key 6 (SK6), labeled . When you do, you will see an empty screen with a cursor in the center and an extensive menu system at the bottom of the screen. From the HOME screen, pressing SHIFT will instead display the screen on the right. This is the CAS MODES screen. More information on this is given on page 329. This screen can be accessed within the CAS by pressing SHIFT SYMB.
(iii) Press left arrow once then down arrow once. Press Xy 3, then press up arrow three times & finally press Xy 2. (DO NOT use the X2 button for this.) Notice that in each case the power was applied to the currently highlighted element of the expression. Brackets are automatically added as required. A Notice also the movement of the highlight. If you regard the original expression of 2X+81 as a tree of operations as shown right then it may make more sense.
(iv) Press up arrow three times and then divide by 5. This moves the highlight up to node A, highlighting the entire expression. Dividing by 5 therefore applies to the entire R expression, with the result shown right. The new tree is shown below with nodes R and S added above A. A Although it is not strictly necessary for you to understand or use this concept of a tree of operations you will find that it will help you to follow why the highlight behaves as it does as it moves around.
In-line editing mode If you find that you are not able to access part of an expression, or if you have entered an operation at the wrong level then you can highlight and edit an expression ‘in-line’ as if you were entering it in the calculator’s normal HOME view. For example, highlight part of an expression as shown right. Now press SK1 ( ) and choose ‘Edit expr.’ from the menu. You can now perform any editing you require and the result will be inserted into the full expression at that point.
If you want to delete the entire expression then the simplest method is to press ON and exit the CAS and then re-enter it with a blank screen. Alternatively you can highlight part or all of the expression and then press SHIFT ALPHA CLEAR. The highlighted section will be cleared. Cutting and pasting of all or part of an expression can be easily done using the menu. This provides access to commands of Cut, Copy and Paste which behave in exactly the same manner as they do in any word processor.
The PUSH and POP commands Occasionally it is desirable to transfer results from the normal HOME view to the CAS screen or vice versa. This is done using the PUSH and POP commands. Suppose we have just expanded (2x+3)4 in the CAS, as shown right. If we press ON to exit the CAS and then type POP in the HOME view then the result will be retrieved to the HOME screen as shown. In this case we might wish to also paste the result into the Function aplet.
Pasting to an aplet As mentioned above, one method of transferring CAS results to a normal aplet such as Function is to use the POP command. However, for graphing results, there is an even easier method - simply press PLOT. Suppose that we have a result in the CAS editor as shown right. Pressing the PLOT button will result in the menu shown in the second screen. If you choose the Function aplet then you will be asked to nominate a destination.
Evaluating algebraic expressions When an expression is highlighted, pressing ENTER will cause it to be algebraically evaluated and any functions to be applied accordingly. For example, if you highlight (2x+3)^3 as shown right then pressing ENTER will give the result shown. Further examples are shown below. In each case it is only the highlighted expression which is evaluated. Depending on the settings of CAS MODES there may or may not be intermediate steps displayed between those shown.
Using functions in the CAS The behavior of the MATH menu is somewhat similar in the CAS except that it gives access to a host of new functions available primarily in the CAS. These functions will only be available on the hp 40g, not on the hp 39g+. There are two ways that functions can be used. The first is to use them as the expression is entered. In this method the order is to choose the function and then to fill in the parameters required.
E.g. 2 Factorizing expressions If you highlight an expression such as (2x+3)4 and press ENTER then the CAS will expand the bracket. Since the result extends beyond the screen we will scroll through it using the arrow keys. The results can be factorized again using the COLLECT function. In this example we will also illustrate the use of the CAS History to fetch a previous calculation.
E.g. 3 Solving equations Solve the equation x 4 − 1 = 3 , giving i) real solutions and ii) complex solutions. From any of the screen menus, access the CFG menu (see page 329) and ensure that Real mode is selected, as shown right. Now use the SOLVEVX function, typing: The SOLVEVX function assumes that the active variable is being used. The default active variable is X and if no = sign is included then the expression is assumed to be equal to zero.
The LINSOLVE function can also be used to solve problems of the form below. Solve the system of equations: The command is LINSOLVE( 2.X+K.Y-1 AND (Q+3).X-Y-5, X AND Y) and it produces the results shown.
E.g. 5 Solving a simultaneous integration A continuous random variable X, has a probability distribution function given by: a + bx + x 2 for 1 ≤ x ≤ 4 f ( x) = 9 0 elsewhere Given that P ( x ≤ 2 ) = 5 , find the values of a and b. 27 From the fact that it is a p.d.f. we know that ∫ f ( x ) dx = 1 . We can use this to 4 1 get the first expression in terms of a and b. As can be seen above, the initial integration gives an equation involving a fraction.
We can now use the LINSOLVE function to find A and B. While the second linear equation is still highlighted, fetch the LINSOLVE command from the menu. Then press left arrow once and up arrow twice to highlight the linear expression again as shown right. Now, while the entire expression is highlighted, as shown above, press SHIFT (-) to obtain the ‘AND’. The result should be as shown right.
E.g. 6 Defining a user function The DEF function allows you to define your own functions, which are then available for use. In the example below it has been used to define Fermat’s x prime function f ( x ) = 22 + 1 . Note that the sequence of keys is: ▼ ENTER ALPHA F ( XTθ ▲ ▲ SHIFT = 2 Xy 2 Xy XTθ ▲ ▲ ▲ + 1 ENTER The CAS will then echo the function back to you and, if you go to the VARS view, you will find that it is now a defined variable.
On-line help One of the most helpful features of the hp 40g CAS is the on-line help provided by the SYNTAX button (SHIFT 2). Pressing SYNTAX will display the menu shown to the right. You can use the up or down arrow keys to scroll through this list but it is very extensive and it is far quicker to press the button corresponding to the first letter of the function on which you require information.
Configuring the CAS This can be done in a number of ways and only an overview will be given here. One method is via the configuration line (CFG) at the top of each menu. The line shown right of CFG R= X S means that the calculator is set to exact-real mode, that X is the current variable, and you are working in Step by step mode. If you select this option of the menu then you will see the further menu shown to the right. At the top of this menu is more information about the current configuration.
Pressing takes you out of the CFG menu (as does choosing QUIT from the menu and confirming it with ) but does not discard any changes you have made. The name of the current variable, as well as the value of the variable MODULO, can be changed by means of the SHIFT SYMB view, or by using the VARS key. Many of the configurations addressed in the CFG menu are also referenced in these views. Press ON to exit the VARS configuration view.
4) Don’t use a summation variable of lower-case i. This is assumed by the CAS to be the unit imaginary value - the root of x2+1=0. 5) Although you can use the integration symbol provided on the keyboard it has disadvantages outlined on page 82. Use the INTVX function instead. See the example on page 320. 6) The COLLECT function referred to earlier will factorize over the set of integers. For example, COLLECT(x2-4) will result in (x+2)(x-2), whereas COLLECT(X2+4) will result in X2+4 back again.