Certified Racket AI Specialist · Foundation
Hello, young explorer! 👋 Have you ever wondered how your video games work, or how a calculator knows that 2+2=4? In this module, we are going to learn the language of computers. We will use a special language called Racket. Racket is like a magic wand that lets us tell a computer what to do. By the end of this module, you will be able to write your very first computer programs, just like a real AI specialist! We'll start from the very beginning, so don't worry if you have never programmed before. This is your first step to becoming a Racket AI Specialist.
We will learn what a computer is, how it thinks, and how we can give it instructions using Racket. Think of it like learning a new language — but instead of talking to people, you will be talking to machines. And the best part? Machines always do exactly what you tell them (even if you make a mistake!).
By the end of this module, you will be able to:
Imagine you have a robot chef named Racky. Racky is super smart, but it only understands a special language. If you say, "Racky, please make me some jollof rice," Racky will just stare at you. But if you say exactly what to do, step by step, like: "Racky, take a pot. Put oil. Add tomatoes. Add rice. Cook for 20 minutes." — then Racky will make perfect jollof rice!
That is exactly what programming is. We give the computer (our robot) a list of clear, simple steps. The computer follows them without getting tired or bored. In this module, we will learn how to give instructions to the computer using Racket.
Let's meet Racket, the language that helps us talk to the computer. Just like learning "hello" and "goodbye" in a new language, we'll start with small words and build up to big, amazing programs.
+-----------------+
| You (coder) |
+--------+--------+
|
| (write Racket code)
V
+-----------------+
| Computer |
| (Racket reads |
| and follows) |
+-----------------+
|
V
+-----------------+
| Result: answer,|
| drawing, game |
+-----------------+
Definition: A computer is a machine that follows instructions to do work. It can add numbers, show pictures, and play music — but only if we tell it how.
Why it matters: To be an AI specialist, you must understand what a computer can and cannot do.
Simple explanation: Think of a computer as a very fast, very dumb worker. It does exactly what you say, no more, no less. If you say "add 2 and 3", it answers 5. If you say "make a cake", it doesn't know what that means (unless you give it a cake recipe).
Real-life example: A calculator is a small computer. You press 2+3, it shows 5.
School example: In math class, your teacher gives you a problem; you solve it. A computer needs every single step.
Home example: When you set the microwave to 2 minutes and press start, the microwave follows that instruction exactly.
Nigerian example: Think of a POS machine. When you enter your PIN and amount, the machine follows the instructions to give you cash.
Illustration:
[Your instruction] ---> [Computer] ---> [Result]
"2 + 3" ---> adds ---> 5
Definition: A programming language is a special way to write instructions that a computer can understand.
Why important: We cannot speak "computer" directly, so we use a programming language as a translator.
Simple explanation: Just like we use English, Yoruba, or Hausa to talk to people, we use a programming language to talk to computers. Racket is one of these languages.
Real-life: English, French, and Spanish are languages for people. Python, Racket, Java are languages for computers.
School: In your school, you might learn English, Maths, and Science. In programming, you learn a language like Racket.
Home: Your mum speaks to you in your mother tongue; you speak to the computer in Racket.
Nigerian: In Nigeria, we have many languages: Yoruba, Igbo, Hausa. Racket is just another language — but for computers.
Illustration:
+-------------+ +----------------+ +-----------+ | You write | ---> | Racket reads | ---> | Computer | | (+ 2 3) | | and translates| | answers 5 | +-------------+ +----------------+ +-----------+
Definition: Racket is a friendly programming language that is great for learning and for building smart AI systems.
Why Racket? It is simple, powerful, and teaches you to think clearly — exactly what an AI specialist needs.
Simple explanation: Racket is like a toy box. It has lots of tools (functions) to play with numbers, words, and even draw pictures.
Real-life: Many top universities use Racket to teach computer science.
School: Imagine if your maths teacher gave you a magic pen that could solve any problem. That's Racket.
Home: If you wanted to teach your younger sibling how to count, you would use simple words. Racket uses simple words too.
Nigerian: Racket is like the "Ube" (Pear) of programming languages — sweet, nutritious, and everyone can enjoy it.
Illustration:
Racket language
|
V
+-------------+
| ( + 5 3 ) | -- means add 5 and 3
+-------------+
|
V
answer: 8
Definition: Numbers are the most basic things we use in Racket. We can add, subtract, multiply, and divide.
Why important: AI often uses math to make decisions — like scoring a game or predicting the weather.
Simple explanation: In Racket, we write math like this: (+ 2 3) means 2+3. The + is the operation, and the numbers are after it.
Real-life: When you buy a snack for 50 Naira and give 100 Naira, the cashier subtracts: 100 - 50 = 50.
School: In class, you write 3 + 4 = 7. In Racket, we write (+ 3 4) and it gives 7.
Home: If you have 5 oranges and eat 2, you have 3 left. In Racket: (- 5 2) → 3.
Nigerian: If you buy 10 sachets of water and share 4, you have 6 left. Racket: (- 10 4).
Illustration:
(+ 2 3) → 5 (- 9 4) → 5 (* 2 3) → 6 (/ 10 2) → 5
Definition: A string is a piece of text, like "Hello" or "Racket is fun". In Racket, we put quotes around strings.
Why it matters: AI systems often need to understand and generate text — like chatbots.
Simple explanation: If you want to say your name, you write "Chidi" in Racket. The quotes tell Racket this is a word, not a math instruction.
Real-life: When you send a text message, that's a string.
School: Your teacher might write "Good job!" on your work. That's a string.
Home: You might say "I love rice" — in Racket that is "I love rice".
Nigerian: "Jollof rice is delicious" — Racket stores it as "Jollof rice is delicious".
Illustration:
"Hello" → a string "123" → a string (not a number) (+ 2 3) → math (+ "2" 3) → error (can't mix string and number)
Definition: In Racket, we write everything in a "prefix" style — the operator (like + or -) comes first, then the values.
Why it's cool: This makes Racket very consistent. Every instruction looks similar: (verb thing1 thing2 ...).
Simple explanation: Instead of saying "2 plus 3", we say "plus 2 3" — like Yoda from Star Wars! "Add you must, 2 and 3."
Real-life: Imagine giving commands to a robot: "Walk forward 2 steps" is like (walk 2).
School: When your teacher says "Read page 10", that's (read page 10) in Racket style.
Home: "Eat 3 bananas" → (eat 3 bananas).
Nigerian: "Buy 5 loaves of bread" → (buy 5 bread).
Illustration:
English style: 2 + 3 Racket style: (+ 2 3) English: "Hello" + " World" Racket: (string-append "Hello" " World")
Definition: A variable is like a box that holds a value. You can put a number or a string inside, and give it a name.
Why important: Variables let us remember things, so we can use them again later.
Simple explanation: Imagine you have a box labelled "age" and you put 10 inside. Now whenever you say age, Racket knows you mean 10.
Real-life: Your school bag has a name tag — that's like a variable. The contents are the value.
School: Your locker number stores your books.
Home: A jar labelled "sweets" — if you put 5 sweets in, the label tells you.
Nigerian: A "kolo" (piggy bank) with "savings" — when you put money in, the name tells you what it is.
Illustration:
(define age 10) ; creates a variable called age with value 10 age → 10 (define name "Ade") ; variable name holds "Ade" name → "Ade"
define to create them.Definition: An if statement lets the computer make choices: if something is true, do one thing; otherwise, do something else.
Why important: AI needs to make decisions — like if it's raining, carry an umbrella.
Simple explanation: If you are hungry, eat. Otherwise, play. Racket can do this too.
Real-life: If the traffic light is red, stop; if green, go.
School: If you score above 70, you get an A. Otherwise, you get a B.
Home: If you finish your homework, you can watch TV.
Nigerian: If the price of beans is cheap, buy more; otherwise, buy less.
Illustration:
(if (< 5 10) "smaller" "bigger") → "smaller" (if (> 5 10) "bigger" "smaller") → "smaller"
Definition: A function is a new command that you create. You give it a name and tell it what to do.
Why it matters: Functions let you reuse code. Once you make a command, you can use it many times.
Simple explanation: Imagine you invent a dance called "The Racket". You teach it to your friend once, then they can do it anytime.
Real-life: A recipe is like a function. Once you write it, you can cook the dish many times.
School: A maths formula like area = length × width is a function.
Home: A chore routine: "tidy room" means pick up toys, make bed.
Nigerian: "Make Jollof" — a function that includes steps: fry, add rice, cook.
Illustration:
(define (square x) (* x x)) ; define a function to square a number (square 5) → 25 (square 3) → 9
Definition: A list is a collection of things, like a shopping list. In Racket, we use ' (1 2 3).
Why important: AI often works with groups of data — like all the scores of a game.
Simple explanation: It's like a queue in school — everyone stands in a line.
Real-life: A grocery list: eggs, milk, bread.
School: A list of students in your class.
Home: A list of chores: sweep, dust, clean.
Nigerian: A list of items to buy at the market: yam, pepper, onions.
Illustration:
'(1 2 3 4) ; a list of numbers
'("apple" "banana") ; a list of strings
(first '(1 2 3)) → 1
(rest '(1 2 3)) → (2 3)
We now know enough to write a tiny AI: a program that greets you and tells you if you can watch TV. Let's combine variables, if, and functions!
(define name "Zainab") (define age 10) (define (can-watch-tv? age) (if (> age 8) "Yes, you may" "No, too young")) (string-append "Hello " name ", " (can-watch-tv? age)) → "Hello Zainab, Yes, you may"
This is a real program! It uses a variable, a function, and an if statement. You just built a tiny AI!
How to write your first Racket program:
(+ 5 6) in the interactions window.(define age 12).age — Racket shows 12.(define (double x) (* x 2)).(double 5) — you get 10!(- 10 3)Encourage learners to type every example themselves. Relate everything to daily life. Use physical objects (like boxes for variables). Emphasize that mistakes are normal — debugging is part of the fun.
Ask your child to teach you what they learned. Let them show you how Racket adds numbers. Celebrate every small success. Learning to code is like learning a sport — practice, patience, and fun!
Racket was originally made for teaching, so it's perfect for beginners like you. And many AI researchers use it to test new ideas!
"hello" not hello.= instead of equal? for comparing.(+ 2 3) is correct, (2 + 3) is not.(+ 2 3 is missing a ).age not x.
+--------+ +--------+ +--------+
| Input | ---> | Racket | ---> | Output |
+--------+ +--------+ +--------+
( + 5 3 ) computes 8
Flow of a program: Start → Get Input → Process → Show Result → End
| Concept | English analogy | Racket example |
|---|---|---|
| Variable | Box with label | (define age 12) |
| Function | Recipe | (define (square x) (* x x)) |
| List | Shopping list | '(1 2 3) |
| If | Decision | (if (> age 8) "big" "small") |
Wow! You've learned so much. You now know what a computer is, how to talk to it using Racket, how to use numbers and words, how to store things in variables, make decisions with if, create your own functions, and group things in lists. You've written your first tiny AI program. You are on your way to becoming a Certified Racket AI Specialist!
| Term | Match |
|---|---|
| 1. (define x 10) | A. Function |
| 2. (define (add a b) (+ a b)) | B. Variable |
| 3. '(a b c) | C. List |
| 4. "hello" | D. String |
Answers: 1-B, 2-A, 3-C, 4-D
Scenario: You are building a simple bot for a shop. It should take the item price and quantity and calculate the total. How would you do it in Racket?
Answer: (define (total price qty) (* price qty))
In groups of 3, pretend you are a computer. One person gives instructions like "(+ 4 5)", another computes the answer, and the third checks if it's correct. Take turns.
Write a Racket expression that adds 10 and 20, multiplies the result by 2, and stores it in a variable called "result".
Create a simple "greeting bot" that asks for your name and says hello. Use a variable, a string, and display a message. (You can use (display) or just return a string.)
Write a Racket program that takes your age and tells you if you are old enough to ride a rollercoaster (age > 12).
Write a function that takes a list of numbers and returns the sum of all the numbers. (Hint: you can use recursion or the built-in (apply + list).)
Multiple choice answers: 1-A, 2-A, 3-A, 4-B, 5-A, 6-A, 7-B, 8-A, 9-A, 10-A, 11-B, 12-D, 13-A, 14-A, 15-B.
In Module Two, we will dive deeper into decision-making and start building more intelligent programs. We'll learn about logic, more math, and how to make our programs "remember" things. Get ready to create a tiny chatbot!
Before then, practice writing simple Racket expressions, create your own variables, and write at least three functions. The more you practice, the more it will stick.
🎉 You've completed Module One · Great job, future AI specialist! 🎉