Lesson Summary

Pre-lesson preparation

The second session is a programming activity and requires using NetLogo (a tutorial is in the Unit 4 Lesson on Hypothesis Testing with NetLogo) or using Python with Bokeh (for more advanced students).


Students will be introduced to the topic of diversity and computational problems, learn about and discuss implications of the proliferation of algorithms in society, and reflect on how the quality of input data and small, sometimes unintended biases can lead to low quality solutions.


  • Students will consider how diversity leads to better solutions.
  • Students will discuss the proliferation of algorithms in society.
  • Students will learn about some applications of artificial intelligence and machine learning algorithms.
  • Students will explore a computational simulation of bias.
  • Students will understand how small changes in input parameters can affect output quality and variety.
  • Students will program an agent-based model from social science theory.


Session 1

  1. Getting Started (5 min)
    • Artificial intelligence algorithms in daily life?
  2. Discussion (10 min)
    • Algorithms, Input Data, and Diversity
  3. Guided Activty (25 min)
    • Parable of the Polygons
  4. Wrap-up (10 min)

Session 2

  1. Getting Started (5 min)
    • Algorithms, Diversity, and Solutions
  2. Programming Activity (40 min)
    • Make your own Parable of the Polygons
  3. Wrap-up (5 min)

Learning Objectives

CSP Objectives

Big Idea - Creativity
  • EU 1.1 - Creative development can be an essential process for creating computational artifacts.
    • LO 1.1.1 - Apply a creative development process when creating computational artifacts. [P2]
      • EK 1.1.1A - A creative process in the development of a computational artifact can include, but is not limited to, employing nontraditional, nonprescribed techniques; the use of novel combinations of artifacts, tools, and techniques; and the exploration of personal curiosities.
      • EK 1.1.1B - Creating computational artifacts employs an iterative and often exploratory process to translate ideas into tangible form.
  • EU 1.2 - Computing enables people to use creative development processes to create computational artifacts for creative expression or to solve a problem.
    • LO 1.2.2 - Create a computational artifact using computing tools and techniques to solve a problem. [P2]
      • EK 1.2.2A - Computing tools and techniques can enhance the process of finding a solution to a problem.
      • EK 1.2.2B - A creative development process for creating computational artifacts can be used to solve problems when traditional or prescribed computing techniques are not effective.
    • LO 1.2.3 - Create a new computational artifact by combining or modifying existing artifacts. [P2]
      • EK 1.2.3A - Creating computational artifacts can be done by combining and modifying existing artifacts or by creating new artifacts.
    • LO 1.2.5 - Analyze the correctness, usability, functionality, and suitability of computational artifacts. [P4]
      • EK 1.2.5A - The context in which an artifact is used determines the correctness, usability, functionality, and suitability of the artifact.
      • EK 1.2.5D - The suitability (or appropriateness) of a computational artifact may be related to how it is used or perceived.
Big Idea - Abstraction
  • EU 2.3 - Models and simulations use abstraction to generate new understanding and knowledge.
    • LO 2.3.1 - Use models and simulations to represent phenomena. [P3]
      • EK 2.3.1A - Models and simulations are simplified representations of more complex objects or phenomena.
      • EK 2.3.1B - Models may use different abstractions or levels of abstraction depending on the objects or phenomena being posed.
      • EK 2.3.1C - Models often omit unnecessary features of the objects or phenomena that are being modeled.
      • EK 2.3.1D - Simulations mimic real-world events without the cost or danger of building and testing the phenomena in the real world.
    • LO 2.3.2 - Use models and simulations to formulate, refine, and test hypotheses. [P3]
      • EK 2.3.2A - Models and simulations facilitate the formulation and refinement of hypotheses related to the objects or phenomena under consideration.
      • EK 2.3.2D - The results of simulations may generate new knowledge and new hypotheses related to the phenomena being modeled.
      • EK 2.3.2F - Simulations can facilitate extensive and rapid testing of models.
Big Idea - Data
  • EU 3.1 - People use computer programs to process information to gain insight and knowledge.
    • LO 3.1.1 - Find patterns and test hypotheses about digitally processed information to gain insight and knowledge. [P4]
      • EK 3.1.1A - Computers are used in an iterative and interactive way when processing digital information to gain insight and knowledge.
      • EK 3.1.1E - Patterns can emerge when data is transformed using computational tools.
    • LO 3.1.3 - Explain the insight and knowledge gained from digitally processed data by using appropriate visualizations, notations, and precise language. [P5]
      • EK 3.1.3A - Visualization tools and software can communicate information about data.
      • EK 3.1.3B - Tables, diagrams, and textual displays can be used in communicating insight and knowledge gained from data.
      • EK 3.1.3C - Summaries of data analyzed computationally can be effective in communicating insight and knowledge gained from digitally represented information.
      • EK 3.1.3E - Interactivity with data is an aspect of communicating.
  • EU 3.2 - Computing facilitates exploration and the discovery of connections in information.
    • LO 3.2.1 - Extract information from data to discover and explain connections or trends. [P1]
      • EK 3.2.1G - Metadata is data about data.
