0% found this document useful (0 votes)
41 views

Lect 23

The document discusses preparation for the AP Computer Science exam, including the topics covered which are creative development, data, algorithms and programming, computer systems and networks, and impact of computing; it provides an overview of Big Idea 1 around creative development, including the design process, program documentation, types of errors, and collaboration.

Uploaded by

b
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Lect 23

The document discusses preparation for the AP Computer Science exam, including the topics covered which are creative development, data, algorithms and programming, computer systems and networks, and impact of computing; it provides an overview of Big Idea 1 around creative development, including the design process, program documentation, types of errors, and collaboration.

Uploaded by

b
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 126

AP Exam Preparation

1
AP Exam

2
Topics
The AP Multiple Choice end-of-year covers 5 Big Ideas:

1) Creative Development(10%-13%)
2) Data(17%-22%)
3) Algorithms and Programming(30%-35%)
4) Computer Systems and Networks(11%-15%)
5) Impact of Computing(21%-26%)

3
Big Idea 1

4
Big Idea 1
Please read Chapter 2: Big Idea 1: Creative Development. of the AP Barron's
book. The following slides provide a summary of the material covered in this
chapter.

A computing innovation includes a program as an integral part of its


function.
A computing innovation can be physical (e.g., self-driving car), nonphysical
computing software (e.g., picture editing software),or a nonphysical computing
concept (e.g., e-commerce).

Hardware is the physical components of a computing device, while software is


the instructions in a programming language to the computing device. A
computing innovation can have hardware components. However, the
computing innovation is about the software, not the hardware. 5
Big Idea 1
Computing hardware has gotten smaller and more powerful over the years.
Moore’s law predicts that the size of transistors halves every two years while
the cost also halves every two years. Computers went from taking up 1,800
square feet and weighing almost 50 tons to being able to fit in your pocket.

6
Big Idea 1
Collaboration helps people learn from each other. Collaboration that
includes diverse perspectives helps to avoid bias in the development of
computing innovations.

For example, if females play video games at the same percentage as males, a
game company might not avoid bias if it employed males to write the code for
the games. Bringing in female coders could bring additional perspectives that
might not have been achieved otherwise.

Programming companies often hire people who not only are good
programmers but also have interpersonal skills needed to collaborate
effectively. Effective collaboration can help one gain insight and knowledge by
applying multiple perspectives, experiences, and skill sets.
7
Big Idea 1
Collaboration is a learned skill. That skill includes but is not limited to:
■Communication
■Consensus building
■Conflict resolution
■Negotiation

Collaboration with others can make the programmer more self-aware.

Group programming can match up your weaknesses with someone else’s


strengths, which results in a better product and leads to insight and knowledge
not obtainable when working alone.

8
Big Idea 1

Collaboration is not limited by location. Current computing tools allow people


in different physical locations to share data.

Online collaboration tools, such as Google Docs, Zoom, Slack, Yammer, and—
by the time you read this—dozens of other tools, allow programmers to
collaborate from home or from anywhere that has internet access.

A program is a collection of program statements that performs a specific


task when run by a computer. A program is often referred to as software.

A code segment refers to a collection of program statements that are part


of a program.
9
Big Idea 1

Program input is data sent to a computer for processing by a program.


Input can come in a variety of forms, such as tactile, audio, visual, or text. For
example, a cell phone can convert voice (audio) to text to send a message.

A weather program on your phone could take input in many forms.This


weather app was triggered by the user saying (audio) “Hey Phone…,” which
would be an example of audio input.

This triggering is called an event. The event is the action that supplies input
data to a program. Events can be generated when a key is pressed, a mouse is
clicked, a program is started, or by any other defined action that affects the
flow of execution.
10
Big Idea 1

Program outputs are any data sent from a program to a device. Program
output can come in a variety of forms, such as tactile, audio, visual, or text.
Program output is usually based on a program’s input or prior state (e.g.,
internal values). 11
Big Idea 1
A development process can be ordered and intentional, or exploratory in
nature.

A development process that is incremental is one that


breaks the problem into smaller pieces and makes sure
each piece works before adding it to the whole.

A development process that is iterative requires refinement


