0% found this document useful (0 votes)
73 views16 pages

Understanding Lossy Compression

The document covers fundamental concepts in computing, including binary and decimal systems, data representation, and types of errors. It also discusses programming principles, user interface design, data processing, and the significance of big data, crowdsourcing, and open data. Additionally, it highlights the importance of collaboration in programming and the roles of machine learning and artificial intelligence in data analysis.

Uploaded by

lakshmi201024
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views16 pages

Understanding Lossy Compression

The document covers fundamental concepts in computing, including binary and decimal systems, data representation, and types of errors. It also discusses programming principles, user interface design, data processing, and the significance of big data, crowdsourcing, and open data. Additionally, it highlights the importance of collaboration in programming and the roles of machine learning and artificial intelligence in data analysis.

Uploaded by

lakshmi201024
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Unit 1:

●​ Binary: A way of representing information using only two options.


●​ Decimal: A way of representing information using ten options.
●​ Bit: A contraction of "Binary Digit"; the single unit of information in a computer, typically
represented as a 0 or 1
●​ Byte: 8 bits
●​ Overflow Error: Error from attempting to represent a number that is too large.
●​ Round-off Error: Error from attempting to represent a number that is too precise. The value is
rounded.
●​ Abstraction: process allow a procedure used only knowing what it does not how it does
●​ Analog Data: Data with values that change continuously, or smoothly, over time. Some examples
of analog data include music, colors of a painting, or position of a sprinter during a race.
●​ Digital Data: Data that changes discretely through a finite set of possible values
●​ Sampling: A process for creating a digital representation of analog data by measuring the analog
data at regular intervals called samples.
●​ Lossless Compression: A process for reducing the number of bits needed to represent
something without losing any information. This process is reversible. Text compression
●​ Lossy Compression: A process for reducing the number of bits needed to represent something
in which some information is lost or thrown away. This process is not reversible. Image, video,
audio
●​ Intellectual Property: A work or invention that is the result of creativity, such as a piece of writing
or a design, to which one has rights and for which one may apply for a patent, copyright,
trademark, etc.
●​ Creative Commons: A collection of public copyright licenses that enable the free distribution of
an otherwise copyrighted work, used when an author wants to give people the right to share, use,
and build upon a work that they have created
●​ Digitize: convert pictures, text, sound into digital form that can be processed by a computer

Text is also known as string


One of two value should use boolean (0 or 1)
Phone number and student id is text or string (not boolean)
Israinging is boolean set to true or false

Interpersonal skills learned through collaboration:


Communication
Consensus Building
Conflict resolution
Negotiation
PAir programming
Two porgramsmmers work together as a pair
The driver writes the rogram the observer reviews
Think share pair
[Link] multiplayer
github collaboration and repository
Systems:
e-commerce - shopping online
Cloud services- files that were store onlinewe acces data and informatio nwere
storing not on our local machine
Email

Social media application allows users to connect from a distance and archive
their activities

Ecommerence allows to save time and money by being able to shop at home

Digital asstant device allows users to control their devices hands free making
them safer or more convenient to multitask

An action triggers an event:


• Action may be initiated by the user or another program/device.
Big Idea 4
The program "jumps" to the code segment according to the event:
1s are developed for a purpose and this
Big Idea 5
The code segment is executed.
Output is triggered by the code segment (or additional events are triggered).
e inputs in a variety of fashions to influence
Review
The program code is not necessarily executed "in order":
• Code segments are executed as they are called, according to the events
triggered.

Compression rate:
(original text size - (compressed test size + dictionary size)) / (original text size)
times entire thing with 100

1.​ A particular poem has 15,000 characters. It can be compressed to 5,000


characters plus a 200-character library. What is the compression rate?

(15,000-(5000+200))/15,000 times 100

2.​ How many total bits are required to encode an image that is 50 pixels
wide and 50 pixels tall, if you encode it with 12 bits per pixel with an
additional 24 bits for metadata.

