# Example: Simplify random fractions

This example uses Fill in the Blanks to create a random exercise about simplifying fractions. The fraction is different each time you start a new exercise.

## Prepare

Use your content management system to start a new Algebrakit question. If you don't have access to Algebrakit, you can use the Algebrakit Testbench.

Adjust the student profile in the top bar to best match the students that will answer this question. Figure: Selecting the student profile

## Set up random exercise parameters

We will let Algebrakit generate proper fractions that can be simplified. A proper fraction is a fraction with numerator smaller than the denominator, such as $\frac{2}{3}$. We will multiply the numerator and denominator with a common factor to generate a fraction that can be simplified. For example, $\frac{2\times5}{3\times 5} = \frac{10}{15}$.

So we need the following exercise parameters:

• to generate a proper fraction, we need two numbers $c1$ and $c2$ with $c2>c1$.
• we choose the common factor in the range 2 to 9.
• the numerator of our fraction is then $factor\cdot c1$ and the denominator is $factor\cdot c2$.

Create the exercise parameters as follows:

• Add the Randomization panel to the top bar using the gear icon on the left.

• In the panel, click '+ Add exercise parameter'.

• Create a random number between 2 and 9 with name $factor$.

• Similarly, add two exercise parameters $c1$ and $c2$ with $c2>c1$. These will be the numerator and denominator of the proper fraction.

• Now we create the numerator and denominator of the fraction. Add a new exercise parameter of type Expression with name $numerator$. In the Expression field, type $factor\cdot c1$. To let Algebrakit evaluate the multiplication, set the Process option to Simplify.

• Create the exercise parameter for the denominator in the same way.

The result is as follows:

## Create the instruction

Enter the student instruction in the instruction text editor.

## Select the Fill in the Blanks question type

Next, select the Fill in the Blanks question type.

## Configure Fill in the Blanks

• Use the formula editor button $f(x)$ to insert the random fraction in the text editor.

• Click on $R_1$ below the text editor to configure the input field. Click on the white bar below Task and input the expression $\frac{numerator}{denominator}$.

## Test the exercise

Press the Test button to see an interactive example and a generated solution for the exercise. Press the Test button again to generate a new example with different random numbers.

## Live example

You can try the exercise below. Press the Edit button to experiment with this question in the Testbench.