Bird
Raised Fist0
Intro to Computingfundamentals~10 mins

Ethics and bias in AI in Intro to Computing - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to print a message about AI fairness.

Intro to Computing
print("AI systems should be [1] to all users.")
Drag options to blanks, or click blank then click option'
Abiased
Bcomplex
Cfair
Dslow
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'biased' because it sounds technical.
Choosing 'complex' thinking AI should be complicated.
2fill in blank
medium

Complete the code to check if AI data is free from {{BLANK_1}}.

Intro to Computing
if data_contains_bias([1]):
    print("Warning: Data has bias!")
Drag options to blanks, or click blank then click option'
Adataset
Balgorithm
Cmodel
Duser
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'algorithm' which is the AI logic, not the data.
Using 'model' which is built from data.
3fill in blank
hard

Fix the error in the code to avoid bias in AI decisions.

Intro to Computing
def make_decision(input_data):
    if input_data['age'] [1] 18:
        return "Reject"
    else:
        return "Accept"
Drag options to blanks, or click blank then click option'
A!=
B>=
C==
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>=' which rejects 18 and older.
Using '==' which only checks exact age.
4fill in blank
hard

Fill both blanks to create a function that checks for bias and returns a fair result.

Intro to Computing
def check_fairness(data):
    bias_found = data.get('[1]', False)
    if bias_found [2] True:
        return "Bias detected"
    return "Fair"
Drag options to blanks, or click blank then click option'
Abias
B==
C!=
Derror
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' which checks for bias not being true.
Using 'error' which is not a valid operator.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that filters biased entries.

Intro to Computing
filtered_data = [1]: [2] for [1] in data if data[[1]] [3] False
Drag options to blanks, or click blank then click option'
Akey
Bdata[key]
C!=
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' which would include biased entries.
Using different variable names causing errors.

Practice

(1/5)
1. What does ethics in AI mainly focus on?
easy
A. Making fair and safe choices in AI systems
B. Improving AI speed and performance
C. Adding more features to AI software
D. Reducing the cost of AI development

Solution

  1. Step 1: Understand the meaning of ethics in AI

    Ethics in AI means making decisions that are fair and safe for everyone.
  2. Step 2: Compare options with the definition

    Only Making fair and safe choices in AI systems talks about fairness and safety, which matches ethics in AI.
  3. Final Answer:

    Making fair and safe choices in AI systems -> Option A
  4. Quick Check:

    Ethics = Fair and safe choices [OK]
Hint: Ethics means fairness and safety in AI decisions [OK]
Common Mistakes:
  • Confusing ethics with technical improvements
  • Thinking ethics is about cost or speed
  • Ignoring fairness and safety aspects
2. Which of the following is the correct way to describe bias in AI?
easy
A. A feature that makes AI faster
B. Unfairness that sneaks into AI from data or design
C. A tool to improve AI accuracy
D. A method to reduce AI errors

Solution

  1. Step 1: Define bias in AI context

    Bias means unfairness that can come from the data or how AI is designed.
  2. Step 2: Match options with bias definition

    Unfairness that sneaks into AI from data or design correctly describes bias as unfairness sneaking into AI.
  3. Final Answer:

    Unfairness that sneaks into AI from data or design -> Option B
  4. Quick Check:

    Bias = Unfairness in AI [OK]
Hint: Bias means unfairness in AI data or design [OK]
Common Mistakes:
  • Thinking bias improves AI
  • Confusing bias with speed or error reduction
  • Ignoring the unfairness aspect
3. Consider this simple AI decision flow:
Input: Age
If Age < 18 then Output = "Minor"
Else Output = "Adult"

What is the output if the input age is 20?
medium
A. "Minor"
B. "Unknown"
C. "Error"
D. "Adult"

Solution

  1. Step 1: Check the input value against the condition

    Input age is 20, which is not less than 18.
  2. Step 2: Follow the decision flow for age 20

    Since 20 ≥ 18, output is "Adult".
  3. Final Answer:

    "Adult" -> Option D
  4. Quick Check:

    Age 20 ≥ 18 -> Output = "Adult" [OK]
Hint: Check if age is less than 18 or not [OK]
Common Mistakes:
  • Choosing "Minor" for age 20
  • Assuming error without reason
  • Ignoring the else condition
4. An AI system shows bias by unfairly favoring one group. Which fix helps reduce this bias?
medium
A. Use more diverse and balanced data for training
B. Make the AI run faster
C. Add more layers to the AI model
D. Ignore the bias since it is small

Solution

  1. Step 1: Identify cause of bias

    Bias often comes from unbalanced or non-diverse training data.
  2. Step 2: Choose the fix that addresses data bias

    Using diverse and balanced data helps AI treat all groups fairly.
  3. Final Answer:

    Use more diverse and balanced data for training -> Option A
  4. Quick Check:

    Diverse data reduces bias [OK]
Hint: Fix bias by improving training data diversity [OK]
Common Mistakes:
  • Thinking speed or model size fixes bias
  • Ignoring bias problems
  • Assuming bias is acceptable if small
5. A company wants to build an AI hiring tool that avoids bias. Which approach best ensures fairness?
hard
A. Use AI to select candidates faster without checks
B. Train AI only on resumes from one city
C. Regularly test AI decisions for fairness and update data
D. Exclude all personal information from resumes

Solution

  1. Step 1: Understand fairness in AI hiring

    Fair AI must be tested regularly to catch bias and updated with good data.
  2. Step 2: Evaluate options for fairness

    Regularly test AI decisions for fairness and update data includes testing and updating, which helps maintain fairness over time.
  3. Step 3: Consider why other options fail

    Train AI only on resumes from one city limits data diversity; C ignores fairness; D may help but alone is not enough.
  4. Final Answer:

    Regularly test AI decisions for fairness and update data -> Option C
  5. Quick Check:

    Testing and updating ensures fairness [OK]
Hint: Fair AI needs ongoing testing and data updates [OK]
Common Mistakes:
  • Using limited data causing bias
  • Ignoring fairness checks
  • Assuming removing info alone fixes bias
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard