AP CSP Unit 6 College Board Questions

Ace your homework & exams now with Quizwiz!

Based on the values in the table, which of the following best characterizes the algorithm for drawing n shapes, where n is a very large number? A) The algorithm runs in a reasonable amount of time because it will use approximately n steps to draw n shapes. B) The algorithm runs in a reasonable amount of time because it will use approximately n2 steps to draw n shapes. C) The algorithm runs in an unreasonable amount of time because it will use approximately n steps to draw n shapes. D) The algorithm runs in an unreasonable amount of time because it will use approximately n2 steps to draw n shapes.

B

Suppose that a list of numbers contains values [-4, -1, 1, 5, 2, 10, 10, 15, 30]. Which of the following best explains why a binary search should NOT be used to search for an item in this list? A) The list contains both positive and negative elements. B) The elements of the list are not sorted. C) The list contains an odd number of elements. D) The list contains duplicate elements.

B

A student is creating a Web site that is intended to display information about a city based on a city name that a user enters in a text field. Which of the following are likely to be challenges associated with processing city names that users might provide as input? Select two answers. A) Users might attempt to use the Web site to search for multiple cities. B) Users might enter abbreviations for the names of cities. C) Users might misspell the name of the city. D) Users might be slow at typing a city name in the text field.

B, C

A certain programming language uses 4-bit binary sequences to represent nonnegative integers. For example, the binary sequence 0101 represents the corresponding decimal value 5. Using this programming language, a programmer attempts to add the decimal values 14 and 15 and assign the sum to the variable total. Which of the following best describes the result of this operation? A) The correct sum of 29 will be assigned to the variable total. B) An overflow error will occur because 4 bits is not large enough to represent either of the values 14 or 15. C) An overflow error will occur because 4 bits is not large enough to represent 29, the sum of 14 and 15. D) A round-off error will occur because the decimal values 14 and 15 are represented as approximations due to the fixed number of bits used to represent numbers.

C

A camera mounted on the dashboard of a car captures an image of the view from the driver's seat every second. Each image is stored as data. Along with each image, the camera also captures and stores the car's speed, the date and time, and the car's GPS location as metadata. Which of the following can best be determined using only the data and none of the metadata? A) The average number of hours per day that the car is in use B) The car's average speed on a particular day C) The distance the car traveled on a particular day D) The number of bicycles the car passed on a particular day

D

A video game character can face toward one of four directions: north, south, east, and west. Each direction is stored in memory as a sequence of four bits. A new version of the game is created in which the character can face toward one of eight directions, adding northwest, northeast, southwest, and southeast to the original four possibilities. Which of the following statements is true about how the eight directions must be stored in memory? A) Four bits are not enough to store the eight directions. Five bits are needed for the new version of the game. B) Four bits are not enough to store the eight directions. Eight bits are needed for the new version of the game. C) Four bits are not enough to store the eight directions. Sixteen bits are needed for the new version of the game. D) Four bits are enough to store the eight directions.

D

For which of the following lists can a binary search be used to search for an item in the list? 1. ["blue", "green", "jade", "mauve", "pink"] 2. [5, 5, 5, 5, 6, 7, 8, 8, 8] 3. [10, 5, 3, 2, -4, -8, -9, -12] A) 1 B) 3 C) 1, 3 D) 1, 2, 3

D

The position of a runner in a race is a type of analog data. The runner's position is tracked using sensors. Which of the following best describes how the position of the runner is represented digitally? A) The position of the runner is determined by calculating the time difference between the start and the end of the race and making an estimation based on the runner's average speed. B) The position of the runner is measured and rounded to either 0 or 1 depending on whether the runner is closer to the starting line or closer to the finish line. C) The position of the runner is predicted using a model based on performance data captured from previous races. D) The position of the runner is sampled at regular intervals to approximate the real-word position, and a sequence of bits is used to represent each sample.

D

Which of the following are true statements about the data that can be represented using binary sequences? 1. Binary sequences can be used to represent strings of characters. 2. Binary sequences can be used to represent colors. 3. Binary sequences can be used to represent audio recordings. A) 1 B) 1, 2 C) 2, 3 D) 1, 2, 3

D

A database of information about shows at a concert venue contains the following information. - Name of artist performing at the show - Date of show - Total dollar amount of all tickets sold Which of the following additional pieces of information would be most useful in determining the artist with the greatest attendance during a particular month? A) Average ticket price B) Length of the show in minutes C) Start time of the show D) Total dollar amount of food and drinks sold during the show

A