Total pixels: 50 times 50 = 2500


Total bits for pixels: 2500 times 12 bits/pixel = 30,000 bits
30000 bits+24 bits= 30024 bits total

Creative Commons - A collection of public copyright licenses that enable


the free distribution of an otherwise copyrighted work, used when an
author wants to give people the right to share, use, and build upon a work
that they have created

Intellectual Property - A work or invention that is the result of creativity,


such as a piece of writing or a design, to which one has rights and for
which one may apply for a patent, copyright, trademark, etc.
Copyright - The legal right of the owner of intellectual property. In simpler
terms, copyright is the right to copy. This means that the original creators
of products and anyone they give authorization to are the only ones with
the exclusive right to reproduce the work.

Digitize Convert (pictures, text, or sound) into a digital form that can be
processed by a computer.

Unit 3: Intro to App Design

●​ User Interface: the inputs and outputs that allow a user to interact with a piece of software. User
interfaces can include a variety of forms such as buttons, menus, images, text, and graphics.
●​ Input: data that are sent to a computer for processing by a program. Can come in a variety of
forms, such as tactile interaction, audio, visuals, or text.
●​ Output: any data that are sent from a program to a device. Can come in a variety of forms, such
as tactile interaction, audio, visuals, or text.
●​ Program Statement: a command or instruction. Sometimes also referred to as a code statement.
●​ Program: a collection of program statements. Programs run (or “execute”) one command at a
time.
●​ Sequential Programming: program statements run in order, from top to bottom.
●​ Event Driven Programming: some program statements run when triggered by an event, like a
mouse click or a key press
●​ Documentation: a written description of how a command or piece of code works or was
developed.
●​ Comment: form of program documentation written into the program to be read by people and
which do not affect how a program runs.
●​ Pair Programming: a collaborative programming style in which two programmers switch
between the roles of writing code and tracking or planning high level progress
●​ Debugging: Finding and fixing problems in an algorithm or program.
●​ Development process: the steps or phases used to create a piece of software. Typical phases
include investigating, designing, prototyping, and testing
●​ Event: associated with an action and supplies input data to a program. 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.

Unit 4: Variables, Conditionals, and Functions


●​ Expression: a combination of operators and values that evaluates to a single value
●​ Assignment Operator: allows a program to change the value represented by a variable
●​ Variable: a named reference to a value that can be used repeatedly throughout a program.
●​ String: an ordered sequence of characters.
●​ Boolean Value: a data type that is either true or false.
●​ Comparison Operators: <, >, <=, >=, ==, != indicate a Boolean expression
●​ Logical operator: NOT, AND, and OR, which evaluate to a Boolean value.
●​ Conditional Statement: affects the sequential flow of control by executing different statements
based on the value of a Boolean expression.
●​ Function: a named group of programming instructions. Also referred to as a “procedure”.
●​ Function Call: a command that executes the code within a function

Unit 5: Data

●​ Metadata: data about data


●​ Citizen Science: 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.
●​ Cleaning Data: a process that makes the data uniform without changing its meaning (e.g.,
replacing all equivalent abbreviations, spellings, and capitalizations with the same word).
●​ Correlation: a relationship between two pieces of data, typically referring to the amount that one
varies in relation to the other.
●​ Crowdsourcing: the practice of obtaining input or information from a large number of people via
the Internet.
●​ Information: the collection of facts and patterns extracted from data
●​ Data bias: data that does not accurately reflect the full population or phenomenon being studied
●​ Data filtering: choosing a smaller subset of a data set to use for analysis, for example by
eliminating / keeping only certain rows in a table

Correlation (similarities, patterns) does not equal Causation (this thing caused that thing)

Data: facts and statistics collected together for reference or analysis. Aka Datasets

Big Data: data sets that are too large or complex to be dealt with by traditional computer data-processing
application software.

Data Mining: the process of extracting useful patterns and information from large datasets. It involves
analyzing data to discover hidden relationships, trends, and insights.