Big Idea - Impact
  • EU 7.1 - Computing enhances communication, interaction, and cognition.
    • LO 7.1.1 - Explain how computing innovations affect communication, interaction, and cognition. [P4]
      • EK 7.1.1E - Widespread access to information facilitates the identification of problems, development of solutions, and dissemination of results.
      • EK 7.1.1G - Search trends are predictors.
      • EK 7.1.1O - The Internet and the Web have impacted productivity, positively and negatively, in many areas.
  • EU 7.2 - Computing enables innovation in nearly every field.
    • LO 7.2.1 - Explain how computing has impacted innovations in other fields. [P1]
      • EK 7.2.1A - Machine learning and data mining have enabled innovation in medicine, business, and science.
  • EU 7.3 - Computing has global effects — both beneficial and harmful — on people and society.
    • LO 7.3.1 - Analyze the beneficial and harmful effects of computing. [P4]
      • EK 7.3.1A - Innovations enabled by computing raise legal and ethical concerns.
      • EK 7.3.1D - Both authenticated and anonymous access to digital information raise legal and ethical concerns.
      • EK 7.3.1E - Commercial and governmental censorship of digital information raise legal and ethical concerns.
      • EK 7.3.1G - Privacy and security concerns arise in the development and use of computational systems and artifacts.
      • EK 7.3.1H - Aggregation of information, such as geolocation, cookies, and browsing history, raises privacy and security concerns.
      • EK 7.3.1J - Technology enables the collection, use, and exploitation of information about, by, and for individuals, groups, and institutions.
      • EK 7.3.1L - Commercial and governmental curation of information may be exploited if privacy and other protections are ignored.
      • EK 7.3.1M - Targeted advertising is used to help individuals, but it can be misused at both individual and aggregate levels.
  • EU 7.4 - Computing innovations influence and are influenced by the economic, social, and cultural contexts in which they are designed and used.
    • LO 7.4.1 - Explain the connections between computing and real-world contexts, including economic, social, and cultural contexts. [P1]
      • EK 7.4.1C - The global distribution of computing resources raises issues of equity, access, and power.
      • EK 7.4.1D - Groups and individuals are affected by the "digital divide" - differing access to computing and the Internet based on socioeconomic or geographic characteristics.

Math Common Core Practice:

  • MP3: Construct viable arguments and critique the reasoning of others.

Common Core ELA:

  • RST 12.2 - Determine central ideas and conclusions in the text
  • RST 12.6 - Analyze the author's purpose in providing an explanation, describing a procedure
  • RST 12.9 - Synthesize information from a range of sources

NGSS Practices:

  • 2. Developing and using models
  • 7. Engaging in argument from evidence

NGSS Content:

  • HS-ETS1-1. Analyze a major global challenge to specify qualitative and quantitative criteria and constraints for solutions that account for societal needs and wants.
  • HS-ETS1-4. Use a computer simulation to model the impact of proposed solutions to a complex real-world problem with numerous criteria and constraints on interactions within and between systems relevant to the problem.

Teacher Resources

Student computer usage for this lesson is: required

Supplementary articles:

Lesson Plan

Session 1

Getting Started (5 min)

Think-Pair-Share: Artificial intelligence algorithms in daily life?

Ask your students to list discuss what artificial intelligence algorithms they think affect them in daily life and how they are affected. How would it be different if those algorithms did not recognize them or treated them inappropriately? If an algorithm makes the wrong judgement about them, what would they do, who could they go to for help? It is OK if students are unsure about the answers as it leads into the following discussion.

Discussion: Algorithms, Input Data, and Diversity (10 min)

Algorithms have become prominent and common in daily life. In particular, algorithms that use artificial intelligence (AI) or a technique called machine learning are employed to make decisions that affect us, sometimes in ways we aren't aware of and cannot control. For example, machine learning is used by Google, Facebook, Flickr, among other companies to detect faces in photographs, apply labels, or automatically tag images with people they recognize. In general, these algorithms are trained on input data (such as images of people), and are improved iteratively using statistical methods until they learn how to categorize, differentiate, and reach a correct answer. Another example of companies using AI is in personalized marketing or recommendation systems. For instance, Amazon tailors the products they suggest based on an algorithm trained on similar customers' purchase history. Or a company like Netflix will recommend movies to users who rate similar movies similarly.

