Unit 1 AP CSP

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Byte pair encoding is a data encoding technique. The encoding algorithm looks for pairs of characters that appear in the string more than once and replaces each instance of that pair with a corresponding character that does not appear in the string. The algorithm saves a list containing the mapping of character pairs to their corresponding replacement characters. For example, the string "This_is_the_best_wish" can be encoded as "%#_#%E_BEST_W#H" by replacing all instances of "TH" with "%" and replacing all instances of "IS" with "#". For which of the following strings is it NOT possible to use byte pair encoding to shorten the string's length? a. "BANANA" b. "LEVEL_UP" c. "MEET_ME_LATER" d. "NEITHER_HERE_NOR_THERE"

"LEVEL_UP"

What is the binary RGB triplet for the color indigo? a. (00100101, 00000000, 10000010) b. (00100101, 00000000, 01000001) c. (01001011, 00000000, 10000010) d. (01001011, 00000000, 01000001)

(01001011, 00000000, 10000010)

Each student that enrolls at a school is assigned a unique ID number, which is stored as a binary number. The ID numbers increase sequentially by 1 with each newly enrolled student. If the ID number assigned to the last student who enrolled was the binary number 1001 0011, what binary number will be assigned to the next student who enrolls? a. 1001 0100 b. 1001 0111 c. 1101 0100 d. 1101 0111

1001 0100

An online store uses 6-bit binary sequences to identify each unique item for sale. The store plans to increase the number of items it sells and is considering using 7-bit binary sequences. Which of the following best describes the result of using 7-bit sequences instead of 6-bit sequences? a. 2 more items can be uniquely identified. b. 10 more items can be uniquely identified. c. 2 times as many items can be uniquely identified. d. 10 times as many items can be uniquely identified.

2 times as many items can be uniquely identified.

What is the decimal value for the jump control (11000)? a. 3 b. 12 c. 24 d. 48

24

A video-streaming Web site uses 32-bit integers to count the number of times each video has been played. In anticipation of some videos being played more times than can be represented with 32 bits, the Web site is planning to change to 64-bit integers for the counter. Which of the following best describes the result of using 64-bit integers instead of 32-bit integers? a. 2 times as many values can be represented. b. 32 times as many values can be represented. c. 2^32 times as many values can be represented. d. 3^22 times as many values can be represented.

2^32 times as many values can be represented.

Internet protocol version 4 (IPv4) represents each IP address as a 32-bit binary number. Internet protocol version 6 (IPv6) represents each IP address as a 128-bit binary number. Which of the following best describes the result of using 128-bit addresses instead of 32-bit addresses? a. 4 times as many addresses are available. b. 96 times as many addresses are available. times as many addresses are available. c. 2^4, times as many addresses are available. d. 2^96times as many addresses are available.

2^96times as many addresses are available.

A store uses binary numbers to assign a unique binary sequence to each item in its inventory. What is the minimum number of bits required for each binary sequence if the store has between 75 and 100 items in its inventory? a. 5 b. 6 c. 7 d. 8

7

An office uses an application to assign work to its staff members. The application uses a binary sequence to represent each of 100 staff members. What is the minimum number of bits needed to assign a unique bit sequence to each staff member? a. 5 b. 6 c. 7 d. 8

7

A text-editing application uses binary sequences to represent each of 200 different characters. What is the minimum number of bits needed to assign a unique bit sequence to each of the possible characters? a. 4 b. 6 c. 7 d. 8

8

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

9

A person wants to transmit an audio file from a device to a second device. Which of the following scenarios best demonstrates the use of lossless compression of the original file? a. A device compresses the audio file before transmitting it to a second device. The second device restores the compressed file to its original version before playing it. b. A device compresses the audio file by removing details that are not easily perceived by the human ear. The compressed file is transmitted to a second device, which plays it. c. A device transmits the original audio file to a second device. The second device removes metadata from the file before playing it. d. A device transmits the original audio file to a second device. The second device plays the transmitted file as is.