Machine Learning: a subset of data mining that focuses on creating algorithms and models that enable
computers to learn from and make predictions or decisions based on data

Artificial Intelligence: artificial intelligence is a field, which combines Computer Science and robust
Datasets, to enable Problem-Solving. AI uses machine learning algorithms to process large volumes of data
to identify patterns and create AI models.

Data Processing: a series of operations on data, especially by a computer, to retrieve, transform, or classify
information.
Metadata: data about data

Machine Learning (ML) is a type of Artificial Intelligence (AI) that allows computers to learn and improve
from experience without being programmed. ML uses algorithms to analyze large amounts of Big Data,
identify patterns, and make predictions.

-Learning from data: ML systems are trained by feeding them large amounts of data. The more data a
system is exposed to, the better it performs.

-Identifying patterns: ML algorithms analyze data to identify patterns and relationships between inputs
and outputs.

-Making predictions: ML systems use the patterns they identify to make predictions. For example, a
financial organization might use ML to classify transactions as fraudulent or genuine.

-Adaptability: ML is well suited to situations where data is constantly changing, or where coding a
solution would be difficult.

Algorithmic Bias describes systematic and repeatable errors in a computer


system that create "unfair" outcomes, such as "privileging" one category over
another in ways different from the intended function of the algorithm.

Data Processing is a series of operations on data, especially by a computer, to retrieve, transform, or


classify information.

In fact, there's even a name for it: the process of examining very large data sets to find useful information,
such as or relationships, is known as Data Mining.

Data Bias: data that does not accurately reflect the full population or phenomenon
being studied

Open Data
●​ "sharing data with others so they can can analyze it"
●​ Open data is publicly available data shared by governments, organizations,
and others
●​ Making data open help spread useful knowledge or creates opportunities
for others to use it to solve problems

Citizen Science and Crowdsourcing


●​ "collecting data from others so you can analyze it"
●​ Crowdsourcing is the practice of obtaining input or information from a large
number of people via the Internet.
●​ Citizen science is research where some of the data collection is done by
members of the public using own computing devices which leads to solving
scientific problems
●​ Crowdsourcing offers new models for collaboration, such as connecting
businesses or social causes with funding
●​ Both are examples of how human capabilities can be enhanced by
collaboration via computing

Big data
●​ "Collect huge amounts of data so we can learn even more from it"
●​ The size of the datasets we analyzed impacts how much information can be
extracted
●​ As a result, in business, science, and many other contexts people are
working with increasingly big data sets
●​ When data gets too big it can no longer be processed on one computer.
Cloud computing or parallel systems are sometimes used to help process
all that information.
●​ In general, scalability of your system is important to consider when working
with big data. You want your system to be able to work even as you're using
more and more data.

Topic Big Data Crowdsourced Data Open Data

Explain the large amounts of collected from many information that anyone
Topic in information that come people, usually through can access and use for
your own from different websites or apps. Instead free. This includes data
words sources. too big and of experts gathering all from the government or
complex to handle the data, regular people research that helps people
technology is needed can share their make better decisions. It
to process and knowledge. supports transparency
analyze it. and allows community
engagement.
For example, when An example is the Stream
you watch videos Tracker project, where
online, the computer people report the
looks at a lot of conditions of local
videos to suggest streams.
more that you might
want to see.
Collect or social media, videos, the public is asked to collected by government
Choose or health records. share information agencies or universities
Data and made available online.
like whether streams in
For example, doctors their area are flowing or For example, census data
gather information dry. about neighborhoods is
from patients’ open data that anyone can
medical histories to look at.
study diseases.

Clean fixing mistakes, like checked for accuracy. checking that it is correct
and/or removing duplicates This means making sure and up-to-date. This
Filter Data or errors. the information people ensures users can trust
share is correct. the information they find.
For instance, when
studying DNA,
scientists have to
make sure the data is
accurate to
understand how it
relates to diseases.