At the heart of these algorithms is the fact that their solutions all depend on the initial parameters and input data used to train them. What happens when those parameters and data are not sufficiently diverse? Small changes in those parameters, oversights in the training data, implementer bias (both intended and not), and missing distributions or categories can all negatively prejudice algorithms. All this is important to keep in mind as algorithms start determining aspects of our lives and there is less or no control over the input and decisions they make about and for us.

A 2016 article in the New York Times (http://www.nytimes.com/2016/06/26/opinion/sunday/artificial-intelligences-white-guy-problem.html?_r=0) highlights an example problem where lack of diversity leads to lower quality solutions. In particular, various AI and machine learning algorithms were developed by and calibrated on too limited a population, leading to insulting and significantly bad results, such as not recognizing people with dark skin tones or tagging them inappropriately. Examples where diversity may greatly influence the quality and real-world implications of algorithms include:

Guided Activity (25 min)

Parable of the Polygons

A hands-on example of how initial parameters, subtle biases, and lack of diversity can greatly affect an algorithm's execution is in the "Parable of the Polygons" (http://ncase.me/polygons/). The Parable of the Polygon is a simulation based on the mathematical model of how segregated communities may arise from small differences preferences, based on the theory of Thomas Schelling, an economist and game theorist who received the Nobel Prize for Economics in 2005.

Guide students through the website and let them explore dragging polygons, changing settings, and see how they can influence (it is best for them to follow along individually or in groups on their own computer).

An alternative version of the final sandbox with three polygon shapes is also available here: http://ncase.me/polygons-pentagons/play/automatic/automatic_sandbox_frame.html

Wrap-up (10 min)

Journal or Homework

Have your students continue to explore the Parable of the Polygons website and answer the following questions using the sandbox at the bottom of the website:

  • What settings where the ratio of polygon populations are the same lead to the greatest segregation? Why do you think that is?
  • What settings where the ratio of polygon populations are the same lead to the least segregation? Why is that?
  • What settings where polygons still have room to move lead to the algorithm being unable to find a solution (it does not terminate)? Why is that?
  • Answer the same three questions above using the three-polygon version here: http://ncase.me/polygons-pentagons/play/automatic/automatic_sandbox_frame.html

Session 2

Getting Started (5 Min)

Think-Pair-Share: Algorithms, Diversity, and Solutions [5 min]

  • Have students consider one or more of the following questions:
    • How can an algorithm be affected by diversity (such as in its input data)?
    • What does it mean for input or training data to be diverse?
    • Can you think of examples where diversity, or the lack of diversity, affects the quality of an algorithm's solution?
    • Can you think of algorithms that benefit from diverse data?

Programming Activity (40 Min)

Two options: guided programming exploration with NetLogo, or more involved Python programming project for advanced students

Option 1: Using NetLogo

  • If you have not already used NetLogo in the classroom, you can follow the instructions for downloading and setting up NetLogo in the Unit 4 Lesson "Hypothesis Testing with Simulations in NetLogo"
  • Open up NetLogo and go to File->Models Library, then under the Sample Models folder, open the Social Science folder and load the Segregation model
  • For information about the model, read the sections in the Info tab
  • Have the students experiment with the settings and see what differences and similarities it has to the Parable of the Polygons website
  • For the remainder of the activity, have the students make some meaningful changes to the code of the simulation (in the Code tab) and write a short response stating what they did and how their parameters
  • Some suggestions include:
    • Add more types of agents to the model (hint, add another color to the line "set color one-of [red green]")
    • Change the sliders to match the Parable of the Polygons slider (agent count based on ratios, ability to have <50% agents)
  • Finally, a more developed model is included in the NetLogo models library

Option 2: Using Python with Bokeh (for advanced students)

Have students re-create the Parable of the Polygons themselves in Python, time with at least four types of polygon shape/colors. The source code for the Parable website is hosted on GitHub here: https://github.com/ncase/polygons/blob/gh-pages/play/automatic/automatic.js It is in JavaScript, but it serves as a good pseudocode basis. Alternatively, students could use the NetLogo code from Option 1 as another reference in creating their simulation.

Wrap-up (5 Min)

Journal: Have your students reflect and list 5 examples or ways in which diverse input makes for better solutions.