and revision based on feedback, testing, or reflection
throughout the process. This may require revisiting earlier
phases of the process.

12
Big Idea 1
The design of a program incorporates investigations to determine its
requirements. Most programs are designed to be used by people other than
the programmers.
To meet the needs of the users, the investigation must identify the program
constraints as well as the concerns and interests of people who will use the
program.

Some ways investigations can be performed are as follows:


■Collecting data through surveys
■User testing
■Interviews
■Direct observations
13
Big Idea 1
The design phase of a program may include:
■Brainstorming
■Planning and storyboarding
■Organizing the program into modules and functional components
■Creating diagrams that represent the layouts of the user interface
■Developing a testing strategy for the program

Program documentation is a written description of the function of a code


segment, event, procedure, or program and how it was developed.

Program documentation helps in developing and maintaining correct programs


when working individually or in collaborative programming environments.
14
Big Idea 1

Programmers should document a program throughout its development.

Documentation helps the programmer remember what he or she was thinking


or the collaborative partners were thinking at the time they were
programming.

Comments are a form of program documentation written into the program


that do not affect how the program runs. Comments do not affect the run
speed of a program. Python, for example, uses # for comments.

15
Big Idea 1
Three types of program errors can occur:

■Logic error—This is a mistake in the algorithm or program that causes it


to behave incorrectly or unexpectedly. (incorrect implementation of
algorithm)

■Syntax error—This is a mistake in the program where the rules of the


programming language are not followed. (missing parenthesis, incorrect
indentation, misspelling name of function calls)

■Runtime error—This is a mistake in the program that occurs during the


execution of a program. Programming languages define their own runtime
errors.(divide by 0, accessing out-of-bounds index of a list)
16
Big Idea 1
Read the code below. Assume that myList is a nonempty list of numbers.
Identify the error. What kind of error is it?

Logic Error. The code adds the first number twice in the sum.
17
Big Idea 2: Data

18
Big Idea 2: Data
A bit is shorthand for a single binary digit and is either 0 or 1. A byte is 8 bits. For example, the binary
sequence 0110 1111 contains 8 bits or 1 byte.

Binary sequences can be used to represent all digital data. Binary sequences can represent colors,
Boolean logic, lists, and so on. Anything that can be stored on a computer can be represented by binary
sequences.

Some data take many bits to represent it. For example, a single 10 MP (1 MP is one million pixels)
picture uses 10,000,000 pixels.

Each pixel (16-bit mode RGB) contains 16 * 3 = 48 bits = 6 bytes. That means there are 48 bits *
10,000,000 = 480,000,000 bits in a single 10 MP (16-bit mode) picture.

Logic Error. The code adds the first number twice in the sum. 19
Digital vs. Analog
Many physical phenomena can be modeled by analog signal(sound, colors,
temperature). Analog signals are continuous signals.
Computers can only understand digital signals (discrete or finite signal(0s
and 1s).)
• analog signals are continuous and can take on an infinite possible values(the real
numbers)
• digital signals are finite.
• For example, 8 bit colors can take on one of 256 discrete, finite possibilities. But actual
colors can take on any of an infinite possible values or shades.
Sampling allow computers to
approximate analog signals such
as sound.
The number of samples is the
sampling rate, the higher the rate
the better the quality.
Big Idea 2: Data
In many programming languages, integers are represented by a fixed number of
bits, which limit the range of integer values and mathematical operations on
those values.

For example in JAVA, the range of the value of an integer is from


−2,147,483,648 to +2,147,483,647. Trying to store a number bigger than the
limits will result in an overflow error.

Some languages like Python, integers do not have limits on number size but,
instead, expand to the limit of the available memory.

21
Big Idea 2: Data

Example 1:
With 4 bits, the largest integer that can be stored is 2^4-1 = 15.

Example 2:
A 4-bit integer can any value in {0,1,2,..,15}. Thus storing the value of 10 + 6 =
16 would cause an overflow error since the 16 = 10000 requires at least 5 bits.

Example 3:
If x is a 3-bit integer, then x = 111 + 111 will cause an overflow error since the
sum is 1110 which requires at least 4 bits.
22
Big Idea 2: Data

