                  Kalkulator How-To (March 14, 2001)
                  ==================================

-------------------------------------------------------------------

NOTE: in these examples we assume you are currently in the
      Kalkulator Main Window and that the Expression line has been
      cleared (hit Escape to clear it if necessary).

-------------------------------------------------------------------

Q-01: How to compute 2/3-3/7 ??

A: Using the keyboard or mouse, enter

      2/3-3/7

   and hit the Return key.

-------------------------------------------------------------------

Q-02: How to show the result of the previous calculation as a
      fraction?

A: Press Alt-M [Format] and then R [Fraction].

-------------------------------------------------------------------

Q-03: How to convert 120 watts into horsepower units?

A: Enter 120 and hit Return. Press Alt-N [Convert]. Select "Power"
   from the top selector, then "watts" from the middle one, then
   "horsepower(MKS)" from the bottom one. Click on [OK]. The
   result should be 0.16...

-------------------------------------------------------------------

Q-04: A box-shaped container is 2 feet 2.5 inches tall, 1 foot
      2 1/3 inches wide and 10 3/8 inches deep. What is its volume
      in gallons?

A. Thank you for asking. First let us compute the volume in cubic
   feet; type

       ft(2,2.5)*ft(1,2+1/3)*ft(0,10+3/8)

   and hit the Enter key. The displayed result should be 2.28...
   Next, click on [Convert]. Then click on the "Convert" combo box
   and select "Volume". Click on the "From" combo and select
   "cu.feet", then on "To" and select "gallons(US)". Click on
   [OK]. The converted result will be 17.059...

-------------------------------------------------------------------

NOTE: if your needs are limited to simple tasks as shown above,
      you may like to shrink the Kalkulator: select [Options |
      Panel Options] from the menu, then select "Minimal" from the
      top selector and uncheck the "Menu and Title Bar" box. This
      way you get a small, simple and friendly calculator, with
      the more advanced features not getting into your way. You
      may also choose "Basic" instead of "Minimal".

As an alternative, you may consider using Kalkulator's offspring,
the Midget. It will handle these problems just fine, is smaller
and less expensive.

-------------------------------------------------------------------

Q-05: How to solve an equation x+exp(x)=2 ?

A: First express the equation as f(t)=0; to do this, enter f(t) as

     t+exp t-2

   Next, click on [Zero]. When asked for the solution limits and
   accuracy, enter something reasonable, like 0, 100 and 1E-8
   (or .00000001). Click on [OK]. The result should be 0.44...

-------------------------------------------------------------------

Q-06: How to compute an integral of f(x)=1/(x+4) from 0 to 2?

A: Enter f(t) as

     1/(t+4)

   into the Expression Line. Click on [Integ]. When the dialog box
   prompts you for integral limits and accuracy, enter 0, 2 and
   1E-6 (or another accuracy value), respectively. Click on [OK].
   The result, 0.405..., will be stored in the Temporary Variable,
   t.

-------------------------------------------------------------------

Q-07: How to graph a function, e.g. f(x)=exp(-abs(x))*sin(1/x) for
      x between -2 and 2 ??

A: Enter the expression using t as the function argument

     exp(-abs t)*sin(1/t)

   and click on [Draw]. Enter -2 and 2 as x-limits. Click on
   [Find] and [Round], then on [OK].

   Note: this is a very unpleasant function to graph. You may want
   to increase the graph precision by selecting the [Options|Graph
   Options] menu and checking the "Fine Detail" box (do it before
   clicking on [Graph], of course). Then find any other function
   graphing program and see what job it will do. Bingo.

-------------------------------------------------------------------

Q-08: How to fit a square regression curve through a series of XY
      points?

