Understand the relationship between AI and decision making
Create a program using conditional constructs to show decision-making in AI on the MIT website
Welcome coders! In this lesson, we’ll explore how Artificial Intelligence (AI) can make decisions just like humans—and how it gets smarter by learning from examples. You’ll meet Alexa, see how machines can learn to clean oceans, and then jump into Scratch to code your own decision-making game using cool blocks like “if-then”! By the end, you’ll see how both machines and you can learn to make smart choices!
Let us play a game to explore how we can teach a machine to clean the ocean. Follow along!
Machines learn by being fed data.
They use this data to recognise patterns and make decisions.
In the video and game we will explore next, we will see how a machine learns to clean the ocean by identifying what’s a fish and what’s trash.
If the machine isn’t given the correct data, it can’t tell the difference and might make wrong decisions.
Let’s watch a short video to understand this better, and then we will try a fun game to see machine learning in action!
Vid 3.1: What is Machine Learning?
Let us play a game to recap the basics of scratch!
Great job! We will now dive into the world of Scratch and create a program to understand how Scratch and decision making are related to each other. Follow the steps to first open and create a Scratch account on your devices and then create a cool game step-by-step!
Action 1: Open Google Chrome on your browser
Action 3: On the search bar type https://scratch.mit.edu/join
Action 3: Your Scratch Homescreen is open!
Action 4: Click on the word ‘Join Scratch’ on the homescreen
Action 5: Create a unique username for your Scratch account. DO NOT add your name.
Action 6: Type a password for your Scratch account, and click on ‘Next’
Action 7: Select your country as ‘India’ and click on ‘Next’
Action 8: Select your birth month and year, and click on ‘Next’
Action 9: Select your ‘Gender’ and click on ‘Next’
Action 10: Type the email-id provided to you by your school, and click on ‘Create Your Account’
Action 11: Once you get this window, click on ‘Get Started’
Action 12: Open your Gmail account and click on the email from Scratch
Action 13: Click on ‘Confirm My Account’
Scratch has a cool interface that has many components. Let us watch this video to get a recap of how Scratch works and what you can do in it.
Vid 3.2: What are the basics of Scratch?
What is the If-Then block?
Scratch uses ‘conditional constructs’ to make decisions. Conditional constructs means that something will only happen IF a certain thing is TRUE.
Real-life Example: If it starts raining, then you go inside the house. But, if it doesn't rain, then you keep playing.
Scratch Example: If 100 > 50, then the Sprite says Hello for 2 seconds.
Let us use the If-Then block in Scratch. We will create a game to make the Sprite say Hello!
Watch this video to see how the game is created.
Vid 3.3: How to create a game using the If-then block?
What is the If-Then-Else block?
Another conditional construct in Scratch is the if-then-else block. It’s like asking a question and having two answers — one for yes and one for no.
Real-life Example: If it is sunny, then we go outside. Else (if it is not sunny), we stay inside and play games.
Scratch Example: If 100 > 50, then the Sprite says Hello for 2 seconds. Else, the Sprite rotates 15 degrees.
Watch this video to see how the if-then-else game works in Scratch
Vid 3.4: How to create a game using the if-then-else block?
In summary, we first learned how AI helps with decision-making by exploring concepts like Machine Learning. Then, we explored Scratch and discovered how conditional constructs, such as ‘if-then’ and ‘if-then-else’ blocks, help us show decision-making in block based coding.