1/3 does not always equal 1/3. A roundoff error occurs when decimals
(real numbers) are rounded.

One computer might calculate 1/3 as 0.333333. Another computer might


calculate 1/3 as 0.3333333333. In this case, 1/3 on one computer is not
equal to 1/3 on a second computer.

23
Big Idea 2: Data
Number bases, including binary, decimal, and hexadecimal, are used to
represent and investigate digital data.

On your AP exam, you will be expected to convert binary to decimal and


decimal to binary only.

24
Big Idea 2: Data

There is one 16 in 30.

What is left is 30 – 16 = 14. There is one 8 in 14 so:

25
14 – 8 = 6
There is one 4 in 6 so:

6 – 4 = 2. And there is a 2 in 2 so:

2 – 2 = 0. Thus

26
Big Idea 2: Data
INFORMATION EXTRACTED FROM DATA
People generate significant amounts of digital data daily. Some always-on
devices are collecting geographic location data constantly, while social media
sites are collecting premium data based on your usage.

People can use computer programs to process information as well as to gain


insight and knowledge. Information is the collection of facts and patterns
extracted from data.

Gaining insight from this valuable data involves a combination of statistics,


mathematics, programming, and problem solving.

27
Big Idea 2: Data
Large data sets may be analyzed computationally to reveal patterns, trends, and
associations.

These trends are powerful predictors of future behaviors. Investors are


constantly reviewing trends in past pricing to influence their future investment
decisions.

However, sometimes trends can be misinterpreted and result in business


disasters. Digitally processed data may show correlation between variables.

A correlation found in data does not necessarily indicate that a causal


relationship exists. Additional research is needed to understand the exact
nature of the relationship.
28
Big Idea 2: Data
Depending on how the data were collected, the information may not be
uniform. For example, if users entered data into an open field, the way they
chose to abbreviate, spell, or capitalize something may vary from user to user.
Data sets pose challenges regardless of size, such as:
■The need to clean data
■Incomplete data
■Invalid data
■The need to combine data sources

Cleaning data is a process that makes the data uniform without changing their
meaning.
One example is replacing all equivalent abbreviations with the same word. This
can also be done with various spellings and with different capitalizations.
29
Big Idea 2: Data
Data can get too large for traditional data-processing applications. The ability
to process data depends on the capabilities of the users and their tools. Social
media activity generates an enormous amount of data.

Some data sets are difficult to process using a single computer and may
require parallel systems.

Problems of bias are often created by the types and sources of data being
collected. Bias is not eliminated by simply collecting more data. A large amount
of data is generated by humans. Algorithms that use this data will reflect this
bias.

Despite the advantages of big data, a large sample size can magnify the bias
associated with the data being used. Data can have little value if the sample is
not representative of the population to which the results will be generalized.
30
Big Idea 2: Data
Predicting algorithms use information collected from big data to influence our
daily lives. For example:
■A credit card company can use purchasing patterns to identify when to
extend credit or flag a purchase for possible fraud.
■Social media sites can use patterns to target advertising based on viewing
habits.
■An online store analyzing customers’ past purchases can suggest new
products the customer may be interested in buying.
■An entertainment application may recommend an additional movie to watch
based on the viewer’s interests.

31
Big Idea 2: Data
Using appropriate visualizations when presenting digitally processed data can
help one gain insight and knowledge. Although big data is a powerful tool, the
data will lose their value if they cannot be presented in a way that can be
interpreted.

Visualization tools can communicate information about data. Column charts,


line graphs, pie charts, bar charts, XY charts, radar charts, histograms, and
waterfall charts can make complex data easier to interpret.

Python's pandas library can be used to explore, process and visualize data. See
the optional lecture slides "pandas for Tabular data". Python's pandas library is a
powerful alternative to Excel.

32
Big Idea 2: Data
Privacy concerns arise through the mass collection of data. The content of the
data may contain personal information and can affect the choice in storage and
transmitting.

Anything done online is likely to lead to sharing of private data. Using Gmail to
order a pair of shoes from Clarks could result in ads for shoes showing up in
your search engine.

33
Big Idea 2: Data
Metadata are data that describe your data—for example, a picture of you
standing in front of a waterfall is data. The location and time the picture was
taken are metadata.

