Introduction to Algorithms
- 67Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
How did the word “algorithm” develop from the name of Muhammad al-Khwarizmi?
How did the word “algorithm” develop from the name of Muhammad al-Khwarizmi?
67 questions
- 1
How did the word “algorithm” develop from the name of Muhammad al-Khwarizmi?
- A
His name was translated into Greek as a word meaning “calculation.”
- B
His book title was shortened directly to the word “algorithm.”
- C
His name was Latinized as “Algoritmi,” which later became “algorithm.”
- D
His name was combined with the Arabic word for “number.”
Correct answer
CHis name was Latinized as “Algoritmi,” which later became “algorithm.”
Explanation
Al-Khwarizmi’s name was Latinized as “Algoritmi,” and the word “algorithm” developed from that form.
- A
- 2
What did al-Khwarizmi contribute to the numbering system later called Arabic numbering?
- A
He originated the number system and invented its basic symbols.
- B
He introduced a numbering system that used letters instead of digits.
- C
He adopted Indian numbering and presented it under the name Arabic numbering.
- D
He translated Roman numerals into a system based on algebraic equations.
Correct answer
CHe adopted Indian numbering and presented it under the name Arabic numbering.
Explanation
The lecture describes al-Khwarizmi as taking Indian numbering and presenting or “rebadging” it as Arabic numbering.
- A
- 3
Which meaning of “algorithm” is the one primarily used in modern computer science?
- A
A historical Arabic system of numbering
- B
A procedure or set of rules for carrying out a task
- C
A symbolic language used only for algebra
- D
A medical rule for diagnosing an illness
Correct answer
BA procedure or set of rules for carrying out a task
Explanation
The modern meaning emphasized in the lecture is a procedure or set of rules for doing something.
- A
- 4
Which set of properties best describes an effective method as presented in the lecture?
- A
It uses a finite number of exact instructions, always stops, and produces the correct answer.
- B
It uses approximate instructions, may run indefinitely, and usually produces a useful answer.
- C
It chooses instructions freely, stops when convenient, and produces an answer for some inputs.
- D
It requires specialized machinery, can be followed only by experts, and produces repeatable results.
Correct answer
AIt uses a finite number of exact instructions, always stops, and produces the correct answer.
Explanation
An effective method consists of a finite number of exact instructions, terminates after a finite number of steps, and returns the correct answer for problems in its class.
- A
- 5
According to the lecture’s description of an effective method, what resources should a human need to follow it?
- A
A computer, specialist software, and a trained supervisor
- B
Writing materials, with the instructions followed rigorously
- C
An expert’s judgment at every step, with no written instructions
- D
A calculator, a reference library, and permission to improvise
Correct answer
BWriting materials, with the instructions followed rigorously
Explanation
The method should, in principle, be executable by any human without aids other than writing materials, provided its instructions are followed rigorously.
- A
- 6
Why are unambiguity and determinism not identical properties of an algorithm?
- A
An unambiguous algorithm has clear instructions, while a deterministic one gives the same result on repeated runs.
- B
An unambiguous algorithm must always return the same answer, while a deterministic one may vary.
- C
An unambiguous algorithm uses fixed inputs, while a deterministic one must use random inputs.
- D
An unambiguous algorithm must terminate, while a deterministic one may run indefinitely.
Correct answer
AAn unambiguous algorithm has clear instructions, while a deterministic one gives the same result on repeated runs.
Explanation
Unambiguous instructions can still allow different outcomes when conditions or inputs vary. Determinism specifically means that repeated runs produce the same answer.
- A
- 7
Why could a route-finding procedure that takes different roads on different occasions still count as an algorithm?
- A
It qualifies because route-finding does not require instructions or defined inputs.
- B
It is an algorithm only if every run uses exactly the same sequence of roads.
- C
It may respond to changing conditions while retaining the same general structure and endpoints.
- D
It is an algorithm only if it always selects the shortest possible road.
Correct answer
CIt may respond to changing conditions while retaining the same general structure and endpoints.
Explanation
The route may vary with conditions and other inputs, yet the procedure can retain the same overall structure and goal. This illustrates why an algorithm need not be deterministic.
- A
- 8
What does the history of human “computers” illustrate about the original users of algorithms?
- A
Algorithms were initially intended only for automatic electronic machines.
- B
Algorithms were originally designed for people, including teams of skilled mathematicians.
- C
Human computers were used only after computers became inexpensive and widely available.
- D
Human computers mainly repaired the machines that carried out calculations.
Correct answer
BAlgorithms were originally designed for people, including teams of skilled mathematicians.
Explanation
Before electronic computers, “computers” could be people who performed calculations. The lecture emphasizes that algorithms were originally designed for humans to follow.
- A
- 9
Why are standard algorithms useful even though they are not as modular as standard electronic components?
- A
They allow any problem to be solved without adapting the method to its inputs.
- B
They eliminate all customization and guarantee that programs contain no errors.
- C
They ensure that every algorithm has the same performance on every computer.
- D
They provide known solutions to recurring problems, reducing the need to reinvent them.
Correct answer
DThey provide known solutions to recurring problems, reducing the need to reinvent them.
Explanation
Standard algorithms let computer scientists reuse established solutions rather than start from scratch, although adapting them can still involve customization and errors.
- A
- 10
How does bubble sort move values toward a sorted order?
- A
It divides the list into halves and recursively sorts each half.
- B
It compares neighboring values and swaps them when they are out of order.
- C
It selects the smallest remaining value and moves it directly to the front.
- D
It assigns each value to a new position using a hash of its contents.
Correct answer
BIt compares neighboring values and swaps them when they are out of order.
Explanation
Bubble sort repeatedly compares adjacent items and swaps a pair when they are in the wrong order.
- A
- 11
Why can bubble sort take only order N steps in its best case, as described in the lecture?
- A
The algorithm skips all comparisons whenever the list contains more than one item.
- B
An already ordered list can be sorted without inspecting any of its items.
- C
Every item can be moved directly to its final position in a single comparison.
- D
An already ordered list can be checked in one sweep with no swaps before stopping.
Correct answer
DAn already ordered list can be checked in one sweep with no swaps before stopping.
Explanation
If the input is already ordered, bubble sort makes a sweep, finds no adjacent pairs that need swapping, and stops. The lecture identifies this best case as order N.
- A
- 12
Why is the worst-case step complexity of bubble sort order N2?
- A
The algorithm creates N2 new values before it can begin sorting.
- B
Every input requires N sweeps, but each sweep takes only one step.
- C
Reverse-ordered data require about N sweeps, each taking about N steps.
- D
Reverse-ordered data require one sweep, and each comparison takes N steps.
Correct answer
CReverse-ordered data require about N sweeps, each taking about N steps.
Explanation
In the worst case, such as reverse order, values must move through repeated sweeps. With about N sweeps of about N steps each, the total scales as N2.
- A
- 13
Why does algorithm analysis usually count steps rather than measuring elapsed time on one computer?
- A
Step counts describe how work scales without depending directly on a particular computer’s speed.
- B
Step counts include hardware speed, while elapsed time excludes it.
- C
Elapsed time is constant for every algorithm, so measuring it provides no information.
- D
Elapsed time can measure space use, but step counts cannot.
Correct answer
AStep counts describe how work scales without depending directly on a particular computer’s speed.
Explanation
The same algorithm can take different amounts of clock time on different computers. Step complexity focuses on how the amount of work grows with input size.
- A
- 14
What does space complexity measure?
- A
The physical size of the computer that runs the algorithm
- B
The number of comparisons made only in the best-case input
- C
The storage required by an algorithm as the problem is processed
- D
The number of seconds required for one particular computer to finish
Correct answer
CThe storage required by an algorithm as the problem is processed
Explanation
Space complexity concerns the amount of storage needed. The lecture contrasts it with time or step complexity, which is more commonly meant by “complexity” alone.
- A
- 15
What does Big-O notation primarily communicate when used to describe an algorithm?
- A
The number of lines of code needed to implement the algorithm
- B
The probability that the algorithm returns an incorrect result
- C
How the algorithm’s resource use scales as the input problem grows
- D
The exact running time on a specified brand of computer
Correct answer
CHow the algorithm’s resource use scales as the input problem grows
Explanation
Big-O notation is used to describe how an algorithm scales, such as whether its step count grows proportionally to N or N2.
- A
- 16
Which sequence best describes the central strategy of merge sort?
- A
Split the data into smaller lists, sort those lists, and merge them.
- B
Select the nearest value repeatedly, then reverse the resulting list.
- C
Swap adjacent values once, then place the list into a hash table.
- D
Compare every pair in the full list, then remove duplicate values.
Correct answer
ASplit the data into smaller lists, sort those lists, and merge them.
Explanation
Merge sort divides the data into smaller parts, sorts those parts, and combines them into a larger sorted list.
- A
- 17
What role does Timsort play in the examples given in the lecture?
- A
It is a commonly used sorting algorithm in several programming languages and systems.
- B
It is a notation for describing the space complexity of recursive algorithms.
- C
It is a general-purpose replacement for all polynomial-time algorithms.
- D
It is a method for finding an exact solution to the traveling salesperson problem.
Correct answer
AIt is a commonly used sorting algorithm in several programming languages and systems.
Explanation
The lecture identifies Timsort as a widely used sorting algorithm in systems and languages such as Android, Python, and others.
- A
- 18
Why is order N generally preferable to order N2 for sufficiently large inputs?
- A
Order N always uses less memory and gives a more accurate answer.
- B
Order N2 is independent of input size, while order N is not.
- C
Order N grows more slowly, so its work increases less rapidly as input size increases.
- D
Order N guarantees the algorithm finishes in one operation.
Correct answer
COrder N grows more slowly, so its work increases less rapidly as input size increases.
Explanation
Complexity orders compare how resource use grows with input size. Linear growth is slower than quadratic growth, though actual performance can also depend on constants and the specific computer.
- A
- 19
What is a key limitation of using asymptotic complexity as the sole measure of practical performance?
- A
It accounts for hardware but cannot describe how performance changes with input size.
- B
It measures elapsed time exactly but ignores the number of algorithmic steps.
- C
It applies only to sorting and cannot describe other computational problems.
- D
It ignores constants and the particular computer, so a lower order need not be faster for every practical case.
Correct answer
DIt ignores constants and the particular computer, so a lower order need not be faster for every practical case.
Explanation
Asymptotic comparisons focus on scaling and ignore constants and the computer being used. Consequently, a high-constant polynomial method can be slower in practice than a method with a worse asymptotic order on some inputs.
- A
- 20
Which conditions define the circular traveling salesperson problem described in the lecture?
- A
Visit every site once, return to the starting site, and minimize the tour’s distance.
- B
Visit any subset of sites, avoid returning to the start, and minimize the number of turns.
- C
Visit every site as often as needed, return to the start, and maximize the distance.
- D
Visit sites in a fixed order, avoid repeated roads, and minimize the number of sites.
Correct answer
AVisit every site once, return to the starting site, and minimize the tour’s distance.
Explanation
The circular version requires visiting all points once, returning to the starting point, and finding a tour with minimum total distance.
- A
- 21
Why do computer scientists represent a traveling salesperson problem as a graph?
- A
A graph converts the problem into sorting a list of the sites’ names.
- B
A graph represents the sites as points and the possible connections between them.
- C
A graph automatically lists the shortest tour without requiring a search.
- D
A graph removes the need to measure or compare distances between locations.
Correct answer
BA graph represents the sites as points and the possible connections between them.
Explanation
A graph gives a natural representation of the problem: locations are nodes and routes or distances connect them.
- A
- 22
Why does a brute-force search become impractical as the number of traveling salesperson locations grows?
- A
The method becomes inaccurate because distances change during every comparison.
- B
A brute-force search must store a separate computer for every location.
- C
The distance between each pair of locations necessarily grows exponentially.
- D
The number of possible visit orders grows factorially, making the search explode in size.
Correct answer
DThe number of possible visit orders grows factorially, making the search explode in size.
Explanation
Brute force checks possible tours. The number of possible orders grows roughly factorially with the number of locations, which quickly makes exhaustive search infeasible.
- A
- 23
For a circular tour with a fixed starting location, what does (n−1)! represent in a directed brute-force enumeration?
- A
The number of locations that must be revisited before returning
- B
The number of distinct distances between all pairs of locations
- C
The number of sweeps required by the nearest-neighbor method
- D
The number of possible orders for visiting the other n−1 locations
Correct answer
DThe number of possible orders for visiting the other n−1 locations
Explanation
Once the starting location is fixed, the remaining n−1 locations can be ordered in (n−1)! ways. If reversing a tour counts as the same circuit, the count can be halved.
- A
- 24
Why does reducing the time per tour by an enormous factor not necessarily make a large brute-force TSP search practical?
- A
Faster computers increase the number of locations that must be included in every tour.
- B
Factorial growth can overwhelm even dramatic improvements in the time required for each individual step.
- C
Reducing step time changes the distance values, invalidating the search.
- D
Brute-force search has fixed time regardless of how many tours are possible.
Correct answer
BFactorial growth can overwhelm even dramatic improvements in the time required for each individual step.
Explanation
When the number of possibilities grows factorially, making each operation much faster may still leave the total computation impossibly large.
- A
- 25
How does the nearest-neighbor algorithm construct a TSP tour?
- A
It visits locations in alphabetical order and adjusts the route at the end.
- B
It repeatedly moves to the closest unvisited location from the current one.
- C
It checks every complete tour and keeps the shortest one found.
- D
It selects the globally shortest remaining edge and removes its endpoints.
Correct answer
BIt repeatedly moves to the closest unvisited location from the current one.
Explanation
At each step, nearest neighbor chooses a location judged closest to the current position that has not yet been visited.
- A
- 26
Why can running nearest neighbor from different starting locations produce different tour lengths?
- A
The algorithm changes the measured distance between locations after every step.
- B
Each starting point creates a different sequence of locally closest unvisited choices.
- C
Starting locations affect whether the rules require the tour to return to its origin.
- D
The algorithm visits a different number of locations depending on its start.
Correct answer
BEach starting point creates a different sequence of locally closest unvisited choices.
Explanation
A locally closest choice depends on the current location. Changing the start can therefore change later choices and produce a different tour length.
- A
- 27
If a feasible tour has length LNN and the optimal tour has length L∗, what does the lecture mean by an upper bound from a nearest-neighbor tour?
- A
The nearest-neighbor tour gives the exact number of possible routes.
- B
The nearest-neighbor tour is guaranteed to equal the optimum.
- C
The optimum cannot be shorter than the length of that feasible tour.
- D
The optimum cannot be longer than the length of that feasible tour.
Correct answer
DThe optimum cannot be longer than the length of that feasible tour.
Explanation
A feasible tour provides an upper bound on the optimum: the best possible tour cannot be longer than a tour already found. A lower bound, by contrast, indicates a length that the optimum cannot go below.
- A
- 28
What is the practical trade-off between an exact TSP algorithm and an approximate one?
- A
An exact algorithm works only on graphs, while an approximation works only on lists.
- B
An exact algorithm is always faster, while an approximation always returns an invalid tour.
- C
An exact algorithm uses no computation, while an approximation must check every possible tour.
- D
An exact algorithm guarantees the optimum but may be too costly; an approximation can be practical without guaranteeing the optimum.
Correct answer
DAn exact algorithm guarantees the optimum but may be too costly; an approximation can be practical without guaranteeing the optimum.
Explanation
Exact methods return the optimum but can have prohibitive complexity. Approximate methods can be usable on larger problems, though they may return a non-optimal solution.
- A
- 29
What does the lecture say about the Held–Karp algorithm for TSP?
- A
It is a sorting algorithm that merges tours in order of length.
- B
It is an exact method with complexity described as roughly n22n.
- C
It is a linear-time method that visits the nearest location at every step.
- D
It is an approximate method guaranteed to be within a factor of 1.5 of the optimum.
Correct answer
BIt is an exact method with complexity described as roughly n22n.
Explanation
Held–Karp is presented as an exact TSP algorithm with a non-polynomial complexity of approximately n22n, making it suitable mainly for relatively small problems.
- A
- 30
What guarantee does the Christofides algorithm provide in the lecture’s account?
- A
Its tour is always exactly the same length as the optimal tour.
- B
Its tour is no longer than 1.5 times the optimal tour length.
- C
Its tour is no shorter than twice the optimal tour length.
- D
Its computation always takes time proportional to the number of locations.
Correct answer
BIts tour is no longer than 1.5 times the optimal tour length.
Explanation
The lecture describes Christofides as an approximation algorithm whose result is bounded above by 1.5 times the optimum.
- A
- 31
Why are approximation guarantees useful when the exact TSP optimum is unavailable?
- A
They eliminate the need to consider the problem’s computational cost.
- B
They guarantee that every run returns the same approximate tour.
- C
They quantify how far the returned solution can be from the optimum.
- D
They show that the returned solution is exact without further computation.
Correct answer
CThey quantify how far the returned solution can be from the optimum.
Explanation
A known approximation bound provides useful information about solution quality even when computing the exact optimum is impractical.
- A
- 32
What is the main purpose of iteration in an algorithm?
- A
To repeat an operation or sequence of operations.
- B
To define a function only in terms of its own output.
- C
To convert every problem into a yes-or-no question.
- D
To store the program instructions on the input data.
Correct answer
ATo repeat an operation or sequence of operations.
Explanation
Iteration is the repeated execution of an operation or group of operations.
- A
- 33
What makes a definition of factorial recursive?
- A
It repeats a fixed instruction exactly n times without defining smaller cases.
- B
It adds every integer from zero to n without referring to another factorial.
- C
It represents the answer as a yes-or-no decision.
- D
It defines the value for n using the value for n−1.
Correct answer
DIt defines the value for n using the value for n−1.
Explanation
A recursive definition can express n! as n times (n−1)!, defining the function in terms of a smaller instance of itself.
- A
- 34
Which description best distinguishes recursion from iteration?
- A
Recursion applies only to factorials, while iteration applies only to sorting.
- B
Recursion is a diagramming method, while iteration is a way to prove correctness.
- C
Recursion involves an algorithm or function calling itself with different parameters; iteration repeats steps.
- D
Recursion always uses less space than iteration and never repeats computations.
Correct answer
CRecursion involves an algorithm or function calling itself with different parameters; iteration repeats steps.
Explanation
The lecture describes recursion as a structure in which an algorithm calls itself, often with different parameters, and iteration as doing something again and again.
- A
- 35
Why did flowcharts become less popular as a way to represent algorithms?
- A
They could not represent decisions or the order of operations.
- B
They required algorithms to be written in a specific programming language.
- C
They worked only for electronic circuits and not for human procedures.
- D
They were cumbersome to draw on early computers and often required manual drafting.
Correct answer
DThey were cumbersome to draw on early computers and often required manual drafting.
Explanation
The lecturer’s proposed explanation is that graphical work was difficult on early computers, so drawing flowcharts was inconvenient and often involved stencils and manual effort.
- A
- 36
What is a notable weakness of pseudocode as a way to represent algorithms?
- A
It can represent only numerical algorithms and not decision procedures.
- B
Its conventions are not consistently defined, so different people may use different forms.
- C
It requires a computer to execute every instruction as it is written.
- D
It cannot describe the order in which operations should occur.
Correct answer
BIts conventions are not consistently defined, so different people may use different forms.
Explanation
Pseudocode is widely used, but the lecture notes that it lacks a universally followed standard and can therefore be inconsistent.
- A
- 37
What is the Entscheidungsproblem that motivated Turing’s work described in the lecture?
- A
Whether a formula can be shown to follow from a specified set of axioms
- B
Whether every algorithm can be represented as a flowchart
- C
Whether a computer can sort any list in linear time
- D
Whether a program can find the shortest route between two locations
Correct answer
AWhether a formula can be shown to follow from a specified set of axioms
Explanation
The Entscheidungsproblem asks whether one can determine if a formula is derivable from a given set of axioms. The lecture says the general answer is no.
- A
- 38
What was the purpose of Turing’s machine model in the context described?
- A
To build a practical computer faster than the machines available at the time
- B
To replace algebra with a system for drawing flowcharts
- C
To guarantee a solution to every mathematical decision problem
- D
To provide a precise general model for reasoning about computation and algorithms
Correct answer
DTo provide a precise general model for reasoning about computation and algorithms
Explanation
Turing developed a general model of computation while addressing the decision problem. The model helps describe what can be computed, even though it is not itself a practical computer design.
- A
- 39
Which description matches the simple Turing machine model demonstrated in the lecture?
- A
It operates on a graph, can add nodes, and can choose the shortest path.
- B
It operates on a tape, can write or erase symbols, and can move along the tape.
- C
It operates on a stack, can store any real number, and can evaluate equations instantly.
- D
It operates on a flowchart, can redraw branches, and can reorder instructions.
Correct answer
BIt operates on a tape, can write or erase symbols, and can move along the tape.
Explanation
The demonstration describes a tape-based machine that can write a one or zero, erase a digit, and move the tape. This simple model illustrates the basic idea of a Turing machine.
- A
- 40
What additional feature distinguishes a universal Turing machine as described in the lecture?
- A
It uses no tape because its instructions are built into its hardware.
- B
Its program is also represented on the tape, allowing the machine to interpret instructions.
- C
It can solve every problem that requires more than polynomial time.
- D
It is guaranteed to terminate on every program placed on its tape.
Correct answer
BIts program is also represented on the tape, allowing the machine to interpret instructions.
Explanation
In a universal Turing machine, the program is encoded on the tape as well, so the machine can simulate algorithms specified by programs.
- A
- 41
What is the Church–Turing thesis as presented in the lecture?
- A
Every algorithm can be made deterministic by converting it into a flowchart.
- B
Every mathematical statement can be proven using a Turing machine.
- C
Algorithms and Turing machines can simulate one another in the sense that each has an equivalent representation in the other.
- D
Every problem that takes exponential time can be reduced to sorting.
Correct answer
CAlgorithms and Turing machines can simulate one another in the sense that each has an equivalent representation in the other.
Explanation
The lecture presents the Church–Turing thesis as the idea that every algorithm has an equivalent Turing-machine model and every Turing machine corresponds to an algorithm.
- A
- 42
What is a decision problem?
- A
A problem that has no possible input
- B
A problem whose answer must be a sorted list
- C
A problem whose answer is yes or no
- D
A problem that requires a human to choose each instruction
Correct answer
CA problem whose answer is yes or no
Explanation
A decision problem is one that has a yes-or-no answer. Some other problems can be reformulated as decision problems.
- A
- 43
How can the equation z=x+y be recast as a decision problem?
- A
Ask whether x and y are integers and ignore the value of z.
- B
Ask how many operations are required to store the equation.
- C
Ask whether z equals x+y and answer yes or no.
- D
Ask which value is largest and return all three values in order.
Correct answer
CAsk whether z equals x+y and answer yes or no.
Explanation
The equation can be turned into a yes-or-no question: does z equal x+y?
- A
- 44
What does the class P contain, according to the lecture’s formal definition?
- A
All problems whose solutions can be checked only after exponential computation
- B
Problems that can be solved only by probabilistic or quantum computation
- C
Decision problems solvable by a deterministic Turing machine in polynomial time
- D
Problems that require polynomial memory but may take unlimited time
Correct answer
CDecision problems solvable by a deterministic Turing machine in polynomial time
Explanation
P is defined as the class of decision problems solvable in polynomial time by a deterministic Turing machine.
- A
- 45
Why is being in P often treated as a useful rule of thumb for practical tractability?
- A
Membership in P guarantees that a solution is always optimal.
- B
Polynomial-time scaling is generally considered manageable compared with rapidly growing alternatives.
- C
Membership in P means an algorithm requires no computer memory.
- D
Every polynomial-time algorithm is faster than every non-polynomial algorithm on every input.
Correct answer
BPolynomial-time scaling is generally considered manageable compared with rapidly growing alternatives.
Explanation
The lecture treats P as a useful practical rule of thumb because polynomial-time scaling is generally more manageable. It also cautions that real performance depends on factors such as constants and input size.
- A
- 46
Which statement correctly describes the relationship between P and NP?
- A
P and NP are disjoint classes, so no problem can belong to both.
- B
P contains only sorting problems, while NP contains all other problems.
- C
Every problem in NP is also in P, because verification and finding a solution are identical tasks.
- D
Every problem in P is also in NP, because a solution that can be found efficiently can also be verified efficiently.
Correct answer
DEvery problem in P is also in NP, because a solution that can be found efficiently can also be verified efficiently.
Explanation
If a problem can be solved in polynomial time, its solution can also be verified in polynomial time. Thus P is contained within NP.
- A
- 47
What is the defining idea behind NP in the lecture’s explanation?
- A
A solution can always be found in polynomial time.
- B
A proposed solution can be verified in polynomial time.
- C
The problem requires polynomial space but no time limit.
- D
The problem can be solved only by a nondeterministic physical computer.
Correct answer
BA proposed solution can be verified in polynomial time.
Explanation
The lecture distinguishes NP by the ability to verify a proposed solution in polynomial time, even when finding that solution may be difficult.
- A
- 48
Why can checking a completed Sudoku grid be easier than solving an unfinished one?
- A
Solving can be done by inspection, whereas checking requires testing every possible grid.
- B
A completed grid contains fewer clues, so it requires fewer checks than an unfinished grid.
- C
Checking ignores repeated digits, while solving must ensure every digit is unique.
- D
A completed grid can be checked against the row, column, and subgrid rules, while finding a valid completion may require difficult search.
Correct answer
DA completed grid can be checked against the row, column, and subgrid rules, while finding a valid completion may require difficult search.
Explanation
A proposed Sudoku solution can be checked by confirming that the required digits appear without repeats in rows, columns, and subgrids. Finding a solution can be much harder than verifying one.
- A
- 49
What condition makes a Sudoku grid “minimal” in the lecture’s description?
- A
It contains the fewest possible digits in each row.
- B
It cannot be checked without using a computer.
- C
It has exactly one clue in each three-by-three subgrid.
- D
Removing any one of its clues makes the solution no longer unique.
Correct answer
DRemoving any one of its clues makes the solution no longer unique.
Explanation
A minimal Sudoku grid is one in which removing any clue causes the solution to cease being unique.
- A
- 50
What does it mean for a problem to be NP-complete in the lecture’s account?
- A
It is a problem for which proposed solutions cannot be verified efficiently.
- B
It is in NP and captures the essential difficulty of other NP problems through reductions.
- C
It is harder than every problem that can be computed by any machine.
- D
It can be solved exactly in polynomial time using a deterministic machine.
Correct answer
BIt is in NP and captures the essential difficulty of other NP problems through reductions.
Explanation
NP-complete problems are in NP and are connected to other NP problems through reductions, meaning that solving one can capture the essential difficulty of another.
- A
- 51
What is the central question in the P versus NP problem?
- A
Whether every problem requiring polynomial space also requires polynomial time
- B
Whether deterministic machines can compute more than probabilistic machines
- C
Whether every algorithm can be expressed as a flowchart
- D
Whether every problem whose solution is verifiable in polynomial time is also solvable in polynomial time
Correct answer
DWhether every problem whose solution is verifiable in polynomial time is also solvable in polynomial time
Explanation
P versus NP asks whether the class of problems with efficiently verifiable solutions is the same as the class of problems efficiently solvable by deterministic machines.
- A
- 52
What does the lecture say about the current status of the P versus NP question?
- A
It remains unresolved, although many theorists suspect that P and NP differ.
- B
It is not a mathematical question because it depends only on hardware speed.
- C
It has been proved that P equals NP for all decision problems.
- D
It has been proved that P does not equal NP using the halting problem.
Correct answer
AIt remains unresolved, although many theorists suspect that P and NP differ.
Explanation
The lecture describes P versus NP as an open problem and reports that many theorists suspect P is not equal to NP.
- A
- 53
What does the result “PRIMES is in P” establish in the lecture’s example?
- A
Every prime number can be generated by sorting a list in linear time.
- B
Finding primes is impossible for deterministic computers.
- C
Verifying a prime is harder than finding one.
- D
The primality problem can be solved in polynomial time.
Correct answer
DThe primality problem can be solved in polynomial time.
Explanation
The lecture notes that a result published in 2006 showed that the problem of determining whether numbers are prime belongs to P.
- A
- 54
Which description best distinguishes NP-hard problems from NP-complete problems?
- A
NP-hard problems are at least as hard as NP-complete problems, but need not themselves satisfy the NP verification condition.
- B
NP-hard problems are always solvable in polynomial time, while NP-complete problems are not.
- C
NP-hard problems are a subset of P, while NP-complete problems are outside NP.
- D
NP-hard problems have no solutions, while NP-complete problems have many solutions.
Correct answer
ANP-hard problems are at least as hard as NP-complete problems, but need not themselves satisfy the NP verification condition.
Explanation
The lecture describes NP-hard problems as including problems at least as hard as NP-complete ones. Unlike NP-complete problems, an NP-hard problem need not be in NP.
- A
- 55
What is the key feature of a problem in co-NP as described in the lecture clip?
- A
It can be solved with polynomial memory and unlimited time.
- B
It is easy to exclude wrong answers.
- C
It can be solved only by a quantum computer.
- D
It is easy to find every correct answer.
Correct answer
BIt is easy to exclude wrong answers.
Explanation
The lecture clip describes co-NP as a class in which it is easy to exclude wrong answers, while noting that its relationship to NP is uncertain.
- A
- 56
What characterizes PSPACE in the lecture clip?
- A
Problems that necessarily require exponential space and time.
- B
Problems solvable using polynomial space, even if the time required is unlimited.
- C
Problems solvable in polynomial time using no memory.
- D
Problems whose answers can be verified only probabilistically.
Correct answer
BProblems solvable using polynomial space, even if the time required is unlimited.
Explanation
PSPACE is described as the class of problems solvable with a polynomial amount of memory, without the same polynomial-time restriction.
- A
- 57
Which pairing correctly matches the probabilistic and quantum complexity classes mentioned in the lecture clip?
- A
BPP is easy verification, and BQP is easy rejection of incorrect answers.
- B
BPP is exponential time, and BQP is a class of unsolvable problems.
- C
BPP is probabilistic polynomial time, and BQP is its quantum-computing analogue.
- D
BPP is polynomial memory, and BQP is deterministic polynomial time.
Correct answer
CBPP is probabilistic polynomial time, and BQP is its quantum-computing analogue.
Explanation
The clip identifies BPP with problems solvable probabilistically in polynomial time and BQP as the quantum-computing analogue.
- A
- 58
What is the halting problem?
- A
Given an algorithm, determine whether its output is always an integer.
- B
Given a program, determine whether it uses the least possible memory.
- C
Given a program and a Turing machine, determine whether the program will stop.
- D
Given a Turing machine, determine whether it can sort an arbitrary list.
Correct answer
CGiven a program and a Turing machine, determine whether the program will stop.
Explanation
The halting problem asks whether a given program running on a Turing machine will eventually stop. The lecture states that this cannot be decided formally for all cases.
- A
- 59
What does it mean to say the halting problem is undecidable?
- A
No algorithm can correctly determine for every possible program whether it will halt.
- B
No program ever halts unless it is run on a physical computer.
- C
A program’s termination can be determined only by measuring elapsed time.
- D
The problem has no yes-or-no formulation.
Correct answer
ANo algorithm can correctly determine for every possible program whether it will halt.
Explanation
Undecidability means there is no general procedure that always gives the correct yes-or-no answer for every possible instance of the problem.
- A
- 60
How can the gap between finding and verifying solutions support public-key cryptography?
- A
A legitimate user may verify a solution efficiently while an attacker faces a much harder search problem.
- B
The encryption process makes every possible key equally easy to discover.
- C
Both users can avoid computation because the key contains the plaintext.
- D
An attacker can verify a solution only if the legitimate user cannot.
Correct answer
AA legitimate user may verify a solution efficiently while an attacker faces a much harder search problem.
Explanation
The lecture describes an asymmetry in which one party can use an efficiently verifiable solution while an eavesdropper would have to solve a harder problem.
- A
- 61
Why could a proof that P equals NP threaten some public-key cryptography systems?
- A
It would make every encryption algorithm impossible to express as a Turing machine.
- B
It would prevent legitimate users from verifying any solution.
- C
It would force all cryptographic keys to become longer than the messages they protect.
- D
It could make some problems used to protect those systems efficiently solvable, depending on the proof.
Correct answer
DIt could make some problems used to protect those systems efficiently solvable, depending on the proof.
Explanation
If P equaled NP, some currently difficult search problems might become efficiently solvable, potentially undermining cryptographic systems based on their difficulty. The lecture cautions that the consequences would depend on the nature of the proof.
- A
- 62
What conclusion does the lecture draw about problems that lie outside known computable complexity classes?
- A
They are all NP-complete but require a better sorting algorithm.
- B
Every such problem becomes solvable if enough memory is added.
- C
They can be solved by probabilistic computation if the input is small.
- D
Some problems are not solvable by any computer, regardless of available time or space.
Correct answer
DSome problems are not solvable by any computer, regardless of available time or space.
Explanation
The lecture clip distinguishes problems beyond the familiar complexity classes that are not solvable by any computer in any amount of time or space.
- A
- 63
How can an algorithm make biased decisions even if the algorithm itself is not intentionally biased?
- A
It can be biased only if its instructions explicitly mention a protected group.
- B
It can become biased only when it uses random numbers.
- C
It can rely on data or proxies correlated with protected characteristics, producing biased outcomes.
- D
It can make biased decisions only if it produces different answers on repeated runs.
Correct answer
CIt can rely on data or proxies correlated with protected characteristics, producing biased outcomes.
Explanation
The lecture gives an example in which a fraud system used credit scoring correlated with where people lived, while location was correlated with ethnicity. The resulting decisions were biased even though the algorithm was not intentionally racist.
- A
- 64
What does the lecture identify as one approach to reducing algorithmic bias?
- A
Examine and improve the training data so they do not encode harmful biases.
- B
Increase the number of inputs without evaluating their effects.
- C
Remove all data from algorithms and rely only on human intuition.
- D
Make all algorithms deterministic, regardless of the task.
Correct answer
AExamine and improve the training data so they do not encode harmful biases.
Explanation
The lecture points to bias-free training data as one focus of work aimed at producing algorithms with fewer biased outcomes.
- A
- 65
How can repeated software updates create a gap between a system’s original specification and its later behavior?
- A
Updates always remove the system’s original instructions and prevent it from running.
- B
Updates may change the software, and learning systems may also accumulate data from their experience.
- C
A system’s specification changes only when its physical hardware is replaced.
- D
Repeated updates guarantee that the system behaves exactly as first specified.
Correct answer
BUpdates may change the software, and learning systems may also accumulate data from their experience.
Explanation
The lecture notes that a system may be updated after purchase and may even learn from accumulated data, so its later behavior can differ from what was originally specified.
- A
- 66
Why are verifiability and testability important for systems that change through updates or learning?
- A
They help determine whether the changing system still produces appropriate outputs.
- B
They make every system’s internal decisions fully predictable in advance.
- C
They ensure that the system never needs updates or new data.
- D
They replace the need to specify what outputs the system should produce.
Correct answer
AThey help determine whether the changing system still produces appropriate outputs.
Explanation
When a system changes over time, it becomes important to check whether it continues to behave as intended and produces appropriate outputs.
- A
- 67
What was a central weakness of the exam-grading algorithm discussed in the lecture?
- A
It treated every student identically and therefore could not assign different grades.
- B
Its effects were assessed without adequately anticipating the scale and fairness concerns for students.
- C
It was rejected because algorithms cannot process examination results.
- D
It failed because it could not produce any grades for any students.
Correct answer
BIts effects were assessed without adequately anticipating the scale and fairness concerns for students.
Explanation
The lecture says the algorithm was tested for its effects, but decision-makers failed to foresee the broad consequences of disadvantaging many students and the resulting concerns about fairness and justice.
- A

Ask anything
We've read this whole study set, so questions about it get the best answers.