A device compresses the audio file before transmitting it to a second device. The second device restores the compressed file to its original version before playing it.

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.

A lossless compression algorithm can guarantee reconstruction of original data, while a lossy compression algorithm cannot.

Which of the following actions is most likely to raise legal or ethical concerns? a. An analyst writes a program that scans through a database of open-access scientific journals and creates a document with links to articles written on a particular topic. b. A computer scientist adds several features to an open-source software program that was designed by another individual. c. A musician creates a song using samples of a copyrighted work and then uses a Creative Commons license to publish the song. d. A public interest group alerts people to a scam that involves charging them for a program that is available for free under a Creative Commons license.

A musician creates a song using samples of a copyrighted work and then uses a Creative Commons license to publish the song.

Which of the following best explains how an analog audio signal is typically represented by a computer? a. An analog audio signal is measured as input parameters to a program or procedure. The inputs are represented at the lowest level as a collection of variables. b. An analog audio signal is measured at regular intervals. Each measurement is stored as a sample, which is represented at the lowest level as a sequence of bits. c. An analog audio signal is measured as a sequence of operations that describe how the sound can be reproduced. The operations are represented at the lowest level as programming instructions. d. An analog audio signal is measured as text that describes the attributes of the sound. The text is represented at the lowest level as a string.

An analog audio signal is measured at regular intervals. Each measurement is stored as a sample, which is represented at the lowest level as a sequence of bits

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.

An overflow error will occur because 4 bits is not large enough to represent 29, the sum of 14 and 15.

Byte pair encoding is a data encoding technique. The encoding algorithm looks for pairs of characters that appear in the string more than once and replaces each instance of that pair with a corresponding character that does not appear in the string. The algorithm saves a list containing the mapping of character pairs to their corresponding replacement characters. For example, the string can be encoded as by replacing all instances of with and replacing all instances of with . Which of the following statements about byte pair encoding is true? a. Byte pair encoding is an example of a lossy transformation because it discards some of the data in the original string. b. Byte pair encoding is an example of a lossy transformation because some pairs of characters are replaced by a single character. c. Byte pair encoding is an example of a lossless transformation because an encoded string can be restored to its original version. d. Byte pair encoding is an example of a lossless transformation because it can be used to transmit messages securely.

Byte pair encoding is an example of a lossless transformation because an encoded string can be restored to its original version.

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

Compressing the file using a lossless compression algorithm before uploading it

Digital images are often represented by the red, green, and blue values (an RGB triplet) of each individual pixel in the image. A photographer is manipulating a digital image and overwriting the original image. Which of the following describes a lossless transformation of the digital image? a. Compressing the image in a way that may lose information but will suffer only a small loss of image quality. b. Creating the gray scale of an image by averaging the amounts of red, green, and blue in each pixel and assigning this new value to the corresponding pixel in the new image. The new value of each pixel represents a shade of gray, ranging from white to black. c. Creating the negative of an image by creating a new RGB triplet for each pixel in which each value is calculated by subtracting the original value from 255. The negative of an image is reversed from the original; light areas appear dark, and colors are reversed. d. Modifying part of the image by taking the pixels in one part of the picture and copying them to the pixels in another part of the picture.

Creating the negative of an image by creating a new RGB triplet for each pixel in which each value is calculated by subtracting the original value from 255. The negative of an image is reversed from the original; light areas appear dark, and colors are reversed.

Which of the following best describes the impact of Creative Commons? a. Creative Commons gives creators of digital content the ability to indicate how their works can be legally used and distributed, enabling broad access to digital information. b. Creative Commons gives Internet users the right to legally use and distribute any previously copyrighted work, enabling broad access to digital information. c. Create Commons provides lossless transmission of messages, enabling reliable distribution of digital information. d. Creative Commons provides private transmission of messages, enabling secure distribution of digital information.

Creative Commons gives creators of digital content the ability to indicate how their works can be legally used and distributed, enabling broad access to digital information.

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