Metadata are used for finding, organizing, and managing information. Metadata
can increase the effective use of data or data sets by providing additional
information about various aspects of that data.

Changes and deletions made to metadata do not change the primary data.

34
Big Idea 3: Programming and Algorithms

The AP exam will use a language-agnostic syntax for programming and


algorithm questions.

Please see the following reference sheet(also available during the actual exam)
for more details about the syntax.

https://apcentral.collegeboard.org/pdf/ap-computer-science-principles-exam-
reference-sheet.pdf

35
Big Idea 3: Programming and Algorithms
In computer science, an abstraction is a way to represent essential features
without including the background details or explanations. Abstractions reduce
complexity and allow for efficient design and implementation of complex
software systems.

Abstractions become a necessity as systems become more complex. For


example, anytime you check your stories on Instagram, you are using a bunch
of processes in the background that you have no control over.

Without these abstractions, it would be difficult to send a message to a friend.


With the use of abstractions, you can focus on content, not the technical
details of how the application works.

36
Big Idea 3: Programming and Algorithms
Programmers also use abstractions. The purpose of abstraction is to hide
coding details so the programmer can focus on the current problem.

Computers can understand only binary machine code. Machine code is a


strictly numerical language that runs fast but is hard to use.

The code on the right is written in machine


code to outputs "Hello World" to the
screen.

In Python it can be done using the print()


abstraction:
print("Hello World") 37
Big Idea 3: Programming and Algorithms
Abstractions allow for programmers to use semihuman language to
program(Python, Java, etc…).

Rarely will programmers deal directly in machine code. Machine code is a base
language where no abstractions are implemented. Programmers have worked
to hide details by using abstractions.

Different program languages offer different levels of abstractions. High-level


programming languages provide more abstractions than do lower-level
languages.

Coding in a programming language is often translated into code in another


low-level language that the computer can execute.
38
Big Idea 3: Programming and Algorithms
Abstraction Examples Used on the AP Exam:
One common type of abstraction is procedural abstraction, which provides a name
for a process and allows a procedure to be used only knowing what it does, not how it
does it.

DISPLAY(expression) is an abstraction that is used on your AP exam to display a value


of expression followed by a space. The input parameter for the DISPLAY abstraction is
expression.

Another abstraction used on your AP exam is RANDOM(a, b), which evaluates to a


random number from a to b inclusive. The input parameters in this abstraction are a
and b.

An abstraction generalizes functionality with input parameters that allow software


reuse. Being aware of and using multiple levels of abstractions in developing programs
helps to apply available resources and tools more effectively to solve problems.
39
Important Procedures(Functions)

40
Important Procedures(Functions)

41
Assignment uses Arrows not =
Example:

DISPLAY(a = b) false
42
DISPLAY(a <= b) true
43
Big Idea 3: Programming and Algorithms

44
Big Idea 3: Programming and Algorithms

45
Big Idea 3: Programming and Algorithms

46
Big Idea 3: Programming and Algorithms

47
Big Idea 3: Programming and Algorithms

48
49
Lists

Python’s list index starts at 0.


Here, list starts at index 1.

50
Lists

51
The INSERT(list, i, item) will insert the item at index i and shift right items
at index i or higher.

52
The APPEND(list, item) will add the item to the end of the list.

53
The REMOVE(list, i) will remove the item at index i and shift left items
at index i or higher.

Line 4: REMOVE(words, 3)
Line 5: DISPLAY(words)

Answer: ["Green", "The", "Pig", "Rhino", "Fox"]

54
Conditionals

55
Loop 1: Repeat n Times
The code in block of statements is executed n times.

56
Loop 2: Repeat Until Condition
The code in block of statements is repeated until the Boolean expression
condition evaluates to true.

This is different than Python’s while loop.


Python’s while loop runs as long as the
condition is true and terminates when
the condition is false.

REPEAT UNTIL (condition) loop runs as


long as the condition is false and terminates
when the condition is true.

57
Loop 3: Looping Through a List
The variable item is assigned the value of each element of aList sequentially,
in order, from the first element to the last element. The code in block of
statements is executed once for each assignment of item.

