WorksheetsAlgorithm Unit
Total questions: 19
Worksheet time: 20mins
Which of the following is true of algorithms?
Allgorithms may have an infinite set of instructions
Algorithms must be expressed using a programming language
Every algorithm can be constructed using combinations of sequencing, selection, and iteration
Every problem can be solved with an algorithm
The following algorithm is followed by a person every morning when they get up from bed to go to school
Wake up
Brush teeth
Put on shirt
Put on pants
Put on socks
Put on shoes
Tie shoes
Which concept does this algorithm BEST demonstrate?
Sequencing
Iteration
Selection
Execution
A town government is designing a new bus system and are deciding where to put the different bus stops. They want to pick the collection of locations that minimizes the distance anyone needs to walk in order to get to at least one bus stop. What term best defines the kind of problem?
A decision problem
An optimization problem
An undecidable problem
An efficiency problem
Line 01 becomes target <- list[2]
Line 04 becomes IF (num < target)
Line 04 becomes if (num % target)
Line 01 becomes list[0] <- target
These algorithms are equally efficient
Algorithm A is more efficient than algorithm B
Algorithm B is more efficient than algorithm A
The algorithms have different efficiencies depending on the input size
A school is creating class schedules for its students. The students submit their requested courses and then a program will be designed to find the optimal schedule for all students.
The school has determined that finding the absolute best schedule cannot be solved in a reasonable time. Instead they have decided to use a simpler algorithm that produces a good but non-optimal schedule in a more reasonable amount of time.
Which principle does this decision best demonstrate?
Unreasonable algorithms may sometimes also be undecidable
Heuristics can be used to solve some problems for which no reasonable algorithm exists
Two algorithms that solve the same problem must also have the same efficiency
Approximate solutions are often identical to optimal solutions
Which of the following algorithmic efficiencies would be considered LEAST efficient?
Linear
Constant
Polynomial
Exponential
logarithmic
Which of the following best describes the existence of undecidable problems?
Undecidable problems are problems for which more than one algorithm solves the problem and computer scientists have not yet chosen the algorithm they believe is best
Undecidable problems are problems for which an algorithm can be written that will produce the same output for at least two possible inputs
Undecidable problems are problems for which an algorithm can be written that produces a correct output for all inputs but in an unreasonable time
An undecidable problem is a problem for which no algorithm can be constructed that always produces a correct output
A group of students writes their names and unique student ID numbers on sheets of paper. The sheets are then randomly placed in a stack.
Their teacher is looking to see if a specific ID number is included in the stack. Which of the following best describes whether their teacher should use a linear or a binary search?
The teacher could use either type of search though the linear search is likely to be faster
Neither type of search will work since the data is numeric
The teacher could use either type of search though the binary search is likely to be faster
Only the linear search will work since the data has not been sorted
The teacher should use the binary search if the amount of data is greater than 27.
A computer is performing a binary search on the sorted list of 7 numbers below. What is the maximum number of iterations needed to find the item?
[1, 5, 20, 50, 51, 80, 99]
1
2
3
6
7
Which of the following is a benefit of parallel and distributed computing?
Distributed computing typically requires fewer computers
Parallel computing scales more effectively than sequential computing
Distributed computing improves the speed at which an individual computer executes a program
Distributed computing can be used when parallel solutions are not possible
A software company used to run an algorithm sequentially on one server. As more users start using their app, the company decided to rewrite the program to be parallel. It is now run on four separate servers instead of one Thanks to the use of a parallel algorithm, the same process that used to take 40 minutes to run now only requires 20 minutes.
The company is considering purchasing additional computers to decrease the time the program runs even further. Which of the following best describes the impacts of running the parallel algorithm on an even larger number of computers
A. The algorithm will likely require more time since it is now being run sequentially on more computers.
B. The algorithm will likely require the same amount of time to run because it is processing the same amount of data
C. The algorithm will likely require less time to run though the improvements in efficiency will not be as significant as before.
D. A software company used to run an algorithm sequentially on one server. As more users start using their app, the company decided to rewrite the program to be parallel. It is now run on four separate servers instead of one Thanks to the use of a parallel algorithm, the same process that used to take 40 minutes to run now only requires 20 minutes.
The company is considering purchasing additional computers to decrease the time the program runs even further. Which of the following best describes the impacts of running the parallel algorithm on an even larger number of computers
The algorithm will likely require more time since it is now being run sequentially on more computers.
The algorithm will likely require the same amount of time to run because it is processing the same amount of data
The algorithm will likely require less time to run though the improvements in efficiency will not be as significant as before.
The algorithm is unlikely to still run since parallel algorithms are not designed to scale to additional computers
A sequential algorithm is broken into three stages
Sequential Algorithm Time
Download stage: 1 minute
Sorting stage: 6 minutes
Upload stage: 1 minute
A parallel version of the algorithm completes the sorting stage in parallel leading to a new set of times
Parallel Algorithm Time
Download stage: 1 minute
Sorting stage: 2 minutes
Upload stage: 1 minute
What is the speedup of the parallel solution?
6 minutes
4 minutes
2
3
1
If you wanted to send a message with eight possible answers, what is the smallest number of bits you could use to do it?
1 bit
2 bits
3 bits
4 bits
8 bits
Which is the best definition for "protocol?"
A set of rules governing the exchange or transmission of data between devices.
Transmission capacity measured by bit rate.
A single unit of information in a computer, typically represented as 1 or 0.
Time it takes for a bit to travel from its sender to its receiver.
The number of bits that are conveyed or processed per unit of time, for example, bits/second.