Decimal 5, binary 1011, decimal 12, binary 1101

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.

Four bits are enough to store the eight directions.

author to use a Creative Commons license instead of a traditional copyright? I. The author wants to make the e-book available as a free download. II. The author wants to prevent people from sharing copies of the e-book on peer-to-peer networks. III. The author wants to allow people permission to use and modify the e-book. a. I only b. II only c. I and III d. II and III

I and III

Some programming languages use constants, which are variables that are initialized at the beginning of a program and never changed. Which of the following are good uses for a constant? I. To represent the mathematical value π (pi) as 3.14 II. To represent the current score in a game III. To represent a known value such as the number of days in a week a. I and II only b. I and III only c. II and III only d. I, II, and III

I and III only

A computer program uses 4 bits to represent nonnegative integers. Which of the following statements describe a possible result when the program uses this number representation? I. The operation 4 +8 will result in an overflow error. II. The operation 7 + 10 will result in an overflow error. III. The operation 12 +3 will result in an overflow error. a. I only b. II only c. II and III only d. I, II, and III

I, II, and III

Which of the following are true statements about the data that can be represented using binary sequences? I. Binary sequences can be used to represent strings of characters. II. Binary sequences can be used to represent colors. III. Binary sequences can be used to represent audio recordings. a. I only b. I and II only c. II and III only d. I, II, and III

I, II, and III

Which of the following can be represented by a sequence of bits? I. An integer II. An alphanumeric character III. A machine language instruction a. I only b. III only c. I and II only d. I, II, and III

I, II, and III

The author of an e-book publishes the e-book using a no-rights-reserved Creative Commons license. Which of the following best explains the consequences of publishing the book with this type of license? a. The contents of the e-book will be encrypted and can only be decrypted by authorized individuals. b. Individuals can freely distribute or use the contents of the e-book without needing to obtain additional permissions from the author. c. Individuals will be legally prevented from sharing the e-book on a peer-to-peer network. d. Individuals will be legally prevented from using excerpts from the e-book in another published work.

Individuals can freely distribute or use the contents of the e-book without needing to obtain additional permissions from the author.

According to information in the table, what color is represented by the binary RGB triplet (11111111, 11111111, 11110000) ? a. Ivory b. Light yellow c. Neutral gray d. Vivid yellow

Ivory

What ASCII character is represented by the binary (base 2) number 1001010 ? a. H b. I c. J d. K

J

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.

Lossy compression of an image file generally provides a greater reduction in transmission time than lossless compression does.

Which of the following is considered an unethical use of computer resources? a. Downloading freeware or shareware onto your home computer b. Purchasing a game from an app store and downloading it directly to a mobile device c. Purchasing a single-user copy of photo editing software and installing it on all the computers in a computer lab d. Searching online for an electronic version of a school textbook

Purchasing a single-user copy of photo editing software and installing it on all the computers in a computer lab

In which of the following situations would it be most appropriate to choose lossy compression over lossless compression? a. Storing digital photographs to be printed and displayed in a large format in an art gallery b. Storing a formatted text document to be restored to its original version for a print publication c. Storing music files on a smartphone in order to maximize the number of songs that can be stored d. Storing a video file on an external device in order to preserve the highest possible video quality

Storing music files on a smartphone in order to maximize the number of songs that can be stored

A program developed for a Web store represents customer account balances using a format that approximates real numbers. While testing the program, a software developer discovers that some values appear to be mathematically imprecise. Which of the following is the most likely cause of the imprecision? a. The account balances are represented using a fixed number of bits, resulting in overflow errors. b. The account balances are represented using a fixed number of bits, resulting in round-off errors. c. The account balances are represented using an unlimited number of bits, resulting in overflow errors. d. The account balances are represented using an unlimited number of bits, resulting in round-off errors.

The account balances are represented using a fixed number of bits, resulting in round-off errors.

