Unit 5: Algorithms and Simulations

Lab 1: Search Algorithms and Efficiency

5.1.3
AAP-2.P part b, AAP-2.P.2
In order to use a binary search, the data must be...
binary
sorted
unsorted
linear
5.1.3
Which of the following questions can be answered with a binary search, assuming the data are sorted? Check all that apply:
What is my friend Rasheed's phone number?
Give me a list of all the Beyoncé songs.
Tell me if bread is on my shopping list.
Who in my contact list lives on Grand Avenue?
5.1.5
The table below shows the computer time it takes to complete various tasks on the data of different sized towns.

Task Small Town
(population 1,000)
Mid-sized Town
(population 10,000)
Large Town
(population 100,000)
Entering Data 2 hours 20 hours 200 hours
Backing up Data 0.5 hours 5 hours 50 hours
Searching through Data 5 hours 15 hours 25 hours
Sorting Data 0.01 hour 1 hour 100 hours

Based on the information in the table, which of the following tasks is likely to take the longest amount of time when scaled up for a city of population 1,000,000.
Entering data
Backing up data
Searching through data
Sorting data
5.1.6
In which of the following problems is a heuristic solution appropriate?
Find the biggest item in a list.
Find the best combination of ingredients for spaghetti sauce.
Playing chess.
Find the combination to a lock with n numbers.
5.1.8
CSN-2.A part b, CSN-2.A.5
How long will this sequential program take to run?
wait (6), wait (4), wait (8)
18
8
4
6
5.1.8
CSN-2.A part b, CSN-2.A.6
How long will this parallel program take to run?
broadcast (go) and wait, wait (6) secs when I receive (go): wait (4) secs when I receive (go): wait (8) secs
18
8
6
14
5.1.8
What is the speedup for this parallel solution when compared to the sequential solution?
\frac{18}{14}
\frac{14}{18}
\frac{18}{6}
\frac{18}{8}

Lab 3: Turning Data into Information

5.3.2
Scientists studying birds often attach tracking tags to migrating birds. For each bird, the following data is collected regularly at frequent intervals: Which of the following questions about a particular bird could not be answered using only the data gathered from the tracking tags.
Approximately how much time does the bird spend in the air and on the ground?
Does the bird travel in groups with other tracked birds?
Is the migration path of the bird affected by temperature patterns?
What are the effects of industrial pollution on the migration path of the bird?
5.3.2
Using computers, researchers often search large data sets to find interesting patterns in the data. Which is of the following is not an example where searching for patterns is needed to gather desired information?
An online shopping company analyzing customers purchase history to recommend new products.
A high school analyzing student attendance records to determine which students should receive a disciplinary warning.
A credit scoring company analyzing purchase history of clients to identify cases of identity theft.
A college analyzing high school students’ GPA and SAT scores to assess their potential college success.
5.3.2
A car hailing company uses an app to track the travel trends of its customers. The data collected can be filtered and sorted by geographic location, time and date, miles traveled, and fare charged for the trip. Which of the following is least likely to be answerable using only the trends feature?
What time of the day is the busiest for the company at a given city.
From which geographical location do the longest rides originate.
How is competition with the local cab companies affecting business in a given district.
How much money was earned by the company in a given month.
5.3.2
An online music download company stores information about song purchases made by its customers. Every day, the following information is made publicly available on a company website database. An example portion of the database is shown below. The database is sorted by date and song title.
Day and Date Song Title City Number of Times Purchased
Mon 07/10/17 Despacito Boston, MA 117
Mon 07/10/17 Malibu Chicago, IL 53
Mon 07/10/17 Malibu New York, NY 197
Mon 07/10/17 Bad Liar Anchorage, AK 11
Tue 07/11/17 Despacito San Diego, CA 241
Which of the following cannot be determined using only the information in the database?
The song that is purchased the most in a given week.
The city with the fewest purchases on a particular day.
The total number of cities in which a certain song was purchased in a given month.
The total number of songs purchased by a particular customer during the course of a given year.
5.3.6
A new mobile phone company—unbeknownst to its customers—periodically records random snippets of their conversations and considers the recordings as data. In addition, it collects the following metadata on the conversations:

For which of the following goals would it be more useful to analyze the data instead of the metadata?

To determine if any of its users was present at the time and place of a crime.
To determine the time of day the app is used most frequently in a certain geographic location.
To determine the language most commonly used in user conversations.
To determine the most active users of the app for a given year.
5.3.6
Which of the following is not an example of metadata?
Data about a digital image describing the size of the image, image resolution, color depth, and when the image was created.
Data about a text document containing information about the length of the document, its author, the date the document was written, and a short summary of the content.
Data about a pack of wolves describing their habitat, hunting habits, diet, and sleep cycles.
Data about a web page containing a description of page content and a list of key words linked to the content.