I have been using AI to help me create summaries of the CEDs for my AP classes. It did provide good summaries, and the better or more specific my prompt was, the better results. For example, I typically use chatGPT or NotebookLM and have created and trained chatbots in both. I asked each the same question of each chatboit: “Can you give me some concrete examples of abstraction?”
Here is the NotebookLM prompt
Abstraction in computer science is a powerful concept used to manage complexity by focusing on essential information while hiding underlying details. The sources provide concrete examples of abstraction primarily in two forms: data abstraction and procedural abstraction, as well as in the context of simulations.
Here are some concrete examples of abstraction:
-
Data Abstraction: This form of abstraction provides a name for a collection of data without needing to reference the specific details of its representation.
-
Lists (or other collection types): A key example is the use of a list to represent multiple related items using a single variable. This simplifies the program by treating many individual data points as one conceptual unit. For instance, a program might use a list to store all the items on a grocery list or the seating assignments on a seating chart. Without a list, managing many individual items would require significantly more complex code, or it might not be feasible at all.
-
Binary Representation: At a lower level, the way computers represent data digitally is an abstraction. Bits (0s and 1s) are grouped together to represent more complex abstractions like numbers, characters, or colors. For example, a specific sequence of bits might represent a number in one context but a color in another. This hides the complexity of how the actual electrical signals or magnetic states are interpreted by the computer.
-
Procedural Abstraction: This involves naming a group of programming instructions (a procedure, also known as a method or function) so that it can be used by knowing what it does, not how it does it. This allows a large problem to be broken down into smaller, more manageable subproblems.
-
Procedures with Parameters: Procedures often use parameters to generalize their functionality, enabling them to be reused with a range of different input values. For example, instead of writing separate code segments to draw a square of side length 10 and another for side length 100, a programmer can create a single drawSquare
procedure that takes sideLength
as a parameter. This generalizes the functionality and makes the code reusable for any square size. This practice extracts shared features and avoids duplicating code, which helps manage complexity and improves readability.
-
Reusing Code for Repetitive Tasks: If a program needs to perform the same set of actions multiple times but with slight variations, a procedure can abstract this repetition. For instance, in a program that outputs a nursery rhyme, a programmer could create separate procedures for each “verse” or “chorus” that can be called as needed, rather than writing out each line repeatedly. This makes the overall code more streamlined and easier to understand.
-
Simulations: Simulations are abstractions of real-world objects or phenomena, simplifying functionality or removing specific details for a particular purpose.
- Modeling Real-World Events: Simulations can mimic real-world events that are impractical for experiments due to factors like size, speed, cost, or danger. Concrete examples include simulations of traffic patterns, stock market fluctuations, or weather systems. These simulations use varying sets of values to reflect the changing state of the phenomenon, often incorporating random number generators to simulate real-world variability.
And here is the ChatGPT response
Absolutely! Let’s break down abstraction with concrete, student-friendly examples—especially the kinds that show up in AP CSP projects and Create Task responses.
What Is Abstraction?
Abstraction means simplifying complex things by hiding the details and showing only what’s necessary. Think of it like using a TV remote: you don’t need to know how the remote sends infrared signals—you just press a button, and the channel changes.
In computer science, abstraction often shows up in two ways on the AP exam:
-
Procedural Abstraction – using procedures (functions) to hide details.
-
Data Abstraction – using lists (or collections) to organize and access data.
Concrete Examples of Abstraction
1. Procedural Abstraction Example
Scenario: You write a procedure called calculateGrade(percentage)
in your program.
function calculateGrade(percentage) {
if (percentage >= 90) {
return "A";
} else if (percentage >= 80) {
return "B";
}
// and so on...
}
Call Site:
var studentGrade = calculateGrade(87);
-
Abstraction here: The main program doesn’t worry about the exact logic of how grades are calculated. It just uses calculateGrade()
to get a result.
-
Why it matters: It makes the program easier to read, reusable, and less repetitive.
2. Data Abstraction Example
Scenario: You create a list of scores:
scores = [93, 88, 76, 91];
You then loop through that list to find the highest score.
var highest = 0;
for (var i = 0; i < scores.length; i++) {
if (scores[i] > highest) {
highest = scores[i];
}
}
-
Abstraction here: Instead of creating a separate variable for each score (like score1
, score2
, etc.), you’re using a list to group them. You can now sort, search, and process data with loops.
-
Why it matters: It simplifies how data is stored and manipulated—you don’t have to write repeated code for each item.
3. Real Student Example from AP CSP Create Tasks
Abstraction examples in their project:
Why It Helps You on the Create Task
Quizlet-Ready Flashcards
Abstraction: The process of simplifying complex systems by hiding unnecessary details and showing only essential features.
Procedural Abstraction: Using functions or procedures to reduce code repetition and improve readability.
Data Abstraction: Using data structures like lists to organize related values and simplify access or manipulation.
List: A data structure that stores multiple items under a single name, allowing for efficient iteration and processing.
Procedure: A named set of instructions that performs a specific task and can be reused throughout the program.
Parameter: A variable passed into a procedure that affects how it runs.
Managing Complexity: Using abstractions (like procedures and lists) to simplify program design and reduce repetition.
I have done more training of the AI in ChatGPT ChatBuddy
Nevertheless, I think these two responses would go well together to help me craft a lesson with concrete examples of Abstraction.