58
Example: Looping Through a List

59
Example: Looping Through a List

What is the output?


Answer: Empty list, a number cannot be both even and odd. No number is 60
appended to list2.
Loop 4: Looping Through a List(version 2)
Another way to loop through a list is to loop LENGTH(list) TIMES.
What does the following code do?

sum 0
n LENGTH(list)
index 1
REPEAT n TIMES
{
sum sum + list[index]
index index + 1
} 61

DISPLAY(sum)

Print out the sum of a list of numbers.


62
What does the code do?

Answer: Double each value in the list.

63
What does the code do?
Answer: Add negative numbers from alist to the end of bList.

64
What is the output?

scores [90, 89, 98, 100, 90]


total finalTotal(scores)

DISPLAY(total) Function call Note: In Python, we put function definitions


on top of the file. Any code that calls
functions is below the function definitions.
PROCEDURE findTotal(scores)
{ On the AP exam, function definitions can
sum 0 before function calls as shown here.
FOR EACH item IN scores
{
sum sum + item
}
RETURN sum
} 65
Algorithms to Know
The AP MCQ will ask questions about standard algorithms every programmer
should know:

1) Find total sum of a list of numbers


2) Find average of a list of numbers
3) Find maximum/minimum of a list of numbers
4) Find word from a list of words

Please know these algorithms and know how to quickly recognize them! If the
code for any of the algorithm above is given with the name "mystery_algorithm",
you should be able to quickly recognize what it does.

We'll go over each of them.