Visualize charts or graphs to A map could show which Using charts and graphs
and Find see patterns and streams are flowing and helps people understand
Patterns trends. which are not, helping open data better.
water management.
This way, researchers For instance, parents can
can see trends, like look at school
how climate change performance data to
is affecting choose the best schools
temperature over for their kids.
time.

Big Data:

Definition: Parallel computing involves breaking down a task into smaller subtasks that can be
executed concurrently, resulting in faster processing time.
Parallel Computing Model: This model utilizes multiple processors or cores to execute tasks
simultaneously, which increases efficiency compared to sequential computing.
Speedup: Speedup is a measure of how much faster an algorithm or program runs on multiple
processors compared to running it sequentially on a single processor.
Challenges: Parallel computing can face challenges such as synchronization, data
dependency, and load balancing.
Applications: It is used in various fields like scientific simulations, data analysis, and real-time
processing systems.

The efficiency of a solution that can be broken down into parallel (at same time) portions is still
limited by a sequential portion.

Parallel computing can run the program in parallel on subsets of the data, so that
the total amount of time is less.

speed up her data processing?

​ Using parallel computing on a computer with a multi-core CPU.


Distributing the computing to multiple machines to run the program on
subsets of the data.

Distributed computing is a computational model that uses multiple computing devices to run a
program. It would be very helpful in this situation since the additional devices would provide more
storage space for the digital files.

Software modularity is the practice of organizing code into multiple modules, each of which is
responsible for a different aspect of the software. It's a great programming practice, but it will only
make the code better organized; it will not resolve the problem of not enough storage capacity.

Parallel computing is a computational model that splits a program into multiple tasks so that it can
run some tasks simultaneously. It is particularly helpful when a program is too slow to run
sequentially. It would likely help the digitization process run more quickly, but they first need to
solve the problem of not enough storage capacity

Software documentation is documentation that describes how code is expected to work.

Sequential computing is a computational model in which operations are performed in order one at a
time. (Time takes as long as the sum of all its steps.)

Parallel computing is a computational model where the program is broken into multiple smaller
sequential computing operations some of which are performed simultaneously. (Time takes as long as
its sequential tasks plus the longest of its parallel tasks.)

add up the time required for all the sequential tasks and then add the time of the longest task in the set
of parallel tasks.

Ex: Sequential Task A: 5 minutes


Sequential Task B: 10 minutes
Parallel Tasks:

●​ Task 1: 15 minutes
●​ Task 2: 20 minutes
●​ Task 3: 18 minutes
●​ Total time for sequential tasks: 5+10=15 minutes
●​ Parallel time is 15+ longest 20= 35

Distributed computing is a computational model in which multiple devices are used to run a program.
The "speedup" of a parallel solution is measured in the time it took to complete the task sequentially
divided by the time it took to complete the task when done in parallel.

15/35

Longest of the 2 processors time is the least amount of time it takes in time

●​ reinforcement learning: The algorithm performs actions that will


be rewarded the most. Often used by game-playing AI or
navigational robots.
●​ unsupervised machine learning: The algorithm finds patterns in
unlabeled data by clustering and identifying similarities. Popular
uses include recommendation systems and targeted advertising.
●​ supervised machine learning: The algorithm analyzes labeled
data and learns how to map input data to an output label. Often
used for classification and prediction.

[Link]
mkv-cinemas
Iteration Breakdown:

