In simple terms, mathematics is often called the language of the universe. While science requires evidence—the physical proof and observations we gather to understand reality—math is the tool that allows us to measure and apply those findings with precision. By learning math, we gain a new sense to perceive the world accurately. I am beginning this journey today with my son; I am updating this page while teaching him, and I’ve created this page as a resource for all students to explore the power of numbers. The teaching method integrates multiple disciplines: mathematics, systems science, and computer programming as integrated subjects.
Lesson 1
What is a function?

Figure 1
In simple terms, a function is like a machine: you put something in (the input), the machine follows a specific rule to change it, and then it spits out a result (the output).
The most important rule for a function is reliability. For every specific input you provide, you must get exactly one specific output.
Think of a function as a set of instructions. If we name a function f and give it an input x, the result is f(x).
- The Input (x): Also called the Domain. This is what you start with.
- The Relationship (f): This is the rule (e.g., “multiply by 2”).
- The Output f(x) : Also called the Range. This is the final result.
What is X?
What are the possible options that can come to X?
Information, Matter, and Energy?
Story:
The Magic Tea Cafe Story
Imagine there’s a tiny, super-strange cafe in your neighborhood in Sri Lanka called Magic Tea Cafe.
- Every cup of tea costs exactly 50 cents (0.5 dollars).
- They only sell one type of tea — nothing else.
- There’s only one barista named Uncle Dickson who never talks or asks questions.
- The cafe has a very weird rule: No coins allowed! You can only pay with whole dollars — like $1 bills, $2 bills, $5 bills, etc. No 50-cent pieces, no quarters, nothing smaller than $1.
Why does Uncle Dickson sell tea? Uncle Dickson loves tea a lot — he doesn’t drink coffee at all because it makes him too jittery. Instead, he created his own special mix: a powerful blend of Ceylon tea leaves plus lots of herbs (like ginger, lemongrass, mint, and some secret Sri Lankan ones). This special tea gives you a synergetic effect — it makes you feel super active and energetic without any crash later. One sip and you feel ready to run, study, play cricket, or explore all day! That’s why his little cafe is always busy with people who want that natural energy boost from the island’s famous herbs.
When you walk in and hand over your money, Uncle Dickson just looks at the dollars, smiles silently, and starts making cups of his magical herbal tea. He always gives you as many full cups as possible with the money you gave him — and he never gives change back. Whatever little money is left over (not enough for another full cup) just disappears into the tip jar. Magic cafe rules!
Here’s what happens in real examples:
- You give $1 (enough for 2 cups of tea, because 2 × 0.5 = 1). → Uncle Dickson makes 2 cups of his energizing herbal tea for you right away. → Nothing left over → You walk out happy with 2 warm cups and feeling full of energy.
Programming Example
Programming Language : C# – my favorite programming language 🙂
/// <summary>/// Calculates tea output for any whole dollar amount provided./// Rate: $1 = 2 teas. No pennies (decimals) accepted./// </summary>/// <param name="moneyInDollar">The whole dollar amount provided.</param>/// <returns>Number of teas dispensed.</returns>public int CalculateTeaOrder(int moneyInDollar){ // The shop only accepts positive amounts of money if (moneyInDollar > 0) { // $1 = 2 teas, so we multiply the dollar amount by 2 int totalTeas = moneyInDollar * 2; Console.WriteLine($"You provided ${moneyInDollar}. Here are your {totalTeas} teas!"); return totalTeas; } else { // Handles zero or negative inputs Console.WriteLine("Please provide a valid dollar amount."); return 0; }}
Types of Simple Functions
- Constant Function
- Identity Function
- Linear Function : This is the simplest type of function. It changes at a steady, constant rate. The classic formula is:
- Squaring Function
- Simple Fraction Function
- Constant Function: A constant function is a function that gives the same output value for every input
2.Identity Function : An identity function is a function that returns the input exactly as the output.
3. Linear Function : A linear function is a function whose graph is a straight line.
Where:
- = slope (rate of change)
- = y-intercept (value of f(x) when x=0)
