Skip over navigation
Cambridge University Faculty of Mathematics NRich logo
menu search
  • Teachers expand_more
    • Early years
    • Primary
    • Secondary
    • Post-16
    • Events
    • Professional development
  • Students expand_more
    • Primary
    • Secondary
    • Post-16
  • Parents expand_more
    • Early Years
    • Primary
    • Secondary
    • Post-16
  • Problem-Solving Schools
  • About NRICH expand_more
    • About us
    • Impact stories
    • Support us
    • Our funders
    • Contact us
  • search

Or search by topic

Number and algebra

  • The Number System and Place Value
  • Calculations and Numerical Methods
  • Fractions, Decimals, Percentages, Ratio and Proportion
  • Properties of Numbers
  • Patterns, Sequences and Structure
  • Algebraic expressions, equations and formulae
  • Coordinates, Functions and Graphs

Geometry and measure

  • Angles, Polygons, and Geometrical Proof
  • 3D Geometry, Shape and Space
  • Measuring and calculating with units
  • Transformations and constructions
  • Pythagoras and Trigonometry
  • Vectors and Matrices

Probability and statistics

  • Handling, Processing and Representing Data
  • Probability

Working mathematically

  • Thinking mathematically
  • Developing positive attitudes
  • Cross-curricular contexts

Advanced mathematics

  • Decision Mathematics and Combinatorics
  • Advanced Probability and Statistics
  • Mechanics
  • Calculus

For younger learners

  • Early Years Foundation Stage

Your Number Was...

Age 11 to 14
Challenge Level Yellow star
Secondary curriculum
  • Problem
  • Getting Started
  • Student Solutions
  • Teachers' Resources

Why do this problem?

This problem provides a great opportunity to introduce the concept of representing operations on unknown numbers algebraically. It leads to work on inverse operations and solving simple linear equations. When first shown the interactivity, students may be amazed and astonished that it can always work out the starting number. The intention is to provoke their curiosity so they become determined to explain the mystery.
 

Possible approach

You may wish to work on the problem Your Number Is... before trying this.
 
Either work through a few examples using the interactivity, or read out the instructions:
Think of a number
Add 4
Double
Subtract 7
Ask a few students what they finished with and then surprise them by revealing their starting number!
  
As we don't want students to end up thinking maths is a strange magical mystery, it's time to explain what's going on!

One way to begin thinking about this is to collect together some outputs and their corresponding inputs, for example:
 
 Finishing Number   Starting Number 
11 5
17 8
3 1
23 11
14 6.5
 
This is not merely an exercise in pattern spotting - once learners have figured out HOW the machine is working out the starting numbers, they need to understand WHY this works.
It would be good to introduce a variety of methods for explaining what's going on:
  • Represent the instructions as a function machine, and explore what happens when the functions are inverted.
  • Represent the chosen number as $x$ and write an expression for the final number $y$ in terms of $x$. Then rearrange to get $x$ in terms of $y$.
  • Discuss simplification to make the functions easier to invert (so representing it as $y=2x+1$ rather than $y=2(x+4)-7$.
Now challenge the class to come up with their own examples of "Think of a number" instructions, which they can invert to deduce someone's starting number from their final number. Encourage them to record their working using function machines and algebra. Set challenges such as having to include particular operations, at least 6 different operations, and a set of instructions that's really quick to invert.

At the end of the lesson, a selection of students can read out their instructions for the class to try, and then work out starting numbers from the final numbers.

In the "Settings" menu for the interactivity, you can edit the functions used by the machine. Click below to learn more.
 
To access the settings menu, click on the purple cog in the top right corner of the interactivity. The screenshot below shows the menu:
Screenshot showing the settings menu 

You can enter your own sequence, separated by hyphens, using the code "a" for add, "s" for subtract, "m" for multiply and "d" for divide. The sequence a4-m2-s7 in the screenshot represents "Add 4, Multiply by 2, Subtract 7". 

Once you have entered your chosen sequence, click to load it in the current window or a new resizable window.


Key questions

How does the computer "know" what your starting number was?
If you think of a number and add four, what do you need to do to get back to where you started?
If you think of a number, add four, and then double, what do you need to do to get back to where you started?
Is there a way of representing the "Think of a number" trick that helps you to get back to the starting number?
 

Possible support

In the problem Your Number Is..., students can explore visual and symbolic ways of representing number tricks.

 

Possible extension

Think of Two Numbers is a challenging extension.

 

 

 

 

You may also like

Think of Two Numbers

Think of two whole numbers under 10, and follow the steps. I can work out both your numbers very quickly. How?

Special Numbers

My two digit number is special because adding the sum of its digits to the product of its digits gives me my original number. What could my number be?

Your Number Is...

Think of a number and follow the machine's instructions... I know what your number is! Can you explain how I know?

  • Tech help
  • Accessibility Statement
  • Sign up to our newsletter
  • Twitter X logo

The NRICH Project aims to enrich the mathematical experiences of all learners. To support this aim, members of the NRICH team work in a wide range of capacities, including providing professional development for teachers wishing to embed rich mathematical tasks into everyday classroom practice.

NRICH is part of the family of activities in the Millennium Mathematics Project.

University of Cambridge logo NRICH logo