An online gaming company is introducing several new initiatives to encourage respectful communication between players of online games. Which of the following best describes a solution that uses crowdsourcing? a. The company allows individual players to endorse fellow players based on courteous interactions. Once a player receives enough endorsements, the player is given free rewards that can be used during gameplay. b. The company eliminates chat from gameplay and sets the default chat policy to off. Players must actively turn on chat to converse outside of gameplay. c. The company introduces software that monitors all chats. Inappropriate conversations are identified, and players involved in the conversations are banned from the game. d. The company updates the acceptable content guidelines to explicitly describe appropriate and inappropriate behavior. All players must electronically sign an agreement to adhere to the guidelines.

The company allows individual players to endorse fellow players based on courteous interactions. Once a player receives enough endorsements, the player is given free rewards that can be used during gameplay.

A video-streaming Web site keeps count of the number of times each video has been played since it was first added to the site. The count is updated each time a video is played and is displayed next to each video to show its popularity. At one time, the count for the most popular video was about two million. Sometime later, the same video displayed a seven-digit negative number as its count, while the counts for the other videos displayed correctly. Which of the following is the most likely explanation for the error? a. The count for the video became larger than the maximum value allowed by the data type used to store the count. b. The mathematical operations used to calculate the count caused a rounding error to occur. c. The software used to update the count failed when too many videos were played simultaneously by too many users. d. The software used to update the count contained a sampling error when using digital data to approximate the analog count.

The count for the video became larger than the maximum value allowed by the data type used to store the count.

Which of the following is NOT an advantage of using open-source software? a. Open-source software is generally free or lower in cost than commercially available software. b. The availability of source code makes it possible to customize open-source software to a user's individual needs. c. The original developer of open-source software provides free or low-cost support for users installing and running the software. d. Unlike commercial software, which can become obsolete when the company that created it goes out of business, open-source software can be updated without the involvement of the original programmers.

The original developer of open-source software provides free or low-cost support for users installing and running the software.

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.

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.

A computer program performs the operation and represents the result as the value . Which of the following best explains this result? a. An overflow error occurred. b. The precision of the result is limited due to the constraints of using a floating-point representation. c. The program attempted to execute the operation with the arguments in reverse order. d. The program attempted to represent a floating-point number as an integer.

The precision of the result is limited due to the constraints of using a floating-point representation.

In a certain computer program, two positive integers are added together, resulting in an overflow error. Which of the following best explains why the error occurs? a. The program attempted to perform an operation that is considered an undecidable problem. b. The precision of the result is limited due to the constraints of using a floating-point representation. c. The program can only use a fixed number of bits to represent integers; the computed sum is greater than the maximum representable value. d. The program cannot represent integers; the integers are converted into decimal approximations, leading to rounding errors.

The program can only use a fixed number of bits to represent integers; the computed sum is greater than the maximum representable value.

A programmer created a piece of software and wants to publish it using a Creative Commons license. Which of the following is a direct benefit of publishing the software with this type of license? a. The programmer can ensure that the algorithms used in the software are free from bias. b. The programmer can ensure that the source code for the software is backed up for archival purposes. c. The programmer can include code that was written by other people in the software without needing to obtain permission. d. The programmer can specify the ways that other people are legally allowed to use and distribute the software.

The programmer can specify the ways that other people are legally allowed to use and distribute the software.

Directions: For the question or incomplete statement below, two of the suggested answers are correct. For this question, you must select both correct choices to earn credit. No partial credit will be earned if only one correct choice is selected. Select the two that are best in each case. Which of the following can be represented by a single binary digit? Select two answers. a. The position of the minute hand of a clock b. The remainder when dividing a whole number by 2 c. The value of a Boolean variable d. The volume of a car radio

The remainder when dividing a whole number by 2 The value of a Boolean variable

A researcher wants to publish the results of a study in an open access journal. Which of the following is a direct benefit of publishing the results in this type of publication? a. The researcher can allow the results to be easily obtained by other researchers and members of the general public. b. The researcher can better anticipate the effect of the results and ensure that they are used responsibly. c. The researcher can ensure that any personal information contained in the journal is kept private and secure. d. The researcher can prevent copies of the research from being accessed by academic rivals.

