Back to Challenge Set 20

Question Set 12

Difficulty  

divider

What This Is

Six exam-style questions through Activity 2.12, weighted toward efficiency, heuristics, and what cannot be computed. These sets are cumulative, so anything earlier is still fair game.

Algorithm reasoning is the largest single slice of the exam's multiple-choice section. This set is worth more attention than its points suggest.

How to Do This One

  • Set a timer for 11 minutes before you start.
  • When the timer ends, stop. Mark anything unfinished as unfinished — that is real information, not a failure.
  • Work them out. Do not run the code. On exam day there is no computer.
  • For each question, also write sure or unsure. This is graded on completion, so an honest unsure costs you nothing and tells us both where to look.

Guessing beats leaving it blank. There is no penalty for a wrong answer on the AP exam, so a blank is a guaranteed zero where a guess is not.


The Questions

Four have exactly one correct answer, one asks you to select all that apply, and the last is about data or the impact of computing rather than about code.


Question 1

What does the following C# display?

Question 1
int steps = 0;
int n = 25;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < 4; j++)
{
steps = steps + 1;
}
}
Console.WriteLine(steps);
  • (A) 25
  • (B) 100
  • (C) 625
  • (D) 4

Question 2

The number of steps an algorithm takes grows like n × n × n as the input grows. This algorithm is described as running in:

  • (A) Unreasonable time
  • (B) Constant time
  • (C) No time at all
  • (D) Reasonable time

Question 3 — Select all that apply

Which of these are true of a heuristic?

  • (A) It guarantees the best possible answer
  • (B) It produces an answer in a reasonable amount of time
  • (C) It is used when finding the exact best answer would take too long
  • (D) Its answer may be worse than the best possible one
  • (E) It makes an undecidable problem decidable

Question 4

A problem for which no algorithm can be written that always gives a correct yes-or-no answer is called:

  • (A) Undecidable
  • (B) Unreasonable
  • (C) Unsorted
  • (D) A heuristic

Question 5

What is the cheapest way to deliver these twelve parcels? This is best described as:

  • (A) A decision problem
  • (B) An instance of a decision problem
  • (C) An optimization problem
  • (D) An undecidable problem

Question 6 — Data and Impact

A company builds a tool to rank job applications. It is trained on the company's own hiring records from the past ten years, during which the company rarely hired women as engineers. The tool now ranks applications from women lower. This is best described as:

  • (A) A heuristic
  • (B) Bias in a computing innovation
  • (C) Data compression
  • (D) Redundancy

Submit

Six answers, each marked sure or unsure, plus how far you got when the timer went off.

Start the Timer