Guess my random function

Introduction

This is a student exercise to test their knowledge of going from the graphical representation of a function to the algebraic representation, i.e. given the graph, write down the expression! The student is then given feedback, and can repeat the exercise any number of times. (This side originally created by Jonas Hall)

Sample construction

When to use

This type of construction is great for allowing the student to practice stuff any number of times. Typically it is effective to use both after a lecture and as repetition or even a small test.

How do you do this?

The construction above uses the following KEY ELEMENTS:
  • Random numbers: Choose from creating random numbers from the following commands: RandomBetween[...] (for integer values) och RandomUniform[...] (for real values). Create some of these random numbers, e.g. a = RandomBetween[-3, 5]. You may also use a list of values, e.g. Alternatives = {-1, 1, 2, 2, 2, 3, 3, 3, 4, 5} a = RandomElement[Alternatives] > Create a few random numbers using the first or last method. These numbers will become the random parameters of your functions. You can update/recalculate them by pressing F9 or Ctrl-R.
  • Two functions: One named f being defined from your random parameters, e.g. f(x) = a x2 + b x + c. The other named g can be any specific function whatsoever e.g. g(x) = x2 + 2x - 3. The function g we will connect to an input field where students can enter their guesses. They have to guess what function f is by entering their guess in the input box connected to g. > Create the functions f and g. Then create an input field that you connect to g. Format this field until satisfied (size, position, length...).
  • Two texts: One of these are to be shown as long as the functions are different and the other one when they are the same. Begin by creating them next to each other. Format these texts until satisfied (size, position, length...). In their properties, under the Advanced tab, you will find Condition to Show Object. Enter f = g in the text to be shown when they are the same ("Great") and f <> g in the text to be shown while they are not the same ("Not yet done"). > Create these texts and make the settings. Don't fret when one of them disappears. Try entering the correct function and see what happens.
  • A button to generate new functions: To avoid having to try to instruct students about pressing F9 or Ctrl-R to regenerate the random numbers you can create a self-explanatory button to do this. Use the Button tool Toolbar Image found in the same group as the Slider tool Toolbar Image Click this tool and then click once in the rough area where you want to have this button. You can move it later by dragging it with the right mouse button. As caption you write e.g. "New function" and as script you type UpdateConstruction[] which will du the same as pressing F9 or Ctrl-R. Save and test your app.
To complete your app, don't forget to:
  • Fix (lock) objects that you don't want students to be able to move (right click and select properties...)
  • Make it suitably small. Consider if you want it to be usable on a phone.
  • Hide the Algebra window
  • You may want to consider a common look for all your apps...?

Screencast of construction

More examples