The researcher can allow the results to be easily obtained by other researchers and members of the general public.

A student is recording a song on her computer. When the recording is finished, she saves a copy on her computer. The student notices that the saved copy is of lower sound quality than the original recording. Which of the following could be a possible explanation for the difference in sound quality? a. The song was saved using fewer bits per second than the original song. b. The song was saved using more bits per second than the original song. c. The song was saved using a lossless compression technique. d. Some information is lost every time a file is saved from one location on a computer to another location.

The song was saved using fewer bits per second than the original song.

A binary number is to be transformed by appending three 0s to the end of the number. For example, 11101 is transformed to 11101000. Which of the following correctly describes the relationship between the transformed number and the original number? a. The transformed number is 3 times the value of the original number. b. The transformed number is 4 times the value of the original number. c. The transformed number is 8 times the value of the original number. d. The transformed number is 1,000 times the value of the original number.

The transformed number is 8 times the value of the original number.

A user reads reviews of a popular artist's new album and then downloads the album from the Web site of a licensed online music seller. Which of the following is LEAST likely to be a consequence of this action? a. Advertisements for the artist's other albums will be displayed when the user visits a different Web site. b. Album reviews from other people who live nearby will be displayed to the user. c. Similar artists will be recommended to the user based on the user's download selection. d. The user will be in violation of the Digital Millennium Copyright Act (DMCA).

The user will be in violation of the Digital Millennium Copyright Act (DMCA).

Which of the following is a true statement about data compression? a. Data compression is only useful for files being transmitted over the Internet. b. Regardless of the compression technique used, once a data file is compressed, it cannot be restored to its original state. c. Sending a compressed version of a file ensures that the contents of the file cannot be intercepted by an unauthorized user. d. There are trade-offs involved in choosing a compression technique for storing and transmitting data.

There are trade-offs involved in choosing a compression technique for storing and transmitting data.

A media librarian at a movie studio is planning to save digital video files for archival purposes. The movie studio would like to be able to access full-quality videos if they are needed for future projects. Which of the following actions is LEAST likely to support the studio's goal? a. Using video file formats that conform to published standards and are supported across many different devices b. Using lossy compression software to reduce the size requirements of the data being stored c. Using storage media that can be expanded for additional data capacity d. Using a system that incorporates redundancy to handle disk failure

Using lossy compression software to reduce the size requirements of the data being stored

A musician is creating a song using audio samples. Which of the following actions will minimize the risk of a copyright violation when creating sample-based music? a. Using samples found on popular music-streaming sites b. Using samples found on peer-to-peer networks c. Using samples from nondigital sound sources (vinyl records, tapes, etc.) d. Using samples published with a no-rights-reserved Creative Commons license

Using samples published with a no-rights-reserved Creative Commons license

ASCII characters can also be represented by hexadecimal numbers. According to ASCII character encoding, which of the following letters is represented by the hexadecimal (base 16) number 56? a. A b. L c. V d. Y

V

A student purchases a single-user license of a copyrighted application and wants other students to be able to use it at the same time. Under which of the following conditions is it considered acceptable for the student to share the application? a. When the application is shared only with students at the same school b. When the application is shared on a peer-to-peer network c. When the student gets permission from the copyright owner of the application d. When the student makes a copy of the application for another student to use only once

When the student gets permission from the copyright owner of the application

What control is represented by the decimal value 15 ? a. ← 01000 b. ↑ 01001 c. → 01011 d. ↓ 01111

↓ 01111


Ensembles d'études connexes

abdominal assessment prep u-questions

View Set

Psych. Adult Development and Aging Quizes 1-6

View Set

Cs1428 revel quizzes/checkpoints

View Set

SER216: Testing Lifecycle, Unit Testing, Network Programming

View Set

Chapter 5: Cost-volume-profit relations

View Set