66
Find sum of a list
PROCEDURE findTotal(scores)
{
sum 0
FOR EACH item IN scores
{
sum sum + item
}
RETURN sum
} 67
Find average of a list(implementation #1)
Implementation #1: Use for Each Loop.

68
Find average of a list(implementation #2)
Implementation #2: Use REPEAT n times loop.

PROCEDURE findAverage(list)
{
sum 0
n LENGTH(list)
index 1
REPEAT n TIMES
{
sum sum + list[index]
69

index index + 1
}
RETURN sum / n
}
Find maximum of a list(implementation #1)
Implementation #1: Use for Each Loop.

70
Find maximum of a list(implementation #2)
Implementation #2: Use REPEAT n times loop.

count 1

count count + 1
Common Error Example 1
The AP exam will try to give you code that is the wrong implementation of an
algorithm. Can you find the error?

72
Common Error Example 2
The AP exam will try to give you code that is the wrong implementation of an
algorithm. Can you find the error?
PROCEDURE findMinimum(list)
{
min list[1]
FOR EACH item IN list
{
IF(item < min)
min item
ELSE
min 0
}
RETURN min
}

73
Correct findMinimum
Here's the correct implementation of findMinimum.

PROCEDURE findMinimum(list)
{
min list[1]
FOR EACH item IN list
{
IF(item < min)
min item
}

RETURN min
}
Find word from list of words
PROCEDURE findWord(list, word)
{
index 1
FOR EACH item IN list This code also works if we remove
{ the Else block:
IF(item = word)
{ IF(item = word)
RETURN index
{
}
ELSE RETURN index
{ }
index index + 1 index ß index + 1
}
}

RETURN “Word not in list”


} 75
76
77
Big Idea 3: Programming and Algorithms

78
Big Idea 3: Programming and Algorithms

79
80
81
What is the result of executing the above code?

Answer: Robot moves forward 4 steps.

82
Does the code work as intended?
Yes, as an exercise, trace the code to convince yourself that the robot will
reach destination. 83
Does the code work as intended?
No! Robot get stuck in an infinite loop at the top right corner.
84
85
86
87
88
89
90
91
92
93
Program Design

94
95
Trace the code and determine the output of the following program.

Answer:

96
Trace the code and determine the output of the following program.

Answer: Display 3.

97
Algorithmic Efficiency
Some problems cannot be solved in a reasonable amount of time because
there is no efficient algorithm for solving them. In these cases, approximate
solutions are sought.

Algorithms with a polynomial efficiency(constant, linear, square, cube, etc.)


are said to run in a reasonable amount of time. They can be executed
quickly on a modern processor.

However, there exists important and practical problems for which there exists
no known polynomial time algorithm. Algorithms with exponential or factorial
efficiencies are examples of algorithms that run in an unreasonable amount
of time.

98
Algorithmic Efficiency

A heuristic is an approach to a problem that produces a solution that is not


guaranteed to be optimal but may be used when techniques that are
guaranteed to always find an optimal solution are impractical.

For example, a file-organizing algorithm determines the content of a file based


on a certain number of bytes in the beginning of the file. This is an approximate
solution since only a few bytes are examined. But it is more practical and faster
to run than examining every byte of every file.

99
Programmers break down problems into smaller and more manageable pieces. By
creating procedures and leveraging parameters, programmers generalize
processes that can be reused.

Procedures allow programmers to draw upon existing code that has already been
tested, allowing them to write programs more quickly and with more confidence.

A software library contains procedures that may be used in creating new


programs. (e.g. Python's random, numpy libraries)

The use of libraries simplifies the task of creating complex programs


(abstraction).

100
Application program interfaces (APIs) are specifications for how the procedures
in a library behave and can be used.

For example, Twitter's API allow programmers to access and analyze tweets.

Documentation for an API/library is necessary in understanding the behaviors provided


by the API/library and how to use them. Twitter has documentation that allows
programmers to learn how to use their API.

A computing device is a physical artifact that can run a program. Some examples
include computers, tablets, servers, routers, and smart sensors. The device must be able
to take inputs, process the inputs, and then calculate results based on those inputs.

Reichelson, Seth. AP Computer Science Principles Premium with 6 Practice Tests


(Barron's Test Prep) (p. 321). Barrons Educational Series. Kindle Edition.
101
Big Idea 4: Computer Systems and Network

102
Big Idea 4: Computer Systems and Networks
A computing device is a physical artifact that can run a program. Some
examples include computers, tablets, servers, routers, and smart sensors. The
device must be able to take inputs, process the inputs, and then calculate results
based on those inputs.

A computing system is a group of computing devices and programs working


together for a common purpose. A type of computing system is a computer
network. A computer network is a group of interconnected computing devices
capable of sending or receiving data.

The bandwidth of a computer network is the maximum amount of data that


can be sent in a fixed amount of time.

103
Big Idea 4: Computer Systems and Networks
A path between two computing devices on a computer network (a sender and
receiver) is a sequence of directly connected computing devices that begins at
the sender and ends at the receiver. Routing is the process of finding a path
from sender to receiver.

If the path from sender to receiver is broken, the path will be rerouted. This
fault-tolerant nature of the internet makes connections between computing
devices more reliable.

The internet connects devices and networks from all over the world. The
internet is a physical network of fiber optics, radio transmitters, and cabling.
Devices and networks that make up the internet are connected and
communicate using standardized, open communication protocols.

104
Big Idea 4: Computer Systems and Networks
A protocol is an agreed-upon set of rules that specify the behavior of a
system.

These internet protocols, including those for addresses and names, have
evolved to allow for the internet to be scalable.

The scalability of a system is the capacity for the system to change in size and
scale to meet new demands.

Internet protocol (IP) is responsible for addressing and routing your online
requests. For a device to connect to the internet, it is first assigned an internet
protocol address.

105
Big Idea 4: Computer Systems and Networks
Currently, we are switching between the fourth and sixth versions of the
internet protocol.

The fourth version (IPv4) uses 32 bits to store IP addresses. These 32 bits can
hold 2^32 IP addresses. When multiplied out, 2^32 is actually 4,294,967,296
unique addresses.

The newer version, IPv6, uses 128 bits, which can hold 2^128 IP addresses.

Transmission control protocol (TCP) is a protocol that defines how


computers send packets of data to each other. Data traveling in the internet is
broken down into small chunks of data called packets. TCP protocols guide
the rules on how data are subdivided into packets before transmission.
106
Big Idea 4: Computer Systems and Networks
User datagram protocol (UDP) is a protocol that allows computer
applications to send messages without checking for missing packets to save on
time needed to retransmit missing packets. UDP is not as reliable as TCP, which
does resend packets lost when transmitting.

The internet has been engineered to be fault tolerant. If a system fails, a


different path can be chosen between the sending computer and the receiving
computer.

Redundancy is the inclusion of extra paths that can mitigate the failure of a
system if other components fail. This is important because elements can fail at
any time, and fault tolerance allows users to continue to use the network.

107
Big Idea 4: Computer Systems and Networks
The internet refers to the hardware. It is made up of the computers, cables,
routers, and many more components that make up the entire network. It is a
global decentralized network connecting millions of computers.

The World Wide Web, in contrast, refers to the software used on the
internet. HTTP is a protocol used by the World Wide Web to transmit data.

The internet allows access to the World Wide Web, which is a system of linked
pages, programs, and files.

108
Big Idea 4: Computer Systems and Networks
Sequential computing is a computational model in which operations are
performed in order one at a time. A sequential solution takes as long as the
sum of all of the steps.

A sequential computing solution takes as long as the sum of all its steps. In the
above example, the total processing time is 4 + 1 + 6 + 2 + 3 + 1 + 5 + 1 = 23
seconds.

109
Big Idea 4: Computer Systems and Networks
In contrast, parallel computing involves breaking up a task into smaller,
sequential pieces. Then those sequential pieces are all executed at the same
time, each on its own processor or on a set of computers that have been
networked together.

A parallel solution takes at least as long as the longest branch in the


program. In the above example, the total processing time is 9 seconds.
110
Big Idea 4: Computer Systems and Networks
Parallel computing can consist of a parallel portion and a sequential portion. A
parallel computing solution takes as long as its sequential tasks plus the longest
of its parallel tasks. Most modern computers are parallel in architecture with
multiple processors.

In the above example, the total processing time is 2 + 1 + 4 + 3 + 1 = 11


seconds.
111
Big Idea 4: Computer Systems and Networks
Some examples of complex computer simulations that benefit from parallel
computing include weather forecasting, flight simulators, car crash modeling,
seismic surveying, and so on.

The “speedup” of a parallel solution is measured in the time to complete the


task sequentially divided by the time to complete the task when done in
parallel:
Speedup = (sequential run time)/(parallel run time)

112
Big Idea 4: Computer Systems and Networks
Many problems are so large and complex that it is impractical to solve them on
a single computer, especially given limited computer memory. Distributed
computing is a computational model in which multiple devices are used to
run a program.

Distributed computing allows problems to be solved that could not be solved


on a single computer because of either the processing time or storage needs
involved.

Much larger problems can be solved more quickly using distributed computing
than using a single computer.

Parallel computing uses a single computer with multiple processors. Distributed


computing uses multiple computing devices to process those tasks. 113
Big Idea 5: Impact of Computing

114
Big Idea 5: Impact of Computing
The digital divide is the difference in access to technology including access to
computers and the internet.

Several variables affect the digital divide:


■Infrastructure—Some parts of the world do not have access to the internet.
■Education—A person could have access to the internet but not have the
education to use it.
■Indifference—A person could have access to the internet but choose not to
use it.
■Cost—The cost of accessing the internet could make using it unaffordable.

115
Big Idea 5: Impact of Computing
A computing innovation includes a program as an integral part of its
function. Some examples of modern computing innovations include the
following:

116
Big Idea 5: Impact of Computing
A computing innovation can have both a beneficial and a harmful effect on
societies, cultures, or economies. An effect may be an impact, a result, or an
outcome. Beneficial and/or harmful effects are contextual and interpretive.

A single effect can be viewed as both beneficial and harmful by different people
or even by the same person.

For example, GPS in a car can predict the time of arrival during a long car trip
by tracking the speed of a car and the distance needed to travel. This can be
beneficial to the driver to know his or her time of arrival. However, this same
innovation can be harmful to the user if the police gain access to this data and
give the driver a speeding ticket.

117
Big Idea 5: Impact of Computing
Computing innovations can reflect existing human bias.Since computing
innovations are created by people, the innovations created can reflect bias that
the programmers bring with them. Programmers should take action to reduce
biases at all levels of software development. Machine learning algorithms that
are trained on biased datasets will give biased results.

Crowdsourcing is a sourcing model in which individuals or organizations


obtain goods and services, including ideas and finances, from a large group of
internet users. Examples include "idea competitions" and "innovation contests"
such as Netflix Prize and Lego Ideas.

Citizen science is scientific research conducted in whole or part by


distributed individuals, many of whom may not be scientists, who contribute
relevant data to research using their own computing devices e.g.
folding@home(protein folding) and Galaxy Zoo(classify galaxies).
118
Big Idea 5: Impact of Computing
Open Access and Creative Commons have enabled broad access to digital information.
Open and curated scientific databases have benefited scientific researchers.

Creative Commons—a public copyright license that enables the free distribution
of an otherwise copyrighted work. This is used when the content creator wants to give
others the right to share, use, and build upon the work they have created.

open source—programs that are made freely available and may be redistributed and
modified(examples: Firefox browser, OpenOffice(in competition with Microsoft Office).

open access—online research output free of any and all restrictions on access and free
of many restrictions on use, such as copyright or license restrictions

Open Access
Big Idea 5: Impact of Computing
Security is needed to protect the confidentiality, integrity, and availability of
information. Security protects that data from cyber attacks and hacking.

Privacy is the right to control data generated by one’s usage of computing


innovations and restrict the flow of that data to third parties.

Personally, identifiable information (PII) is information about an individual


that identifies, links, relates, or describes that person. Examples of PII include
the following:

120
Big Idea 5: Impact of Computing
PII can be analyzed and processed by businesses and shared with other
companies. PII has monetary value. The entire business model for some
computing innovations is to sell user information to targeted advertisers.

As a result, concerns have been raised over how companies handle the
sensitive information of their consumers.

A computing innovation generates metadata that can have the effect of


reducing the privacy of the user. Metadata can include geolocation, time, date,
filename, and so on. This rapid sharing of user data can often have significant
impacts beyond the intended purpose or control of the programmer.

121
Big Idea 5: Impact of Computing
Authentication measures protect devices and information from unauthorized
access. Examples of authentication measures include passwords and multifactor
authentication. A strong password should be easy to remember but difficult for
someone else to guess.

Multifactor authentication is a method of computer access control in


which a user is granted access only after successfully presenting several pieces
of evidence to an authentication mechanism, typically in at least two of the
following categories:
■Knowledge—something the user knows
■Possession—something the user has
■Inherence—something the user is

122
Big Idea 5: Impact of Computing
Digital certificate authorities issue digital certificates that validate the
ownership of encryption keys used in secure communications and are based on a
trust model.

To increase security, encryption is used. Encryption uses cryptographic


algorithms to encrypt data. Encryption is the process of encoding data to
prevent unauthorized access. Decryption is the process of decoding the data.

Symmetric key encryption uses the same key for both encryption and
decryption. The one key is a shared secret and relies on both sides keeping their
key secret.

Public key encryption (also called asymmetric encryption) uses two


keys—one private and one public. Anyone with the public key can encrypt data,
and the public key is public. To decrypt, a second key, which is private, is needed.
123
Big Idea 5: Impact of Computing

Malware is malicious software intended to damage a computing system or


take partial control or its operations. Malware can be spread over email,
executable files, instant messaging, social media, freeware, shareware, and many
other methods.

Computer viruses are malicious programs that can copy themselves and gain
access to a computer in an unauthorized way. Viruses often perform some type
of harmful activity on infected host computers.

124
Big Idea 5: Impact of Computing
Unauthorized access can be gained to computers in several ways. One method
is phishing. Phishing is a technique that directs users to unrelated sites that
trick the user into giving personal data. Phishing is a technique used by cyber
criminals posing as a legitimate institution to lure individuals into providing
sensitive data, such as PII, banking and credit card details, and passwords.

Keylogging is another method involving unauthorized access to a computer.


Keylogging is the use of a program to record every keystroke made by the
computer user in order to gain fraudulent access to passwords and other
confidential information.

Data sent over public networks can be intercepted, analyzed, and modified. One
way that this can happen is through a rogue access point. A rogue access
point is a wireless access point that gives unauthorized access to secure
networks.
125
References

Reichelson, Seth. AP Computer Science Principles Premium with 6 Practice


Tests (Barron's Test Prep) (p. 92). Barrons Educational Series.

126

You might also like