MCQ Reflection
- What I got most wrong on
- Mostly code blocks, like finding errors and solving them, finding the right results of the code, and which code does not work as intended.
- How I am going to improve
- I am going to go over the videos and read the materials Mr. Mort provided us with the collegeboard.
- What I learned
- The MCQ helped me identify which part of the CSP and the MCQ that I am weak at. It gave me an opportunity to go back and reflect why I got the questions wrong, and how I should fix it. It helped me a lot with studying for AP exam because it is a good material to look at for studying the MCQ with similar questions for practice.
Top 5 things I need to learn
1. 3.11: Binary Search
-
Qestion 47: The procedure BinarySearch (numList, target) correctly implements a binary search algorithm on the list of numbers numList. The procedure returns an index where target occurs in numList, or -1 if target does not occur in numList.
Which of the following conditions must be met in order for the procedure to work as intended?
Response: I chose The list numList must not contain any duplicate values because I thought binary search should not contain any duplicate values, but In order for a binary search on a list to work as intended, the list must be sorted.
2. 3.17: Algorithmic Efficiency
-
Q56: Compare execution times of two versions (Learn how to read them)
I chose Version II requires approximately 1 more minute to execute than version I. but the answer was Version I calls the GetPrediction procedure once for each element of idList, or four times total. Since each call requires 1 minute of execution time, version I requires approximately 4 minutes to execute. Version II calls the GetPrediction procedure twice for each element of idList, and then again in the final display statement. This results in the procedure being called nine times, requiring approximately 9 minutes of execution time.
-
Q50: Reasonable time algorithms
Question: Consider the following algorithms. Each algorithm operates on a list containing n elements, where n is a very large integer.
I: An algorithm that accesses each element in the list twice II: An algorithm that accesses each element in the list n times III: An algorithm that accesses only the first 10 elements in the list, regardless of the size of the list
Which of the algorithms run in reasonable time?
Responses: I chose III only because first 10 elements seemed to run faster than accessing all elements.
The answer was all because Algorithm I accesses elements times (twice for each of n elements), which is considered reasonable time. Algorithm II accesses elements (n times for each of n elements), which is considered reasonable time.
3. 3.18: Undecidable Problems
-
Existence of unsolvable problems
Question 27: Which of the following best explains why it is not possible to use computers to solve every problem?
My response: The ability of a computer to solve a problem is limited by the bandwidth of the computer’s Internet connection.
Answer: There exist some problems that cannot be solved using any algorithm.
Reason: It can be proved that there exist some problems that cannot be solved with any algorithm. These problems cannot be solved computationally.
4. 1.4: Identifying and Correcting Errors
-
Error in numOccurrences procedure
Question 67:The procedure NumOccurrences is intended to count and return the number of times targetWord appears in the list wordList. The procedure does not work as intended.
For which of the following code segments will the call to NumOccurrences NOT return the intended value?
Response:
A. For this code segment, count is increased to 1 the first time ”birch” is encountered in the list. However, count is reset to 0 when the code segment moves to the next list element. The last time ”birch” is encountered in the list, count is again increased to 1, causing the procedure to return 1 instead of the intended result 2.
D. For this code segment, count is initialized to 0. Since ”spruce” does not appear in the list, the procedure returns the intended result 0.
Answer: A and B
B: For this code segment, count is increased to 1 the first time ”maple” is encountered in the list. However, count is reset to 0 when the code segment moves to the next list element. This causes the procedure to return 0 instead of the intended result 1.
-
Error in counting perfect numbers
Question 66: In mathematics, a perfect number is a type of integer. The procedure IsPerfect (num) returns true if num is a perfect number and returns false otherwise.
The following program is intended to count and display the number of perfect numbers between the integers start and end, inclusive. Assume that start is less than end. The program does not work as intended.
Which two lines of code should be removed so that the program will work as intended?
Response:
Line 5: This line should be removed. The variable count should increase by 1 when currentNum is a perfect number, so it should only be incremented in the body of the IF statement.
Line 11: This line should not be removed. Every integer from start to end should be checked, so currentNum should be incremented inside the loop but outside the body of the IF statement.
Answer: Line 5, Line 8: This line should not be removed. The variable count should increase by 1 when currentNum is a perfect number, so it should be incremented in the body of the IF statement.
-
Error in AnyPairs procedure
Question 58: The following procedure is intended to return true if at least two of the three parameters are equal in value and is intended to return false otherwise. For which of the following procedure calls does the procedure NOT return the intended value?
Response: AnyPairs (“bat”, “cat”, “rat”), For this set of inputs, the IF condition x = y evaluates to false, so the body of the ELSE statement is executed. The expression y = z evaluates to false, so false is returned as intended.
Answer: AnyPairs (“bat”, “cat”, “bat”), For this set of inputs, false is returned even though two of the inputs are equal in value. The IF condition x = y evaluates to false, so the body of the ELSE statement is executed. The expression y = z evaluates to false, so false is returned.
-
Copy even values from originalList to newList
Question 54: Assume that the list originalList contains integer values and that the list newList is initially empty. The following code segment is intended to copy all even numbers from originalList to newList so that the numbers in newList appear in the same relative order as in originalList. The code segment may or may not work as intended. Which of the following changes, if any, can be made so that the code segment works as intended?
Response: No change is needed; the code segment is correct as is. / The given code segment inserts even elements from oldList at the beginning of newList, causing the elements to appear in reverse order.
Answer: Changing line 5 to APPEND (newList, number) / The given code segment traverses originalList from left to right and inserts all even elements at the beginning of newList. Repeatedly inserting these elements at the beginning of newList causes newList to have the copied elements appear in reverse order compared to their order in originalList. By changing line 5 to APPEND (newList, number), even values are added to the end of newList, ensuring that they will appear in the same relative order as they did in originalList.
-
Error in calculating sum
Question 39: Assume that the list of numbers nums has more than 10 elements. The program below is intended to compute and display the sum of the first 10 elements of nums. Which change, if any, is needed for the program to work as intended?
Response: Line 3 should be changed to REPEAT UNTIL (i ≥ 10). / Making this change to the loop will cause the loop to terminate when i is 10, which does not fix the problem with the program.
Answer: Lines 5 and 6 should be interchanged. / As is, the program does not include the first element of the list in the sum because i is incremented before nums[i] is added to sum. By interchanging these two lines of code, the program will include all of the first ten elements of the list when computing the sum.
5. 4.2: Fault Tolerance
-
Remove connections in network configuration
Question 44: The figure below shows two possible network configurations for devices P through V. A line between two devices indicates a connection. Devices can communicate only through the connections shown. In configuration I, what is the minimum number of connections that must be broken or removed before device T can no longer communicate with device U?
Response: Four / Incorrect. While it is possible to disconnect computers U and T by removing four connections, it can be done by removing only two connections.
Answer: Two / Correct. If the connections between U and V and between U and P were removed, then computer T and computer U can no longer communicate.
Compare to 2018 MCQ
topics I got wrong in 2018 MCQ
- Digital Divide
- Identifying and Correcting Errors
- Developing Algorithms
- Random Values
- Algorithmic Efficiency
What I improved
- I improved on digital divide. Last time, I didn’t understand digital divide fully, but now I understand it.
- I’ve improved on random values and like what is the chance of getting certain results. I learned to read and find the correct chance / percentage.
What I still need to improve
- I got Identifying and Correcting Errors wrong on both MCQ tests. This shows that I need to improve on it.
- Developing Algorithms. Comparing algorithms and comparing outputs give me a hard time. I need to practice how to read them and find the correct output.