A user wants to save a data file on an online storage site. The user wants to reduce the size of the file, if possible, and wants to be able to completely restore the file to its original version. Which of the following actions best supports the user's needs? A) Compressing the file using a lossless compression algorithm before uploading it B) Compressing the file using a lossy compression algorithm before uploading it C) Compressing the file using both lossy and lossless compression algorithms before uploading it D) Uploading the original file without using any compression algorithm

A

A team of programmers is designing software. One portion of the project presents a problem for which there is not an obvious solution. After some research, the team determines that the problem is undecidable. Which of the following best explains the consequence of the problem being undecidable? A) The problem can be solved algorithmically, but it will require an unreasonably long amount of time. B) The problem can be solved algorithmically, but it will require an unreasonably large amount of data storage. C) There is no possible algorithm that can be used to solve all instances of the problem. D) There are several different possible algorithms that can solve the problem, but there is controversy about which is the most efficient.

C

In which of the following scenarios is using a simulation more beneficial than performing a calculation? Select two answers. A) Determining the average grade of the students in a certain class B) Keeping track of the high score in a game C) Investigating ways to reduce the amount of trash in the ocean D) Studying the effect of a genetic change in a population

C, D

Consider the following numeric values. - Binary 1011 - Binary 1101 - Decimal 5 - Decimal 12 Which of the following lists the values in order from least to greatest? A) Decimal 5, binary 1011, decimal 12, binary 1101 B) Decimal 5, decimal 12, binary 1011, binary 1101 C) Decimal 5, binary 1011, binary 1101, decimal 12 D) Binary 1011, binary 1101, decimal 5, decimal 12

A

For a given row in the spreadsheet, suppose genre contains the genre as a string, num contains the number of copies in stock as a number, and cost contains the cost as a number. Which of the following expressions will evaluate to true if the book should be counted and evaluates to false otherwise? A) (genre = "mystery") AND ((1 ≤ num) AND (cost < 10.00)) B) (genre = "mystery") AND ((1 < num) AND (cost < 10.00)) C) (genre = "mystery") OR ((1 ≤ num) OR (cost < 10.00)) D) (genre = "mystery") OR ((1 < num) OR (cost < 10.00))

A

For which of the following problems is using a simulation LEAST likely to be beneficial? A) Determining the longest word in a textbook B) Minimizing the customer wait times at a bank C) Predicting the outcomes of weather patterns D) Studying the formation of a galaxy

A

The list listOne is a sorted list of numbers that contains 700 elements. The list listTwo is a sorted list of numbers that contains 900 elements. Let x represent the maximum number of list elements that will need to be examined when performing a binary search for a value in listOne, and let y represent the maximum number of list elements that will need to be examined when performing a binary search for a value in listTwo. Which of the following statements about x and y is true? A) The value of x is approximately equal to the value of y. B) The value of x is approximately 10 less than the value of y. C) The value of x is approximately 13 less than the value of y. D) The value of x is approximately 200 less than the value of y.

A

Upon compiling the data, the researcher identifies a problem due to the fact that neither data source uses a unique ID number for each student. Which of the following best describes the problem caused by the lack of unique ID numbers? A) Students who have the same name may be confused with each other. B) Students who have the same grade point average may be confused with each other. C) Students who have the same grade level may be confused with each other. D) Students who have the same number of absences may be confused with each other.

A

Which of the following is a benefit of using a simulation instead of an experiment to make a prediction? Select two answers. A) A simulation allows investigation of a phenomenon without the real-world limitations on time, safety, or budget. B) A simulation can be used to model real-world events that are impractical for experiments. C) A simulation always produces the same output, so its results can be verified. D) A simulation produces results that are more accurate than experimental results.

A, B

A computer scientist is analyzing four different algorithms used to sort a list. The table below shows the number of steps each algorithm took to sort lists of different sizes. Based on the values in the table, which of the algorithms appear to run in reasonable time? Select two answers. A) Algorithm A B) Algorithm B C) Algorithm C D) Algorithm D

A, D

A city planner is using simulation software to study crowd flow out of a large arena after an event has ended. The arena is located in an urban city. Which of the following best describes a limitation of using a simulation for this purpose? A) The model used by the simulation software cannot be modified once the simulation has been used. B) The model used by the simulation software often omits details so that it is easier to implement. C) Running a simulation requires more time to generate data from trials than observing the crowd exiting the arena at various events. D) Running a simulation requires a large number of observations to be collected before it can be used to explore a problem.

B

A large number of genetic codes are stored as binary values in a list. Which one of the following conditions must be true in order for a researcher to obtain the correct result when using a binary search algorithm to determine if a given genetic code is in the list? A) The genetic codes must be converted from binary to decimal numbers. B) The list must be sorted based on the genetic code values. C) The number of genetic code values in the list must be a power of 2. D) The number of genetic code values in the list must be even.