1.​ Iteration 1:
○​ Initial x=0x = 0x=0, result=0result = 0result=0.
○​ Inside the loop:
■​ result=result+x=0+0=0result = result + x = 0 + 0 = 0result=result+x=0+0=0
■​ x=x+1=0+1=1x = x + 1 = 0 + 1 = 1x=x+1=0+1=1.
2.​ Iteration 2:
○​ Current x=1x = 1x=1, result=0result = 0result=0.
○​ Inside the loop:
■​ result=result+x=0+1=1result = result + x = 0 + 1 = 1result=result+x=0+1=1
■​ x=x+1=1+1=2x = x + 1 = 1 + 1 = 2x=x+1=1+1=2.
3.​ Iteration 3:
○​ Current x=2x = 2x=2, result=1result = 1result=1.
○​ Inside the loop:
■​ result=result+x=1+2=3result = result + x = 1 + 2 = 3result=result+x=1+2=3
■​ x=x+1=2+1=3x = x + 1 = 2 + 1 = 3x=x+1=2+1=3.
4.​ Iteration 4:
○​ Current x=3x = 3x=3, result=3result = 3result=3.
○​ Inside the loop:
■​ result=result+x=3+3=6result = result + x = 3 + 3 = 6result=result+x=3+3=6
■​ x=x+1=3+1=4x = x + 1 = 3 + 1 = 4x=x+1=3+1=4.
5.​ Iteration 5:
○​ Current x=4x = 4x=4, result=6result = 6result=6.
○​ Inside the loop:
■​ result=result+x=6+4=10result = result + x = 6 + 4 =
10result=result+x=6+4=10
■​ x=x+1=4+1=5x = x + 1 = 4 + 1 = 5x=x+1=4+1=5.
6.​ Iteration 6:
○​ Current x=5x = 5x=5, result=10result = 10result=10.
○​ Inside the loop:
■​ result=result+x=10+5=15result = result + x = 10 + 5 =
15result=result+x=10+5=15
■​ x=x+1=5+1=6x = x + 1 = 5 + 1 = 6x=x+1=5+1=6.
7.​ Exit Condition:
○​ At this point, x=6x = 6x=6, which satisfies x>5x > 5x>5.
○​ The loop stops.
step 1 (Before the loop starts):

●​ a = true, b = false, c = true

Step 2 (First iteration of the loop):

1.​ c ← NOT c → c becomes false.


2.​ b ← c → b becomes false.
●​ Now, a = true, b = false, c = false.​
The condition (a AND b) is false (b is still false), so the loop continues.

Step 3 (Second iteration of the loop):

1.​ c ← NOT c → c becomes true.


2.​ b ← c → b becomes true.
●​ Now, a = true, b = true, c = true.​
The condition (a AND b) is true (a and b are both true), so the loop stops.

A Repeat-Until Loop runs the instructions inside the loop until the condition in the loop header
becomes true. This means:

1.​ Start with your variables.


2.​ Run the block of code inside the loop.
3.​ Check the condition at the end of each iteration.
○​ If the condition is false, the loop runs again.
○​ If the condition is true, the loop stops.
So what's happening is sum=0+3 then usm equals to 3
Then from the previous answer su mis now 3 then 2nd repat is sum=3+3=6
Initial Values:

●​ p=10p = 10p=10
●​ q=20q = 20q=20
●​ r=30r = 30r=30
●​ s=40s = 40s=40

Code Execution:

1.​ p←qp \gets qp←q:


○​ Assign the value of qqq to ppp.
○​ p=20p = 20p=20, q=20q = 20q=20, r=30r = 30r=30, s=40s = 40s=40.
2.​ q←rq \gets rq←r:
○​ Assign the value of rrr to qqq.
○​ p=20p = 20p=20, q=30q = 30q=30, r=30r = 30r=30, s=40s = 40s=40.
3.​ s←qs \gets qs←q:
○​ Assign the value of qqq to sss.
○​ p=20p = 20p=20, q=30q = 30q=30, r=30r = 30r=30, s=30s = 30s=30.
4.​ r←pr \gets pr←p:
○​ Assign the value of ppp to rrr.
○​ p=20p = 20p=20, q=30q = 30q=30, r=20r = 20r=20, s=30s = 30s=30.
Final Value of rrr:

The final value of rrr is 20.

Let's say num1 = 5 and num2 = 10 before the swap.

1.​ temp = num1; → temp = 5


2.​ num1 = num2; → num1 = 10
3.​ num2 = temp; → num2 = 5

After the swap, num1 = 10 and num2 = 5. The values have successfully swapped.

You might also like