A: Click on the [Statistics] tab at the bottom, then on[Edit]
   If necessary, click on [Mode] to set the  buffer to the XY mode.
   Make sure the buffer is clear (use [Clear] if necessary).
   Type your points into the yellow box:  X on the left, Y on the
   right; use arrow, Tab and Return keys as needed.

   Let us assume you've typed in the following:

        0.25     0.6
        0.6      0.4
        0.9      0.7
        1.0      1.0
        1.5      1.4
        1.2      1.1

   Click on Exit, if you wish (you don't have to). In the Main
   Window click on [Regr] and select "2nd degree". When asked about
   clearing the canvas, click on [Yes].

   In the Graph Range dialog, click on [Find] and [Round],then [OK].
   Done.

   To view the regression coefficients, scroll the [Pars] tab page
   down - you will see a0=0.587..., a1=-0.416... and a2=0.666...

-------------------------------------------------------------------

Q-09: How to compare visually a square regression curve from the
      example above with a linear regression line?

A: If the graph generated above is still visible, press the Pause
   key or Shift-Enter.

   Click on [Regr] and select "1st degree", but answer [No] to the
   question on drawing the line. You will see the linear regression
   drawn in a different color now, and the inspection of the
   Parameter Page will show a0=0.196... and a1=0.737...

-------------------------------------------------------------------

Q-10: How to solve a system of three linear equations:

      2*x1 -  x2             = 3
      -x1  + 1.5*x2 + 0.3*x3 = -7
             x2     - x3     = 1

A: Click on the [Lin.Algebra] tab at the bottom, then on the
   [Operations] button (you may also use [Extras | Linear algebra]
   in the menu).

   Click on [Size] and select "3". Click on [Edit] and select "a". Enter the matrix so that the input grid
   contains:

      2    -1     0
     -1   1.5   0.3
      0     1    -1

   and click on [OK]. Then click on [Edit] again and select "u".
   Enter the vector:

      3
     -7
      1

   and click on [OK] again.

   From the keyboard enter "a/u=v".

   To view the solution, click on [Edit] and select "v". The
   result will be (-0.5, -4, -5).

-------------------------------------------------------------------

Q-11: How do I know that this is the right solution?

A: There are three ways:

   (1) Trust me.

   (2) In the Linear Algebra Panel, enter "a*v=w", then use [Edit]
       and "w". The vector w should be the same as u.

   (3) The hard way: compute the following three expressions in the
       Main Window:

          2v#1-v#2

          -v#1+1.5v#2+.3v#3

          v#2-v#3

       The results should be 3, -7 and 1, respectively.
       (Note: if, when you enter the second expression, Kalkulator
       keeps appending a "t"  in the beginning, add a space in front
       of the expression, and then search for "implicit t" in the
       Help, to know why it happens. Hey, you've told the program
       to do it!)

    The recommended method is (1).


-------------------------------------------------------------------

Q-12: How to solve a cubic equation:

   2*x^3-9*x^2+x+5=0

   storing the largest real root as variable U?

A: First, get into the Root Panel by clicking on [Extras |
   Polynomial Roots]. Enter the polynomial coefficients into the
   yellow data grid at the left so that the grid looks like

         5
         1
        -9
         2

   Click on [Solve]. The solution display at the right will show
   three real roots: v1=-0.649..., v2=4.243... and v3=0.906...
   Click the left mouse button on the largest one (v2) and select
   U from the pop-up menu.

-------------------------------------------------------------------

Q-13: How to compute an integral of f(x)=x^3*exp(-x) over an
      interval from 0 to 8?

A: First enter the function as an expression line, remembering to
   use t as the argument:

      t^3*exp(-t)

   Then click on [Integ] and type in the limits: 0 and 8, as well
   as the desired accuracy, say, 1E-9. Click on [OK]. The result
   will be about 5.745719...

-------------------------------------------------------------------

Q-14: The above approach would not work if the "x^3" above is
      changed to "x^3.2": I'm getting an error message, why?

A: Integration of "t^3.2*exp(-t)" over [0,8] involves computing
   of 0^3.2, and this is an illegal arithmetic operation
   (fractional powers of zero are not defined, in case you were
   not paying attention in high school).

   On the other hand, we know that the function converges to 0
   at 0; therefore we may redefine it with use of a conditional
   function as

      ifz(t,0,t^3.2*exp(-t))

   Type this expression in and repeat the rest of the previous
   procedure. The result will be 7.35919...

-------------------------------------------------------------------

Q-15: How do I convert the decimal value of -1200 to binary?

A: Go to the Computer Math Panel by clicking on [Extras | Computer
   math] and click on the sign mode button (just left of [Exit])
   to select "Signed", and on the leftmost button to select
   "Decimal", as the system in which you will be entering the
   value.

   Now you have to choose the word length: click on the bit
   length button (second left at the bottom) and select 16 bits
   (32 would be OK too, but not 8: your value will not fit into
   an 8-bit word).

   Type in "1200" and click on the [] button. The display should
   read "-1200" now. Click on the leftmost button again and select
   Binary. Done: the display should say now "11111011 01010000".

-------------------------------------------------------------------

Q-16: I'm using the Computer Math calculator to multiply 999 by
      66. The result is 398. What is wrong and how do I fix it?

A: Nothing is wrong. You are obviously working in the Decimal mode
   (signed or not) and with 16-bit words. The multiplication
   result, 65934, does not fit into a 16-bit word, so the program
   does what a computer doing 16-bit math would do: it drops the
   most significant part of the result. If you want this not to
   happen, switch to 32-bit words or, even better, use the Main
   Window for "regular" (as opposed to "computer") arithmetics.

-------------------------------------------------------------------

Q-17: I would like to define tan(x/4)*(2*sin(x/2)-cos(2x)) as a
      function of x so that it can be easily used in my
      calculations. How?

A: First, enter the function into the Expression Line, using t
   (not x!) as the argument:

      tan(t/4)*(2*sin(t/2)-cos(2*t))

   or, using fewer parentheses and multiplication signs

      tan .25t*(2 sin .5t-cos 2t)

   Click on the [User] tab in the Function Panel at the left and
   then on [Define]. Select a slot from the pop-up menu, for
   example, 1. Type the function name, for example, "trix" into
   the small box asking you for it. Hit Enter.

   Note that one of the buttons in the User Function Page will now
   be marked as [trix]. Now you can use trix as a regular function
   in your expression; as in

      trix(30.27)-2*trix(15/2A)+sin(27.333)

   (obviously, I'm doing this in the Degree mode, but this is not
   necessary).

-------------------------------------------------------------------

Q-18: Now I would like to define f(x,y) = xy+2*ln(x/y). How do I
      do it?

A: Enter the following into the Expression Line:

      t1*t2+2*ln(t1/t2)

   using t1 and t2 as arguments instead of x and y. You may also
   use the simpler form:

      t1t2+2ln(t1/2)

   Switch to the User Page of the Function Panel (by clicking on
   the [User] tab) and click on [Define]. Select a function slot
   by from the pop-up menu, say, 2. Type in the new function
   name, e.g., "foo". Hit Enter.

   Now you can use foo as a regular two-argument function in any
   Kalkulator operations, like in

      10+3foo(7,9)

   which should result in 197.49...

-------------------------------------------------------------------

Q19: Show me how to solve a system of non-linear equations.

A: Let us assume that our system consists of three equations:

      (x+y)-z = 7.59
      x+y*z    = 8.36
      xy/(y+z) = 0.44

   (I have reverse-engineered these three so that x=1.1, y=2.2 and
   z=3.3 is a solution.)

   First of all, we have to use v1, v2 and v3 as the arguments, not
   x, y and z. (I could allow you to use x, y and z, but then I would
   have to allow you to use any other variables, too, at least in
   systems of more than three equations, and this would be messy!)
   We also have to show every equation as f(v1..v3)=0.

   To do this, use the arrow keys to go to the first expression in
   the Expression Line, erase the old contents by hitting Escape,
   and enter

      (v1+v2)-v3-7.59

   Then enter

      v1+v2*v3-8.36

   into line number 2 and

      v1*v2/(v2+v3)-.44

   into line number 3.

   Now we have to enter our initial guess of the solution into the
   Argument Page. Let us try v1=10, v2=10 and v3=10. To do it, click
   on the [Args] tab in the Variable Panel, then on the [Put] button.
   Select "v1" from the pop-up menu, enter "10" in the input box,
   hit Enter. Repeat the same for v2 and v3.

   Before trying to solve our system, let us see how good our initial
   guess is. Go to Line 1, hit Enter. The result is 382.41 (and we are
   looking for v1, v2 and v3 for which all three lines will be zero!).
   Similarly, Line 2 gives 101.64 and Line 3 - 4.56. Obviously, our
   initial guess is way off.

   Now click on the [Numerical] tab of the Application Panel (at the
   bottom) and then on [Non-Lin]. You will see a dialog box with
   six (or, in the registered version, 24) buttons, each corresponding
   to one of the expression lines. Our system is defined by lines
   1, 2 and 3, so click on these buttons so that they become depressed
   (you may have to click twice; the first click just brings the
   selected expression to the Expression Line so that you can see it).

   The last remaining thing is to click on [OK]. Done. The Argument
   Page shows the results: v1=2.426..., v2=1.146... and v3=5.175...

   Wait, something is wrong! Why not (1.1,2.2,3.3) like I said above?
   Well, a system like this can have a number of solutions and there
   seems to be no general rule how to find them all. Kalkulator found
   one of the solutions and it is good: check it by going to line 1
   and pressing the Enter key, then doing the same for lines 2 and 3.
   The computed expression values are, indeed, within the limits of
   arithmetic error. You found a valid solution, but not the one I
   wanted you to find!

   To try for another solution, use the [Put] button in the Argument
   Page to enter another initial guess, v1=4, v2=4 and v3=4 (this
   guess, although better than the previous one, is still quite bad!).
   Then click on [Non-Linear] and [OK] to solve the system again.
   Yes, this time you arrived to (1.1,2.2,3.3), as we expected.
   Yet another initial guess, (-1,-1,-1) will bring us to yet another
   solution, approximately (0.796,-3.058,-2.474).

   Now try the initial guess (-10,-10,-10). This time Kalkulator will
   tell you it was unable to find the solution at all. This is not
   a bug in the program - just the regular joys of working in multi-
   dimensional solution space!

   Try one more initial guess: (0,0,0). This time the program will
   diagnose an arithmetic error. Of course: the third expression
   has no value defined at this point!

   Imagine yourself hiking in the North Wales mountains and trying to
   find your way to the sea level. Without any maps the obvious way
   is just to follow the steepest path down. Depending on from where
   you start, you may reach the shore in a number of different places.
   If you are unlucky enough (separated from the shore by a mountain
   ridge), your downhill path may bring you to a mountain lake.
   (Stretching the comparison, points where one or more of the left
   sides, i.e. our expressions, are undefined, can be compared to
   bottomless wells you can fall into...)

   The hiking model illustrates fairly well what the Newton method
   used in Kalkulator is doing. With no limitations on the shape of
   the left side functions, the algorithm is just trying to walk
   towards zeros, with no guarantee of reaching them (assuming they
   exist at all).

   Usually, having some knowledge of the physical nature of the
   problem behind your equation system allows you to come up with a
   reasonably good initial guess, and then the algorithm does a good
   job in bringing you to the solution. No guarantees, or iron-clad
   rules, however, exist here.

   But I am not here to teach you numerical analysis. You've got a
   tool; now use it with understanding.

-------------------------------------------------------------------

Q-20: Walk me through solving a system of ordinary differential
   equations; this seems quite arcane...

A: Let me state first that some of my best friends have never solved
   a differential equation. You may have no need for them even if
   you do quite a lot of applied math. Certainly, you will not learn
   ODE by clicking randomly on Kalkulator buttons.

   Here is an example. Our ODE consists of three equations:

                  dy1/dt = 2*y3^2+1/t

                  dy2/dt = 3*(y1-ln(t))

                  dy3/dt = 0.5/y3

   and the known values at t=1 are:

               y1(1)=1, y2(1)=-2, y3(1)=1.

   Solve the system by finding the values of y1, y2 and y3 at t=10,
   obtaining also a plot of y1(t) and y3(t) between 1 and 10.

   The step-by-step procedure is as follows:

   1. Decide which display lines will correspond to y1(t), y2(t) and
      y3(t). The simplest choice will be lines 1, 2 and 3, respectively.
      Remember than in Kalkulator notation you have to use the argument
      variables v1, v2 and v3 as y1..y3 above.

   2. Enter the equations, using the arrow buttons to set the proper
      line number:

      - Line 1:   2 sq v3+rcp t
      - Line 2:   3(v1-ln t)
      - Line 3:   .5/v3

   3. Enter the starting values: click at the [Args] tab at the right,
      and then use [Put|v1] to enter 1, [Put|v2] to enter -2, and
      [Put|v3] to enter 1 again. (The notation [Put|v1] means clicking
      on the [Put] button at the Arguments page and then selecting [v1]
      from the pop-up menu.)

      The values should be now displayed in the argument list at the right.

   4. If necessary, click on the [Numerical] tab at the bottom, to show
      the Numerical Operations Page. Click on the [ODE] button there.

   5. In the line selection window which now will show up, click on the
      button [1] until it is depressed and underlined. (Depressed means
      one of the equations in the system, underlined means that the
      corresponding function y(t) is to be plotted.) Now click on the
      small black field saying [v?] at the bottom-right and select [v1]
      to inform Kalkulator that this line defines dy1/dt.

      Click on button [2] until it is selected but not underlined (no
      function plot), select [v2] like before.

      Make button [3] selected and underlined, select [v3].

      Click [OK].

   5. A dialog box will ask you for the starting value of t, the goal
      value and the desired solution acuracy. Enter 1, 10 and 1E-12
      into the corresponding fields, click [OK].

   6. If everything was entered properly, Kalkulator will start the
      computation; on any reasonably fast computer it will last just
      a fraction of a second. Before a new dialog bo shows up, you
      may be able to glimpse new values of v1, v2 and v3 in the
      Arguments Page.

   7. A new dialog bo will ask you for the plot range. Note that
      it offers you no choice about t (referred to in plots as "x")
      which will be hardwired to the (1,10) interval. You may
      enter the vertical ("y") values manually or press the [Find]
      button for autoranging. Let's assume you've selected the latter
      option. Click on [Round] to have the vertical range rounded.
      Press [OK].

      A graph with your functions y1(t) and y3(t) will be now shown,
      and the new values of argument variables v1, v2 and v3 will be
      (approximately) 102.3026, 997.0000 and 3.1623.

   NOTE:

     Our example was reverse-engineered from y1(x) = x^2+ln(x)
     y2(x) = x^3-3 and y3(x) = sqrt(x). In order to see how our
     ploted solution matches these functions, do the following
     without closing the graph panel:

  8. Enter the expressions:

         sq t+ln t          - into Line 4
         cu t-3             - into Line 5
         sqr t              - into Line 6

     Click on [Multi] at the bottom-right. In the line selector box
     depress buttons [4], [5] and [6], press [OK]. The original
     functions will be drawn right on top of the solutions.

-------------------------------------------------------------------

Q-21: What do I need the random number generators for?

A: Sometimes you may need to use a number whose exact value is
   unknown, but which comes from a given probability distribution.
   Usually you need this when trying to model some real-life
   situation, where the data is following some distribution
   pattern. This example gives a brief introduction to such
   modelling, often referred to as the Monte Carlo techique.

   Two machines manufacture plastic spheres; one (nominally) with
   radius A, and the other - B. Due to manufacturing process
   imperfections, the sizes of spheres will never be exactly A and
   B, but will rather follow some distributions (well approximated
   with the Normal ones) with mean values close to A and B and
   standard deviations, say, C and D, reflecting the accuracy of
   the process (plus that of the measurement used to check the
   sphere size).

   We can simulate this process by generating randomly, say, 1000
   spheres; here is how to do it and how to see the histogram of
   radius values.

   Let us assume that both machines work for the same time period,
   with the first one being twice as fast as the second, so that
   the mixed bag of spheres will be filled (approximately) in the
   2:1 ratio between the A and B spheres; in other words the
   probability that a randomly chosen sphere will come from the
   first machine is P=2/3.

   A single expression to "generate" one plastic sphere will be

             ifn(ran 1-P,rgau(A,C),rgau(B,D))

   which in plain English can be expressed as: "if a uniform random
   number from 0 to 1 is less then P, than generate a Normal
   random value with mean A and standard deviation C, otherwise
   generate such a number with parameters B and D". Note that the
   "if" clause will be true in the P percentage of cases, so it
   reflects the expected mix ratio.

   Now, let us go through the simulation process step by step.

   1. Enter the formula above into the Expression Line.

   2. Use the [Put] button in the Variable Page to enter the
      values for variables involved, say:

         [Put] A = 1.2
         [Put] B = 1.5
         [Put] C = 0.1
         [Put] D = 0.15
         [Put] P = 2/3

   3. Click on the [Statistics] tab on the Application Panel. Set
      the statistical mode to X, if necessary, by clicking on the
      mode indicator if it shows "XY". Set the number of data
      points to 1000 by clicking on the displayed number. You are
      ready to yrun teh simulation.

   4. Click on [Eval] and select "All X" from the popup menu.
      The points have been simulated; you can review them by
      clicking on [Edit].

   To show the histogram, do the following:

   5. Click on [Histog], enter the histogram parameters or just
      click on [Find] and [Round], then [OK]. View the histogram.

-------------------------------------------------------------------

Q-22: How to compare a histogram with a distribution function?

A: While the histogram is being displayed, enter into the Expression
  line the distribution density function multiplied by variables
  nn (total number of points in the sample) and dh (histogram bin
  width). (The density function has, obviously, to be normalized
  to one!) Then press the [Add] button. Done.

  For example, we are viewing the histogram of points generated
  in Q-21 (see). A mix of two Gaussian distributions used to
  generate the points there can be described as a linear combination
  of two Gaussian densities with weights P and 1-P, therefore we
  have to enter the following in the Expression Line:

         nn*dh*(P*fgau(t,A,C)+(1-P)*fgau(t,B,D))

  Pressing [Add] will now draw the expected distribution against the
  actual histogram, both normalized to the same scale.

  This is, however, just a visual comparison. It may be nice to
  get some quantitative description of how well the histogram fits
  the distribution.

  To do it, close the histogram (by clicking on [Hide] or pressing
  the Pause key), and enter the density function into the Expression
  Line:

         P*fgau(t,A,C)+(1-P)*fgau(t,B,D)

  Then click on [Good] (named so for the "goodness value" of the
  fit) and choose "Chi square" from the pop-up menu; the resulting
  picture will be very much like the one before. Most importantly,
  however, the Result Display (visible only when you hide the graph)
  will now contain a value reflecting the quality of the fit (refer
  to the Help to see its exact definition), which is 1.2629...
  This value can be used in statistical hypothesis testing, as
  described in the second half of Q-24.

-------------------------------------------------------------------

Q-23: How to fit a histogram with a distribution function?

A: To do this, you've got to have Kalkulator - no other package,
  regardless of size or price will allow you to do it so quickly
  and effortlessly.

  Now, bragging aside, let us consider an example based on plastic
  spheres from Q-21. Assume you've measured 1000 of them, having
  obtained the values generated in Q-21. Can you, based on this
  population, estimate the mean values and standard deviations
  from both manufacturing machines as well as the mix proportion?

  This, obviously, means estimation of A, B, C, D and P from Q-21,
  based on our data point sample. Of all posible double-Gaussian
  distributions we have to find one (defined by a combination
  of five parameter values) which fits the histogram best.

  This is faster done than described.

  1. First, enter the density distribution function using the
     v1..v9 Argument Variables in place of distribution free
     parameters (i.e., parameters with respect to which we do the
     fitting):

               v5*fgau(t,v1,v3)+(1-v5)*fgau(t,v2,v4)

     Obviously, v1 and v2 stand for mean values, v3 and v4 for
     standard deviations, and v5 - for the mix coefficient.

  2. Enter some initial guesses into v1..v5. (Obviously, the better
     the guesses are, the greater the chance that our algorithm
     will actually find a solution.) This means, click on the
     [Args] tab and use the [Put] button to enter the values:

          [Put] v1 = 1.3
          [Put] v2 = 1.2
          [Put] v3 = .25
          [Put] v4 = .25
          [Put] v5 = .5

     Note that the values I've used before are a very crude guess;
     usually you can come up with something much better!

  3. Click on [Fit], decide on the histogram parameters or use
     [Find] and [Round] to have the program do it. After a few
     seconds you will see new values of v1..v5, and a dalog box
     will ask you if you want to make a graph. Say yes. You can
     now view the histogram and the best fit curve, as defined by
     v1..v5.

  Not surprisingly, due to the random nature of our sample, the
  values of v1..v5 differ from those of A..E used in simulation:

        First mean,    v1 = 1.530   while B = 1.5
        Second mean,   v2 = 1.194   while A = 1.2
        First s.d.,    v3 = 0.146   while D = 0.15
        Second s.d.,   v4 = 0.104   while C = 0.1
        Mix rate,      v5 = 0.316   while 1-P = 0.333...

  (Starting from our initial approximation, the program used
  x1 and v3 for the "left" distribution, so that we have to
  compare v5 against P, not 1-P.)

  How good is this "best" fit? Close the histogram window to see
  0.589 as the goodness measure, i.e., sum chi-square divided
  by number of bins (20). And yes, indeed, it is significantly
  (whatever that means!) less than 1.263, obtained in Q-22, which
  means that our values  of v1..v5 describe the sample better than
  the original A..E.

-------------------------------------------------------------------

Q-24: Can I test the fit obtained in Q-23?

A: Yes. The exact procedure depends on the hypothesis you want to
  test. First, let us test the following hypothesis:

  H0: The sample comes from a general population described by
      a linear mix of two Gaussian distributions.

  The test statistics used here is sum chi-square, and we will
  also need the degrees of freedom. The number of d.f. is that of
  histogram bins used in chi-square computation minus one minus
  the number of free parameters estimated from the sample.

  The effective number of bins here will not be 20, as during
  the chi-square computation some of the less-populated bins
  have been merged. To get the effective number, click on [?] in
  the Statistics page - you will see 16.

  Therefore the d.f. number is 16-1-5, i.e., 10. The chi-square
  statistics will be 20*0.589... = 11.788...

  At the 5% significance level, the critical value of the chi-square
  distribution for 10 degrees of freedom can be computed as

     iqchi(0.05,10)

  Type this in, or use the Statistical Function Page and [I], [Q]
  and [chi] buttons to enter the inverse right integral chi-square
  distribution function, iqchi(). The result is 18.307; our test
  statistics is significantly less. This means, there are no
  reasons to reject H0. Done.

  We can also test another hypothesis:

  H0: The sample comes from a general population described by the
      linear mix of two Gaussian distributions with parameters
      given by A..E.

  Such a hypothesis is good when we have, for example, some doubts
  about our simulation procedure: does it really do what it is
  supposed to?

  The procedure is very much like the one described above. The test
  statistics value will now be 20*1.262...=20.258..., with 15
  degrees of freedom (16-1, no parameters estimated from the sample).

  The critical value is

     iqchi(.05,15)

  which gives 24.995... Again, there are no reasons to reject H0
  at the 5% significance level.

-------------------------------------------------------------------

Q-99: How do I get the newest version of Kalkulator?

A: Set your browser to my Web page:

     http://www.wrotniak.net/works/kalkulator/index.html

-------------------------------------------------------------------

