Computational Thinking: Decomposition and Abstraction
Breaking problems into parts and focusing on the important details
Computational Thinking: Decomposition and Abstraction
Breaking problems into parts and focusing on the important details
CS - Grade 6-8
- 1
A student wants to build a simple quiz app. Break this project into at least four smaller tasks using decomposition.
Think about what the app must do from the beginning to the end of a quiz.
A good decomposition could include creating quiz questions, showing one question at a time, checking the user's answer, keeping score, and displaying the final result. - 2
Which details should be included in an abstraction for a school bus tracking app: bus number, current location, favorite color of the driver, estimated arrival time, and number of seats? Explain your choices.
Choose details that help solve the main problem.
The abstraction should include the bus number, current location, and estimated arrival time because these details help users track the bus. The driver's favorite color and number of seats are not usually needed for tracking. - 3
A teacher says, "Make a plan for cleaning the classroom." Use decomposition to list five smaller steps.
The task can be decomposed into picking up trash, organizing desks, wiping tables, putting supplies away, and sweeping the floor. Each smaller task is easier to assign and complete. - 4
Look at this task: "Create a character for a video game." Name three important details to include in an abstraction and two details that could be ignored at first.
Focus on details that affect how the character works in the game.
Important details could include the character's health, speed, and abilities because they affect gameplay. Details such as the character's birthday or favorite snack could be ignored at first because they do not affect the basic game behavior. - 5
A recipe website needs a search feature. Break the search feature into at least four smaller tasks.
The search feature can be decomposed into getting the user's search words, comparing the words to recipe titles and ingredients, sorting or filtering the results, and showing the matching recipes on the screen. - 6
Explain the difference between decomposition and abstraction in your own words.
One strategy is about parts, and the other is about details.
Decomposition means breaking a large problem into smaller parts. Abstraction means focusing on the important details of a problem or object while leaving out details that are not needed. - 7
A map app uses a simplified map instead of showing every tree, bench, and mailbox. Is this an example of decomposition or abstraction? Explain.
This is an example of abstraction because the map app shows only the important information, such as roads, landmarks, and routes, while leaving out details that are not needed for navigation. - 8
A school lunch ordering system has these parts: student login, menu display, order selection, payment, and order confirmation. Which computational thinking strategy is shown by this list? Explain.
Look for whether the problem is being split into tasks or simplified by removing details.
This list shows decomposition because the larger lunch ordering system has been broken into smaller parts that can be designed, tested, and improved separately. - 9
Create an abstraction for a book in a library catalog. List five details that should be stored for each book.
A useful abstraction for a book could store the title, author, genre, publication year, and availability. These details help users search for and borrow books. - 10
A robot must deliver a package from the office to Room 204. Decompose the robot's job into six ordered steps.
Put the steps in the order the robot would do them.
The robot's job can be decomposed into receiving the delivery request, picking up the package, planning a route, moving through the hallway, stopping at Room 204, and dropping off the package. - 11
A weather app shows temperature, chance of rain, wind speed, and a short forecast. It does not show the exact reading from every weather sensor. Why is this an abstraction?
It is an abstraction because the app presents the most useful weather information in a simple way. It hides extra sensor data that most users do not need to understand the forecast. - 12
A team is making a website for a school club. Assign each smaller task to one team member: writing text, choosing images, creating the layout, checking links, and publishing the site. How does decomposition help the team?
Think about teamwork and managing a large project.
Decomposition helps the team because the website project is split into smaller tasks that different people can work on at the same time. This makes the project easier to organize and complete. - 13
You are designing a contact list app. Decide whether each detail is essential or not essential for a basic contact abstraction: name, phone number, email address, shoe size, home address, favorite movie.
For a basic contact abstraction, name, phone number, email address, and possibly home address are essential because they help identify or contact the person. Shoe size and favorite movie are not essential for a basic contact list. - 14
A flowchart for brushing teeth has these steps: get toothbrush, add toothpaste, brush teeth, rinse mouth, clean up. What larger task has been decomposed, and why is the flowchart useful?
Think about what all the smaller steps are trying to accomplish together.
The larger task is brushing teeth. The flowchart is useful because it breaks the task into clear ordered steps that are easier to follow, check, or turn into instructions for a computer or robot. - 15
A game designer first models an enemy as only position, health, speed, and attack strength. Later, the designer adds color, sound effects, and animation. Why is starting with the simpler model useful?
Think about why programmers often build and test the main features first.
Starting with the simpler model is useful because it focuses on the most important details needed for the enemy to work in the game. Extra details can be added later after the basic behavior is designed and tested.