Education Technology

Credit Cards

Published on 09/21/2016

Activity Overview

How can you tell if a credit card number is a fake? Those seemingly random numbers on a credit card are not random, algorithms exist to detect whether or not they are genuine. If you’re building a website with an online payment system you might want to write some code to instantly detect whether or not the credit card number is a fake.


  • ACMNA192 - Simplify algebraic expressions involving the four operations
  • ACMNA193 - Solve linear equations using algebraic and graphical techniques. Verify solutions by substitution.
  • ACTDIP040 - Design algorithms represented diagrammatically and in structured English and validate algorithms and programs through tracing and test cases



  • Mod
  • Variable
  • Integer


  • For / Endfor
  • If / Then / Else
  • Disp
  • Request

About the Lesson

Students check the validity of a credit card number by-hand and then work through the process to convert the algorithm into a digital format, a computer code. The code incorporates modular arithmetic and scientific notation to deconstruct the credit card number with follow up questions used to validate the code. Challenge questions are then provided to students which involve producing and solving simple linear algebraic equations.