B

A sorted list of numbers contains 200 elements. Which of the following is closest to the maximum number of list elements that will need to be examined when performing a binary search for a particular value in the list? A) 5 B) 8 C) 100 D) 200

B

A student wants to count the number of shows that meet both of the following criteria. - Is a talk show - Is on Saturday or Sunday For a given row in the spreadsheet, suppose genre contains the genre as a string and day contains the day as a string. Which of the following expressions will evaluate to true if the show should be counted and evaluates to false otherwise? A) (genre = "talk") AND ((day = "Saturday") AND (day = "Sunday")) B) (genre = "talk") AND ((day = "Saturday") OR (day = "Sunday")) C) (genre = "talk") OR ((day = "Saturday") AND (day = "Sunday")) D) (genre = "talk") OR ((day = "Saturday") OR (day = "Sunday"))

B

A student wants to determine whether a certain problem is undecidable. Which of the following will demonstrate that the problem is undecidable? A) Show that for one instance of the problem, an algorithm can be written that is always capable of providing a correct yes-or-no answer. B) Show that for one instance of the problem, no algorithm can be written that is capable of providing a correct yes-or-no answer. C) Show that for one instance of the problem, a heuristic is needed to write an algorithm that is capable of providing a correct yes-or-no answer. D) Show that for one instance of the problem, an algorithm that runs in unreasonable time can be written that is capable of providing a correct yes-or-no answer.

B

A team of researchers wants to create a program to analyze the amount of pollution reported in roughly 3,000 counties across the United States. The program is intended to combine county data sets and then process the data. Which of the following is most likely to be a challenge in creating the program? A) A computer program cannot combine data from different files. B) Different counties may organize data in different ways. C) The number of counties is too large for the program to process. D) The total number of rows of data is too large for the program to process.

B

A time stamp indicates the date and time that a measurement was taken. A data scientist has a list containing 10,000 time stamps, sorted in chronological order. Which of the following is closest to the maximum number of values that will need to be examined when performing a binary search for a value in the list? A) 10 B) 15 C) 5,000 D) 10,000

B

For which of the following situations would it be best to use a heuristic in order to find a solution that runs in a reasonable amount of time? A) Appending a value to a list of n elements, which requires no list elements be examined. B) Finding the fastest route that visits every location among n locations, which requires n!n! possible routes be examined. C) Performing a binary search for a score in a sorted list of n scores, which requires that fewer than n scores be examined. D) Performing a linear search for a name in an unsorted database of n people, which requires that up to n entries be examined.

B

Which of the following is an advantage of a lossless compression algorithm over a lossy compression algorithm? A) A lossless compression algorithm can guarantee that compressed information is kept secure, while a lossy compression algorithm cannot. B) A lossless compression algorithm can guarantee reconstruction of original data, while a lossy compression algorithm cannot. C) A lossless compression algorithm typically allows for faster transmission speeds than does a lossy compression algorithm. D) A lossless compression algorithm typically provides a greater reduction in the number of bits stored or transmitted than does a lossy compression algorithm.

B

A student is developing an algorithm to determine the name of the photographer who took the oldest photograph in the collection. Photographs whose photographer or year are unknown are to be ignored. Once the algorithm is complete, the desired entry will appear in the first row of the spreadsheet. If there are multiple entries that meet the desired criteria, then any of them can appear in the first row. Assume that applying either of the filters will not change the relative order of the rows remaining in the spreadsheet.Which of the following sequences of steps can be used to identify the desired entry? Select two answers. A) Filter by photographer, then filter by year, then sort by subject B) Filter by photographer, then filter by year, then sort by year C) Sort by subject, then sort by year, then filter by photographer D) Sort by year, then filter by year, then filter by photographer

B, D

A programmer is developing software for a social media platform. The programmer is planning to use compression when users send attachments to other users. Which of the following is a true statement about the use of compression? A) Lossless compression of video files will generally save more space than lossy compression of video files. B) Lossless compression of an image file will generally result in a file that is equal in size to the original file. C) Lossy compression of an image file generally provides a greater reduction in transmission time than lossless compression does. D) Sound clips compressed with lossy compression for storage on the platform can be restored to their original quality when they are played.

C

A teacher sends students an anonymous survey in order to learn more about the students' work habits. The survey contains the following questions. - On average, how long does homework take you each night (in minutes) ? - On average, how long do you study for each test (in minutes) ? - Do you enjoy the subject material of this class (yes or no) ? Which of the following questions about the students who responded to the survey can the teacher answer by analyzing the survey results? 1. Do students who enjoy the subject material tend to spend more time on homework each night than the other students do? 2. Do students who spend more time on homework each night tend to spend less time studying for tests than the other students do? 3. Do students who spend more time studying for tests tend to earn higher grades in the class than the other students do? A) 1 B) 3 C) 1, 2 D) 1, 2, 3

C

Consider the 4-bit binary numbers 0011, 0110, and 1111. Which of the following decimal values is NOT equal to one of these binary numbers? A) 3 B) 6 C) 9 D) 15

C

The preserve has two databases of information available to use for the exhibit. The first database contains information for each animal's name, classification, skin type, and thermoregulation. The second database contains information for each animal's name, lifestyle, average life span, and top speed. Which of the following explains how the two databases can be used to develop the interactive exhibit? A) Only the first database is needed. It can be searched by animal name to find all the information to be displayed. B) Only the second database is needed. It can be searched by animal name to find all the information to be displayed. C) Both databases are needed. Each database can be searched by animal name to find all information to be displayed. D) The two databases are not sufficient to display all the necessary information because the intended display information does not include the animal name.

C

A new rechargeable battery pack is available for products that use AA batteries. Which of the following best explains how the data files in the table can be used to send a targeted e-mail to only those customers who have purchased products that use AA batteries to let them know about the new accessory? A) Use the customer IDs in the purchases file to search the customers file to generate a list of e-mail addresses B) Use the product IDs in the purchases file to search the products file to generate a list of product names that use AA batteries C) Use the customers file to generate a list of customer IDs, then use the list of customer IDs to search the products file to generate a list of product names that use AA batteries D) Use the products file to generate a list of product IDs that use AA batteries, then use the list of product IDs to search the purchases file to generate a list of customer IDs, then use the list of customer IDs to search the customers file to generate a list of e-mail addresses

D

In which of the following scenarios would a simulation be the LEAST beneficial? A) An engineering company wants to test whether a change to a car design will negatively affect fuel efficiency. B) An insurance company wants to study the effect of cold weather patterns on health-care costs. C) A manufacturing company wants to determine whether using robots in its facility will increase productivity. D) A retail company wants to determine the most popular item that was sold on the company's Web site last month.

D

The owner of a clothing store records the following information for each transaction made at the store during a 7-day period. The date of the transaction The method of payment used in the transaction The number of items purchased in the transaction The total amount of the transaction, in dollars Customers can pay for purchases using cash, check, a debit card, or a credit card. Using only the data collected during the 7-day period, which of the following statements is true? A) The average amount spent per day during the 7-day period can be determined by sorting the data by the total transaction amount, then adding the 7 greatest amounts, and then dividing the sum by 7. B) The method of payment that was used in the greatest number of transactions during the 7-day period can be determined by sorting the data by the method of payment, then adding the number of items purchased for each type of payment method, and then finding the maximum sum. C) The most expensive item purchased on a given date can be determined by searching the data for all items purchased on the given date and then sorting the matching items by item price. D) The total number of items purchased on a given date can be determined by searching the data for all transactions that occurred on the given date and then adding the number of items purchased for each matching transaction.

D

The transportation department plans to build a new high-speed train route between two cities. The transportation department wants to implement a simulation of the train before any construction begins on this project. Which of the following statements is true about the use of a simulation for this project? A) A simulation cannot be used to test the train under varying weather conditions. B) Implementing a simulation is likely to increase the overall costs associated with the project. C) Other high-speed train routes have been constructed in other locations, so a simulation is not needed. D) Using a simulation may expose potential safety issues that can be corrected before construction begins.

D

Which of the following best explains how algorithms that run on a computer can be used to solve problems? A) All problems can be solved with an algorithm that runs in a reasonable amount of time. B) All problems can be solved with an algorithm, but some algorithms might need a heuristic to run in a reasonable amount of time. C) All problems can be solved with an algorithm, but some algorithms might run in an unreasonable amount of time. D) Some problems cannot be solved by an algorithm.

D


Related study sets

Chapter 4: ABO and Hh Blood Group Systems

View Set

Chapter 15: Scalp Care Shampooing & Conditioning

View Set

Accounting for Merchandising Business

View Set

Chapter 38: Nursing Care of the Child With an Alteration in Intracranial Regulation/Neurologic Disorder

View Set

Canvas Getting Started Unit Final Quiz

View Set

Biology 1010 Final Exam Concept Coach

View Set

Abnormal Psychology Exam 4 Chapter 13 Neurodevelopmental and Neurocognitive Disorders

View Set

Nike Interview Question examples

View Set