SlideShare a Scribd company logo
1 of 90
SEMESTER: I
Department of Information Technology
Sri Manakula Vinayagar Engineering
College
INTRODUCTION (9 Hrs)
 Computational Thinking - Information and
Data - Converting Information into Data –
Data Capacity – Data Types and Encoding –
Logic-Solving Problems – Limits of
Computation – Pseudo code and Flow Chart.
2
Department of IT, SMVEC
 It represents a universally applicable attitude
and skill set everyone, not just computer
scientists, should be eager to learn and use.
3
Computational Thinking
Department of IT, SMVEC
Data
 “The quantities, characters, or symbols on
which operations are performed by
computers and other automatic equipment,
and which may be stored or transmitted in
the form of electrical signals, records on
magnetic tape or punched cards, etc.”
4
Information and Data
Department of IT, SMVEC
Information:
 “Knowledge communicated concerning some
particular fact, subject, or event; that of
which one is apprised or told; intelligence,
news” and adds that information is “that
which is obtained by the processing of data.”
Example:
Your credit card number is information that is
turned into data when it is stored on the back of your
card.
5
Department of IT, SMVEC
 There are two different types of data
1. Continuous
2. Discrete
Data is continuous if there are an infinite
number of possible values for an individual
datum.
Data is discrete if there are a finite
number of possible values.
6
Converting Information into Data
Department of IT, SMVEC
 Consider measuring the weight of an orange.
Although the orange could weigh exactly 200
grams, it might also weigh 229.3 grams or
229.31533 grams or even
229.31533480185993 grams.
7
Department of IT, SMVEC
 Consider asking your friends how many
biological parents they have who are still
living. They may respond with the numbers 0
or 1 or 2. Since no person has more than 2
biological parents, numbers larger than 2 are
not possible and it should be obvious that it
is not possible to have a fractional number of
living parents.
8
Department of IT, SMVEC
 In electronics, a signal may be either analog
or digital.
 An analog signal is an encoding of
continuous data, whereas a digital signal is
an encoding of discrete data.
 In digital systems, the smallest unit of data is
known as a binary digit, or bit.
 A bit can only take on one of two possible
values:
ON(1) or OFF(0)
9
Department of IT, SMVEC
 Computing systems encode all information as
a sequence of bits. Pictures, sound,
textbooks, and video are encoded as long
sequences of bits.
 A sequence of bits is commonly referred to as
a bit string.
10
Department of IT, SMVEC
 00, 01, 10, 11
FIGURE 1.2: The four patterns that a string of two bits can exhibit are 00, 01,
10, and 11.
11
Department of IT, SMVEC
 000, 001, 010, 011, 100, 101, 110, 111
FIGURE 1.3: There are eight patterns that a string of three bits
can exhibit.
12
Department of IT, SMVEC
13
Department of IT, SMVEC
 Data encoding requires us to know how many
bits are required to store a piece of
information.
 When storing the symbols on a keyboard, for
example, we must know how many bits would
be required to store any one of the symbols.
 Would it be possible to encode a keyboard
symbol as a 3 bit string or a 4 bit string
rather than an 8 bit string?
14
Data Capacity
Department of IT, SMVEC
 You are given a list of all keyboard symbols and you
are also given a bit string of length three.
 Your task is to generate a unique bit pattern for each
of the symbols in your list.
 You begin with the symbol “A” and decide to encode
this symbol as 000.
 As you move through the alphabet, you choose to
encode “B” as 001, “C” as 010, “D” as 011, “E” as 100,
“F” as 101, “G” as 110, and “H” as 111.
 At this point you realize that there are no patterns
left to encode the remaining symbols of the keyboard
and hence a bit string of length three is not sufficient
to encode one keyboard symbol
15
Department of IT, SMVEC
 A byte is a bit string of length eight.
 A single byte, therefore, is able to store 28 or
256 unique patterns.
 One other measure of data capacity is known
as a word (based on the hardware of a
computing system, multiples of 8).
 A word is a fixed-length sequence of bits that
are processed as a single item by the
processor.
16
Department of IT, SMVEC
17
Department of IT, SMVEC
18
Department of IT, SMVEC
19
Department of IT, SMVEC
 Numbers (Numeral Systems, Positional
Numeral System, Integers as Binary Bit
Strings, Real Numbers as Binary Bit Strings,
Precision as a Source of Error, Underflow and
Overflow as Sources of Error)
 Text
 Colors
 Pictures
 Sound
20
Data Types and Encoding
Department of IT, SMVEC
 A numeral system is a way of representing
numbers in written form.
 Consider, for example, the three numbers
shown in Figure
21
Department of IT, SMVEC
22
Department of IT, SMVEC
 A positional numeral system must first
specify a base, also known as the radix that
describes how many digits exist in that
particular system.
 Any positive integer greater than one can be
used as a base in a positional numeral
system.
23
Department of IT, SMVEC
24
Department of IT, SMVEC
 Consider the example of Figure 1.11 that shows
how to interpret the decimal number 925. For this
number we see that the digit 5 is at position 0, the
digit 2 is at position 1 and the digit 9 is at position
2. The radix is assumed to be 10 and hence the
positional terms will be integral powers of 10. We
then understand that the digit 5 is a multiplier for
100, the digit 2 is a multiplier for the 101, and the
digit 9 is a multiplier for 102. In other words, the
number 925 is understood as (9 × 102) + (2 ×
101) + (5 × 100) and since any positive integer
that is raised to the 0th power is equal to 1 this
reduces to (9 × 100) + (2 × 10) + (5 × 1).
25
Department of IT, SMVEC
26
Department of IT, SMVEC
 Computing systems represent integer
numbers as binary bit strings.
27
Department of IT, SMVEC
 Although we can represent an integer as a
sequence of bits, is it possible to represent a
real number such as 2.31 or 2.125 or even
3.1415926?
 For example, in base 10 the value 1.625
means (1 × 100) + (6 × 10–1) + (2 × 10–2) +
(5 × 10–3).
 We can then represent real numbers as binary
bit strings assuming that we can determine
the decimal location.
28
Department of IT, SMVEC
 Consider, for example, the meaning of
1.1012.
29
Department of IT, SMVEC
 One difficulty that arises when encoding real
numbers is that there may be an arbitrary
number of digits on the right side of the decimal
value to represent even small numbers.
 1/3 = 0.33333333333333333333333333
 but soon realize that we will never be able to
write as many digits as are required for a
completely accurate representation
 If a computer uses 16 bits to store real numbers,
we say that the computer is precise up to 16 bits,
or that the computer uses 16 bit precision.
30
Department of IT, SMVEC
 Recall that an 8 bit binary string can only
hold values between 0 and 255.
 Add 1 to the value 255 and store the result as
an 8 bit binary string. Of course the result
should be 256 but since 256 cannot be
encoded as an 8 bit binary string the result
will either be an error of some sort or, on
many computing systems
31
Department of IT, SMVEC
 Underflow occurs when a computer
instruction produces a value that is too small
in magnitude (i.e., very close to zero) to be
encoded by the number of bits available.
32
Department of IT, SMVEC
 All data that is stored in a computing system
is encoded as bit strings.
 First, it is important to understand that a
textual character, when drawn on either a
page of text or on a computer screen, is
really just a picture.
 Textual characters are usually encoded as
integer values using the encoding schemes
discussed earlier in this chapter.
33
Department of IT, SMVEC
34
Department of IT, SMVEC
 The human eye perceives color through three
types of biological photo sensors known as
cones.
 Each cone is attuned to one of three
wavelengths that correspond roughly to red,
green, and blue light.
 The individual responses of all cones
combine to form the perception of a single
color at a single point within the field of view.
 The design of this biological system suggests
that color is a three-dimensional entity.
35
Department of IT, SMVEC
 The RGB color model is the most common
way of representing color in image-
processing systems. The RGB model uses red
(R), green (G), and blue (B) as the primary
colors such that any color can be created by
combining different amounts of these three
primaries.
36
Department of IT, SMVEC
 The most common encoding of a digital
image is that of a two-dimensional grid of
colors.
 Each element of the grid is known as a pixel
and represents a very small rectangular
region of the image that is comprised of a
single color.
 When the grid of pixels is viewed at an
appropriate distance, the individual pixels
recede from view while collectively appearing
as a naturally colored and smooth image.
37
Department of IT, SMVEC
 High-definition video uses individual images that
have up to 1920 columns and 1080 rows of pixels for
a total of 1920 × 1080 or 2,073,000 pixels. Since
each of these pixels is encoded as a bit string of
length 24, the image can be encoded as a bit string
of length 1920 × 1080 × 24 or 49,766,400 bits.
 Alternatively, using a byte as a measure of data
capacity, the image can be encoded using 1920 ×
1080 × 3 or 6,220,800 bytes or approximately 6
megabytes.
 Digital cameras take images that use on the order of
10 megapixels and images of this resolution can be
encoded as a string of 30 megabytes.
38
Department of IT, SMVEC
39
Department of IT, SMVEC
 Digital audio is used almost exclusively today when
recording, processing, and distributing sound.
 Online music stores contain hundreds of thousands
of hours of digital sound.
 Sound is a physical phenomenon caused by
waveforms that propagate through the air.
 A microphone is used to transform the waveform into
an analog electric signal after which the analog signal
is sampled to produce a digital encoding.
 Sampling is a process where the strength of a
changing signal is measured at regular time intervals
and those measurements are then recorded.
 In this way, the sound wave is converted into a
sequence of numeric values.
40
Department of IT, SMVEC
 Frequency is the rate at which sound waves
change and is measured in terms of the
hertz.
 The hertz is denoted as Hz and is defined as
the number of cycles (or changes) per
second.
 Sound waves that change at a slow rate are
perceived as a low pitch while sound waves
that change at a high rate are perceived as
higher in pitch.
 The average person can hear sound waves 20
Hz up through about 20,000 Hz or 20 kHz.
41
Department of IT, SMVEC
 Logic, in its broadest sense, deals with
correct and incorrect ways to reason.
 Logic provides a way to tell the difference
between incorrect and correct thinking, and
can therefore be defined as the science of
correct thinking.
Categories of logic :
Inductive logic and deductive logic.
42
Logic
Department of IT, SMVEC
 Inductive logic is a type of reasoning that
begins with a set of observations or
experiences from which conclusions can be
derived with some degree of certainty.
43
Department of IT, SMVEC
 Consider a scenario where you have eaten
brussels sprouts only twice in your life.
Unfortunately, you became physically ill
within hours of eating them and therefore
conclude you are allergic to brussels sprouts.
Although the conclusion that “I am allergic
to brussels sprouts” is reasonable,
It is not the only conclusion that could be
reasonably reached and is therefore not certain.
44
Department of IT, SMVEC
 Perhaps you were coincidently exposed to a
contagious virus shortly before eating the
brussels sprouts and this virus was the actual
cause of your illness.
 Conclusions reached in an inductive system
are necessarily uncertain and are directly
related to the number of experiences on
which the conclusion is based.
45
Department of IT, SMVEC
 For example, the certainty of the conclusion
that “I am allergic to brussels sprouts” would
be increased if you ate them three more
times and became physically ill in each case.
46
Department of IT, SMVEC
 By contrast, begins by assuming that certain
things are absolutely true from which other
facts must also be absolutely true. Any
conclusions that are reached under deductive
logic are absolutely, irrefutably, and certainly
true if the assumptions are true.
 A conclusion is a statement of truth that must
logically flow from the premises.
47
Department of IT, SMVEC
 syllogism as a logical argument that
contained two premises and a true conclusion
that must logically follow if the two premises
are actually true.
48
Department of IT, SMVEC
 Premise: Computational thinking is beneficial
for all students.
 Premise: Jemimah Farnsworth is a student.
 Conclusion: Computational thinking is
beneficial for Jemimah Farnsworth.
49
Department of IT, SMVEC
 Symbolic logic is a modern extension of
Aristotelian logic where symbols, rather than
phrases drawn from human language, are
used to represent statements of truth.
 Logical operators, also known as logical
connectives, are used to express logical
thought.
 Boolean logic is a symbolic logic system that
was created by a mathematician named
George Boole around 1850.
 Modern computing systems rely heavily on
the rules of Boolean logic for generating
correct and reliable results.
50
Department of IT, SMVEC
 Propositions form the basic units of Boolean
logic.
 A proposition is a statement that can be
either true or false.
 Stated another way, a proposition is a
statement that has a value of either true or
false.
51
Department of IT, SMVEC
True statement:
“Mount Everest is the tallest mountain in
the world.”
Answer: True
False statement:
“The Mississippi is the longest river in the
world.”
Answer: False
Note: Nile is the longest river in the world
52
Department of IT, SMVEC
 “How tall is Mount Everest?”
No True or False
53
Department of IT, SMVEC
 Propositions can be either simple or
compound.
 A simple proposition is one that cannot be
broken into parts.
 A compound proposition is formed by
combining simple propositions with logical
connectives, also known as logical operators.
 There are four fundamental logical operators
that are best described by the words and, or,
implies, and not.
54
Department of IT, SMVEC
 Simple: “I am hungry.”
 Simple: “I am cold.”
 Compound: “I am hungry and I am cold.”
Abbreviated:
 P = “I am hungry.”
 Q = “I am cold.”
 S = “Mount Everest is the tallest mountain in
the world.”
“I am hungry and I am cold” as P and Q
55
Department of IT, SMVEC
 Propositions must be well formed (i.e.,
properly written) to have meaning.
 When writing a proposition, certain rules
must be exactly followed in order to
construct a meaningful proposition.
 If these rules are not followed you may write
something that appears to be a proposition
but is actually just a meaningless jumble of
labels and operators.
Department of IT, SMVEC 56
 Rule 1 - Each of the following is a simple
proposition.
a. Any single letter
b. True
c. False
Department of IT, SMVEC 57
 Rule 2—Let a box (□) stand for a proposition
(either simple or compound).
 Assuming that each box is some proposition,
then each of
 the following are also propositions.
 a. □ and □
 b. □ or □
 c. □ implies □
 d. □ ≡ □
 e. not □
 f. (□)
Department of IT, SMVEC 58
 Contd…
Department of IT, SMVEC 59
 When we evaluate a proposition, the goal is
not to make sure that it is well written but
rather to determine the truth value of the
proposition.
 Consider, for example, the following simple
propositions.
P = “I am hungry.”
Q = “I am cold.”
 evaluate the truth value of the compound
proposition.
P and Q
Department of IT, SMVEC 60
 The truth value of the compound proposition
“P and Q” depends upon the truth values of
both P and Q.
Scenario 1: I have just finished eating
P and Q – False
“I am hungry and I am cold” – False
Scenario 2 : I am resting on the beach during a
sizzling summer afternoon
P and Q – False
Department of IT, SMVEC 61
Department of IT, SMVEC 62
 For the binary operators there are only two inputs
and since each of these two inputs has only two
possible values there are only four situations that the
operator must handle.
 for example, the following definition of logical
conjunction.
 1. The logical conjunction of false with false is false.
 2. The logical conjunction of false with true is false.
 3. The logical conjunction of true with false is false.
 4. The logical conjunction of true with true is true.
Department of IT, SMVEC 63
Department of IT, SMVEC 64
 Logical disjunction, however, is not as
intuitive since our informal use of the word or
is not as closely connected to the way it is
formally defined.
Department of IT, SMVEC 65
 Logical implication is perhaps the most
challenging operator to master.
 This operator captures the idea that if one
thing is true, then some other thing must
also, by logical necessity, be true.
Department of IT, SMVEC 66
 If the proposition “my car battery is dead”
has a value of True,
this implies that
the proposition “my car won’t start”
must also be true.
In Boolean logic we would say that “My car
battery is dead implies my car won’t start.” We
might phrase this informally as “whenever my
car battery is dead, my car won’t start.”
Department of IT, SMVEC 67
 In the proposition “P implies Q” we refer to P
as the antecedent and Q as the consequent.
Consider the following two simple
propositions and their abbreviations.

 P = “My car battery is dead.”
 Q = “My car won’t start.”
Department of IT, SMVEC 68
1. P is True and Q is True.
Consider the situation where we observe that “my car
battery is dead” and we also observe that “my car won’t
start.”
 In this scenario, we understand that “True implies
True”
2. P is True and Q is False
We now observe that the car will start (since Q is False)
and that the car battery is dead.
The proposition that “P implies Q” must therefore be
false since this proposition is claiming that the car
won’t start whenever the car battery is dead.
In this scenario we understand that “P implies Q” is
logically inconsistent with the observed facts.
Therefore, “True implies False” has a value of False
Department of IT, SMVEC 69
 3.P is False and Q is True.
 When the antecedent is false, there is no conclusion
that can logically be drawn with respect to the
consequent.
 In this case, the statement that “P implies Q” has not
been disproven and therefore has a value of True.
 For example, the observation that “my car battery is
not dead” and that “my car won’t start” does not
contradict the statement that “whenever my car
battery is dead my car won’t start.”
 Perhaps the car won’t start for some reason unrelated
to the car battery.
 Since there is no logical contradiction between the
observed situation and the statement that “My car
battery is dead implies my car won’t start” we
understand that “False implies True” is true.
Department of IT, SMVEC 70
4.P is False and Q is False.
Again, since the antecedent is False, we
understand that “False implies False” is True.
In this situation, we observe that “my car
battery is not dead” and we also observe that
“my car will start.”
Department of IT, SMVEC 71
 Variables P and Q are said to be equivalent if
they have the same truth value.
Truth table for logical equivalence
Department of IT, SMVEC 72
 Logical negation is the only unary operator.
This operator expresses the obvious thought
that if something is not true then it must be
False, and if something is not False then it
must be True.
Department of IT, SMVEC 73
 To evaluate propositions that involve more
than one operator, we can apply the same
process, but it must be applied once for every
operator in the proposition.
Department of IT, SMVEC 74
 For the situation where
P = True, Q = False, and R = True.
1. Parentheses are used to group the sub
proposition “(Q or R).”
For this reason, we first use the disjunction table
to evaluate “(Q or R)”
where Q = False and R = True.
Q or R - True
 Once we have evaluated “(Q or R)” to True we can
replace that sub proposition by its value and
continue our process of evaluation. We now have
the proposition
 P and True
Department of IT, SMVEC 75
for this situation
where P = True,
Q = True and
R = False.
There are two operators in this proposition and
they should be evaluated from left to right.
P and Q – True
True implies R - False
Department of IT, SMVEC 76
 Q implies R (Parenthesis first)
 P and False
 Final Answer = False
Department of IT, SMVEC 77
 1. Make a list of each logical variable (abbreviation)
that appears in the proposition. If one variable occurs
more than once in the proposition, it should be
included only once in your list.
 2. Place a column in the truth table for every variable
list your list. The column heading should be the
variable itself.
 3. For the heading of the last column you should
write the entire proposition.
 4. If there are N variables in your list, you must create
2N rows. Each row represents a unique combination
of values for the N variables.
 5. For each row, determine the value of the
proposition and place that value in the last column.
Department of IT, SMVEC 78
 P and not (Q or R)
Department of IT, SMVEC 79
Department of IT, SMVEC 80
Department of IT, SMVEC 81
 Two propositions are said to be equivalent if they
have the same truth table. Consider, for example,
the two propositions
 not (P and Q)
 (not P) or (not Q)
 When two propositions are equivalent, they have
the same meaning and are therefore
interchangeable.
Department of IT, SMVEC 82
 Any proposition that has a value of True
regardless of the inputs is said to be a
tautology.
 Since a tautology is always True
 Any proposition that has a value of False for
all inputs is said to be a contradiction.
 Contradiction can be understood as a
statement that is always logically invalid no
matter how you look at it.
Department of IT, SMVEC 83
 Tautologies and contradictions should be
avoided when writing propositions and they
should also be avoided in the normal course
of human conversations since such
statements do not express any sort of
productive line of reasoning. The following
propositions give examples of a tautology
and a contradiction.
 Tautology: P or not P
 Contradiction: P and not P
Department of IT, SMVEC 84
85
Pseudocode:
English-language
statements that
describe the
processing steps of a
program in
paragraph form.
START
READ EMPLOYEE DATA
COMPUTE GROSS PAY
COMPUTE DEDUCTIONS
COMPUTE NET PAY
WRITE EMPLOYEE PAYCHECK
STOP
Example
86
START
STOP
SYMBOLS NAME
Terminal interrupt
symbols
USE
Terminal point
(start, stop, or
break)
Input/Output
symbol
Reading data from an input
medium or writing data to an
output medium
Process symbol Processing input data
87
SYMBOLS NAME
Flowline symbol
USE
Sequence of operations
and direction of data flow
Decision symbol Decision-making operations
Predefined-process
symbol
Operations specified elsewhere
(not in the current algorithm)
88
SYMBOLS NAME
Connector symbol
USE
Exit to, or entry from,
another part of the
Flowchart
Preparation symbol Control operations: Set
limit on loop-control
variables, Initialize
accumulators, etc.
Department of IT, SMVEC 89
 Example:
if "1"
print response
"I am case 1“
if "2"
print response
"I am case 2"
Department of IT, SMVEC 90

More Related Content

Similar to UNIT-I U20EST109 - PROBLEM SOLVING APPROACH - Copy (1).pptx

Similar to UNIT-I U20EST109 - PROBLEM SOLVING APPROACH - Copy (1).pptx (20)

Chapter 1: Binary System
 Chapter 1: Binary System Chapter 1: Binary System
Chapter 1: Binary System
 
W 9 numbering system
W 9 numbering systemW 9 numbering system
W 9 numbering system
 
W 9 numbering system
W 9 numbering systemW 9 numbering system
W 9 numbering system
 
Data Representation
Data RepresentationData Representation
Data Representation
 
computer architecture
computer architecture computer architecture
computer architecture
 
Data representation in a computer
Data representation in a computerData representation in a computer
Data representation in a computer
 
Number system
Number system  Number system
Number system
 
Digital Electronics
Digital ElectronicsDigital Electronics
Digital Electronics
 
Introduction to digital computers and Number systems.pptx
Introduction to digital computers and Number systems.pptxIntroduction to digital computers and Number systems.pptx
Introduction to digital computers and Number systems.pptx
 
Data representation computer architecture
Data representation  computer architectureData representation  computer architecture
Data representation computer architecture
 
Lecture 1& 2.pptx
Lecture 1& 2.pptxLecture 1& 2.pptx
Lecture 1& 2.pptx
 
Number system
Number system Number system
Number system
 
chapter one && two.pdf
chapter one && two.pdfchapter one && two.pdf
chapter one && two.pdf
 
New Computer Systems
New Computer SystemsNew Computer Systems
New Computer Systems
 
Computer Systems
Computer SystemsComputer Systems
Computer Systems
 
Learning&Teaching Systems Ppt
Learning&Teaching Systems PptLearning&Teaching Systems Ppt
Learning&Teaching Systems Ppt
 
Learning& Teaching Systems Ppt
Learning& Teaching  Systems PptLearning& Teaching  Systems Ppt
Learning& Teaching Systems Ppt
 
Learning&Teaching Systems Ppt
Learning&Teaching Systems PptLearning&Teaching Systems Ppt
Learning&Teaching Systems Ppt
 
ICT - Lecture Notes 4.pdf
ICT - Lecture Notes 4.pdfICT - Lecture Notes 4.pdf
ICT - Lecture Notes 4.pdf
 
DSD NOTES.pptx
DSD NOTES.pptxDSD NOTES.pptx
DSD NOTES.pptx
 

Recently uploaded

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Recently uploaded (20)

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

UNIT-I U20EST109 - PROBLEM SOLVING APPROACH - Copy (1).pptx

  • 1. SEMESTER: I Department of Information Technology Sri Manakula Vinayagar Engineering College
  • 2. INTRODUCTION (9 Hrs)  Computational Thinking - Information and Data - Converting Information into Data – Data Capacity – Data Types and Encoding – Logic-Solving Problems – Limits of Computation – Pseudo code and Flow Chart. 2 Department of IT, SMVEC
  • 3.  It represents a universally applicable attitude and skill set everyone, not just computer scientists, should be eager to learn and use. 3 Computational Thinking Department of IT, SMVEC
  • 4. Data  “The quantities, characters, or symbols on which operations are performed by computers and other automatic equipment, and which may be stored or transmitted in the form of electrical signals, records on magnetic tape or punched cards, etc.” 4 Information and Data Department of IT, SMVEC
  • 5. Information:  “Knowledge communicated concerning some particular fact, subject, or event; that of which one is apprised or told; intelligence, news” and adds that information is “that which is obtained by the processing of data.” Example: Your credit card number is information that is turned into data when it is stored on the back of your card. 5 Department of IT, SMVEC
  • 6.  There are two different types of data 1. Continuous 2. Discrete Data is continuous if there are an infinite number of possible values for an individual datum. Data is discrete if there are a finite number of possible values. 6 Converting Information into Data Department of IT, SMVEC
  • 7.  Consider measuring the weight of an orange. Although the orange could weigh exactly 200 grams, it might also weigh 229.3 grams or 229.31533 grams or even 229.31533480185993 grams. 7 Department of IT, SMVEC
  • 8.  Consider asking your friends how many biological parents they have who are still living. They may respond with the numbers 0 or 1 or 2. Since no person has more than 2 biological parents, numbers larger than 2 are not possible and it should be obvious that it is not possible to have a fractional number of living parents. 8 Department of IT, SMVEC
  • 9.  In electronics, a signal may be either analog or digital.  An analog signal is an encoding of continuous data, whereas a digital signal is an encoding of discrete data.  In digital systems, the smallest unit of data is known as a binary digit, or bit.  A bit can only take on one of two possible values: ON(1) or OFF(0) 9 Department of IT, SMVEC
  • 10.  Computing systems encode all information as a sequence of bits. Pictures, sound, textbooks, and video are encoded as long sequences of bits.  A sequence of bits is commonly referred to as a bit string. 10 Department of IT, SMVEC
  • 11.  00, 01, 10, 11 FIGURE 1.2: The four patterns that a string of two bits can exhibit are 00, 01, 10, and 11. 11 Department of IT, SMVEC
  • 12.  000, 001, 010, 011, 100, 101, 110, 111 FIGURE 1.3: There are eight patterns that a string of three bits can exhibit. 12 Department of IT, SMVEC
  • 14.  Data encoding requires us to know how many bits are required to store a piece of information.  When storing the symbols on a keyboard, for example, we must know how many bits would be required to store any one of the symbols.  Would it be possible to encode a keyboard symbol as a 3 bit string or a 4 bit string rather than an 8 bit string? 14 Data Capacity Department of IT, SMVEC
  • 15.  You are given a list of all keyboard symbols and you are also given a bit string of length three.  Your task is to generate a unique bit pattern for each of the symbols in your list.  You begin with the symbol “A” and decide to encode this symbol as 000.  As you move through the alphabet, you choose to encode “B” as 001, “C” as 010, “D” as 011, “E” as 100, “F” as 101, “G” as 110, and “H” as 111.  At this point you realize that there are no patterns left to encode the remaining symbols of the keyboard and hence a bit string of length three is not sufficient to encode one keyboard symbol 15 Department of IT, SMVEC
  • 16.  A byte is a bit string of length eight.  A single byte, therefore, is able to store 28 or 256 unique patterns.  One other measure of data capacity is known as a word (based on the hardware of a computing system, multiples of 8).  A word is a fixed-length sequence of bits that are processed as a single item by the processor. 16 Department of IT, SMVEC
  • 20.  Numbers (Numeral Systems, Positional Numeral System, Integers as Binary Bit Strings, Real Numbers as Binary Bit Strings, Precision as a Source of Error, Underflow and Overflow as Sources of Error)  Text  Colors  Pictures  Sound 20 Data Types and Encoding Department of IT, SMVEC
  • 21.  A numeral system is a way of representing numbers in written form.  Consider, for example, the three numbers shown in Figure 21 Department of IT, SMVEC
  • 23.  A positional numeral system must first specify a base, also known as the radix that describes how many digits exist in that particular system.  Any positive integer greater than one can be used as a base in a positional numeral system. 23 Department of IT, SMVEC
  • 25.  Consider the example of Figure 1.11 that shows how to interpret the decimal number 925. For this number we see that the digit 5 is at position 0, the digit 2 is at position 1 and the digit 9 is at position 2. The radix is assumed to be 10 and hence the positional terms will be integral powers of 10. We then understand that the digit 5 is a multiplier for 100, the digit 2 is a multiplier for the 101, and the digit 9 is a multiplier for 102. In other words, the number 925 is understood as (9 × 102) + (2 × 101) + (5 × 100) and since any positive integer that is raised to the 0th power is equal to 1 this reduces to (9 × 100) + (2 × 10) + (5 × 1). 25 Department of IT, SMVEC
  • 27.  Computing systems represent integer numbers as binary bit strings. 27 Department of IT, SMVEC
  • 28.  Although we can represent an integer as a sequence of bits, is it possible to represent a real number such as 2.31 or 2.125 or even 3.1415926?  For example, in base 10 the value 1.625 means (1 × 100) + (6 × 10–1) + (2 × 10–2) + (5 × 10–3).  We can then represent real numbers as binary bit strings assuming that we can determine the decimal location. 28 Department of IT, SMVEC
  • 29.  Consider, for example, the meaning of 1.1012. 29 Department of IT, SMVEC
  • 30.  One difficulty that arises when encoding real numbers is that there may be an arbitrary number of digits on the right side of the decimal value to represent even small numbers.  1/3 = 0.33333333333333333333333333  but soon realize that we will never be able to write as many digits as are required for a completely accurate representation  If a computer uses 16 bits to store real numbers, we say that the computer is precise up to 16 bits, or that the computer uses 16 bit precision. 30 Department of IT, SMVEC
  • 31.  Recall that an 8 bit binary string can only hold values between 0 and 255.  Add 1 to the value 255 and store the result as an 8 bit binary string. Of course the result should be 256 but since 256 cannot be encoded as an 8 bit binary string the result will either be an error of some sort or, on many computing systems 31 Department of IT, SMVEC
  • 32.  Underflow occurs when a computer instruction produces a value that is too small in magnitude (i.e., very close to zero) to be encoded by the number of bits available. 32 Department of IT, SMVEC
  • 33.  All data that is stored in a computing system is encoded as bit strings.  First, it is important to understand that a textual character, when drawn on either a page of text or on a computer screen, is really just a picture.  Textual characters are usually encoded as integer values using the encoding schemes discussed earlier in this chapter. 33 Department of IT, SMVEC
  • 35.  The human eye perceives color through three types of biological photo sensors known as cones.  Each cone is attuned to one of three wavelengths that correspond roughly to red, green, and blue light.  The individual responses of all cones combine to form the perception of a single color at a single point within the field of view.  The design of this biological system suggests that color is a three-dimensional entity. 35 Department of IT, SMVEC
  • 36.  The RGB color model is the most common way of representing color in image- processing systems. The RGB model uses red (R), green (G), and blue (B) as the primary colors such that any color can be created by combining different amounts of these three primaries. 36 Department of IT, SMVEC
  • 37.  The most common encoding of a digital image is that of a two-dimensional grid of colors.  Each element of the grid is known as a pixel and represents a very small rectangular region of the image that is comprised of a single color.  When the grid of pixels is viewed at an appropriate distance, the individual pixels recede from view while collectively appearing as a naturally colored and smooth image. 37 Department of IT, SMVEC
  • 38.  High-definition video uses individual images that have up to 1920 columns and 1080 rows of pixels for a total of 1920 × 1080 or 2,073,000 pixels. Since each of these pixels is encoded as a bit string of length 24, the image can be encoded as a bit string of length 1920 × 1080 × 24 or 49,766,400 bits.  Alternatively, using a byte as a measure of data capacity, the image can be encoded using 1920 × 1080 × 3 or 6,220,800 bytes or approximately 6 megabytes.  Digital cameras take images that use on the order of 10 megapixels and images of this resolution can be encoded as a string of 30 megabytes. 38 Department of IT, SMVEC
  • 40.  Digital audio is used almost exclusively today when recording, processing, and distributing sound.  Online music stores contain hundreds of thousands of hours of digital sound.  Sound is a physical phenomenon caused by waveforms that propagate through the air.  A microphone is used to transform the waveform into an analog electric signal after which the analog signal is sampled to produce a digital encoding.  Sampling is a process where the strength of a changing signal is measured at regular time intervals and those measurements are then recorded.  In this way, the sound wave is converted into a sequence of numeric values. 40 Department of IT, SMVEC
  • 41.  Frequency is the rate at which sound waves change and is measured in terms of the hertz.  The hertz is denoted as Hz and is defined as the number of cycles (or changes) per second.  Sound waves that change at a slow rate are perceived as a low pitch while sound waves that change at a high rate are perceived as higher in pitch.  The average person can hear sound waves 20 Hz up through about 20,000 Hz or 20 kHz. 41 Department of IT, SMVEC
  • 42.  Logic, in its broadest sense, deals with correct and incorrect ways to reason.  Logic provides a way to tell the difference between incorrect and correct thinking, and can therefore be defined as the science of correct thinking. Categories of logic : Inductive logic and deductive logic. 42 Logic Department of IT, SMVEC
  • 43.  Inductive logic is a type of reasoning that begins with a set of observations or experiences from which conclusions can be derived with some degree of certainty. 43 Department of IT, SMVEC
  • 44.  Consider a scenario where you have eaten brussels sprouts only twice in your life. Unfortunately, you became physically ill within hours of eating them and therefore conclude you are allergic to brussels sprouts. Although the conclusion that “I am allergic to brussels sprouts” is reasonable, It is not the only conclusion that could be reasonably reached and is therefore not certain. 44 Department of IT, SMVEC
  • 45.  Perhaps you were coincidently exposed to a contagious virus shortly before eating the brussels sprouts and this virus was the actual cause of your illness.  Conclusions reached in an inductive system are necessarily uncertain and are directly related to the number of experiences on which the conclusion is based. 45 Department of IT, SMVEC
  • 46.  For example, the certainty of the conclusion that “I am allergic to brussels sprouts” would be increased if you ate them three more times and became physically ill in each case. 46 Department of IT, SMVEC
  • 47.  By contrast, begins by assuming that certain things are absolutely true from which other facts must also be absolutely true. Any conclusions that are reached under deductive logic are absolutely, irrefutably, and certainly true if the assumptions are true.  A conclusion is a statement of truth that must logically flow from the premises. 47 Department of IT, SMVEC
  • 48.  syllogism as a logical argument that contained two premises and a true conclusion that must logically follow if the two premises are actually true. 48 Department of IT, SMVEC
  • 49.  Premise: Computational thinking is beneficial for all students.  Premise: Jemimah Farnsworth is a student.  Conclusion: Computational thinking is beneficial for Jemimah Farnsworth. 49 Department of IT, SMVEC
  • 50.  Symbolic logic is a modern extension of Aristotelian logic where symbols, rather than phrases drawn from human language, are used to represent statements of truth.  Logical operators, also known as logical connectives, are used to express logical thought.  Boolean logic is a symbolic logic system that was created by a mathematician named George Boole around 1850.  Modern computing systems rely heavily on the rules of Boolean logic for generating correct and reliable results. 50 Department of IT, SMVEC
  • 51.  Propositions form the basic units of Boolean logic.  A proposition is a statement that can be either true or false.  Stated another way, a proposition is a statement that has a value of either true or false. 51 Department of IT, SMVEC
  • 52. True statement: “Mount Everest is the tallest mountain in the world.” Answer: True False statement: “The Mississippi is the longest river in the world.” Answer: False Note: Nile is the longest river in the world 52 Department of IT, SMVEC
  • 53.  “How tall is Mount Everest?” No True or False 53 Department of IT, SMVEC
  • 54.  Propositions can be either simple or compound.  A simple proposition is one that cannot be broken into parts.  A compound proposition is formed by combining simple propositions with logical connectives, also known as logical operators.  There are four fundamental logical operators that are best described by the words and, or, implies, and not. 54 Department of IT, SMVEC
  • 55.  Simple: “I am hungry.”  Simple: “I am cold.”  Compound: “I am hungry and I am cold.” Abbreviated:  P = “I am hungry.”  Q = “I am cold.”  S = “Mount Everest is the tallest mountain in the world.” “I am hungry and I am cold” as P and Q 55 Department of IT, SMVEC
  • 56.  Propositions must be well formed (i.e., properly written) to have meaning.  When writing a proposition, certain rules must be exactly followed in order to construct a meaningful proposition.  If these rules are not followed you may write something that appears to be a proposition but is actually just a meaningless jumble of labels and operators. Department of IT, SMVEC 56
  • 57.  Rule 1 - Each of the following is a simple proposition. a. Any single letter b. True c. False Department of IT, SMVEC 57
  • 58.  Rule 2—Let a box (□) stand for a proposition (either simple or compound).  Assuming that each box is some proposition, then each of  the following are also propositions.  a. □ and □  b. □ or □  c. □ implies □  d. □ ≡ □  e. not □  f. (□) Department of IT, SMVEC 58
  • 60.  When we evaluate a proposition, the goal is not to make sure that it is well written but rather to determine the truth value of the proposition.  Consider, for example, the following simple propositions. P = “I am hungry.” Q = “I am cold.”  evaluate the truth value of the compound proposition. P and Q Department of IT, SMVEC 60
  • 61.  The truth value of the compound proposition “P and Q” depends upon the truth values of both P and Q. Scenario 1: I have just finished eating P and Q – False “I am hungry and I am cold” – False Scenario 2 : I am resting on the beach during a sizzling summer afternoon P and Q – False Department of IT, SMVEC 61
  • 62. Department of IT, SMVEC 62
  • 63.  For the binary operators there are only two inputs and since each of these two inputs has only two possible values there are only four situations that the operator must handle.  for example, the following definition of logical conjunction.  1. The logical conjunction of false with false is false.  2. The logical conjunction of false with true is false.  3. The logical conjunction of true with false is false.  4. The logical conjunction of true with true is true. Department of IT, SMVEC 63
  • 64. Department of IT, SMVEC 64
  • 65.  Logical disjunction, however, is not as intuitive since our informal use of the word or is not as closely connected to the way it is formally defined. Department of IT, SMVEC 65
  • 66.  Logical implication is perhaps the most challenging operator to master.  This operator captures the idea that if one thing is true, then some other thing must also, by logical necessity, be true. Department of IT, SMVEC 66
  • 67.  If the proposition “my car battery is dead” has a value of True, this implies that the proposition “my car won’t start” must also be true. In Boolean logic we would say that “My car battery is dead implies my car won’t start.” We might phrase this informally as “whenever my car battery is dead, my car won’t start.” Department of IT, SMVEC 67
  • 68.  In the proposition “P implies Q” we refer to P as the antecedent and Q as the consequent. Consider the following two simple propositions and their abbreviations.   P = “My car battery is dead.”  Q = “My car won’t start.” Department of IT, SMVEC 68
  • 69. 1. P is True and Q is True. Consider the situation where we observe that “my car battery is dead” and we also observe that “my car won’t start.”  In this scenario, we understand that “True implies True” 2. P is True and Q is False We now observe that the car will start (since Q is False) and that the car battery is dead. The proposition that “P implies Q” must therefore be false since this proposition is claiming that the car won’t start whenever the car battery is dead. In this scenario we understand that “P implies Q” is logically inconsistent with the observed facts. Therefore, “True implies False” has a value of False Department of IT, SMVEC 69
  • 70.  3.P is False and Q is True.  When the antecedent is false, there is no conclusion that can logically be drawn with respect to the consequent.  In this case, the statement that “P implies Q” has not been disproven and therefore has a value of True.  For example, the observation that “my car battery is not dead” and that “my car won’t start” does not contradict the statement that “whenever my car battery is dead my car won’t start.”  Perhaps the car won’t start for some reason unrelated to the car battery.  Since there is no logical contradiction between the observed situation and the statement that “My car battery is dead implies my car won’t start” we understand that “False implies True” is true. Department of IT, SMVEC 70
  • 71. 4.P is False and Q is False. Again, since the antecedent is False, we understand that “False implies False” is True. In this situation, we observe that “my car battery is not dead” and we also observe that “my car will start.” Department of IT, SMVEC 71
  • 72.  Variables P and Q are said to be equivalent if they have the same truth value. Truth table for logical equivalence Department of IT, SMVEC 72
  • 73.  Logical negation is the only unary operator. This operator expresses the obvious thought that if something is not true then it must be False, and if something is not False then it must be True. Department of IT, SMVEC 73
  • 74.  To evaluate propositions that involve more than one operator, we can apply the same process, but it must be applied once for every operator in the proposition. Department of IT, SMVEC 74
  • 75.  For the situation where P = True, Q = False, and R = True. 1. Parentheses are used to group the sub proposition “(Q or R).” For this reason, we first use the disjunction table to evaluate “(Q or R)” where Q = False and R = True. Q or R - True  Once we have evaluated “(Q or R)” to True we can replace that sub proposition by its value and continue our process of evaluation. We now have the proposition  P and True Department of IT, SMVEC 75
  • 76. for this situation where P = True, Q = True and R = False. There are two operators in this proposition and they should be evaluated from left to right. P and Q – True True implies R - False Department of IT, SMVEC 76
  • 77.  Q implies R (Parenthesis first)  P and False  Final Answer = False Department of IT, SMVEC 77
  • 78.  1. Make a list of each logical variable (abbreviation) that appears in the proposition. If one variable occurs more than once in the proposition, it should be included only once in your list.  2. Place a column in the truth table for every variable list your list. The column heading should be the variable itself.  3. For the heading of the last column you should write the entire proposition.  4. If there are N variables in your list, you must create 2N rows. Each row represents a unique combination of values for the N variables.  5. For each row, determine the value of the proposition and place that value in the last column. Department of IT, SMVEC 78
  • 79.  P and not (Q or R) Department of IT, SMVEC 79
  • 80. Department of IT, SMVEC 80
  • 81. Department of IT, SMVEC 81
  • 82.  Two propositions are said to be equivalent if they have the same truth table. Consider, for example, the two propositions  not (P and Q)  (not P) or (not Q)  When two propositions are equivalent, they have the same meaning and are therefore interchangeable. Department of IT, SMVEC 82
  • 83.  Any proposition that has a value of True regardless of the inputs is said to be a tautology.  Since a tautology is always True  Any proposition that has a value of False for all inputs is said to be a contradiction.  Contradiction can be understood as a statement that is always logically invalid no matter how you look at it. Department of IT, SMVEC 83
  • 84.  Tautologies and contradictions should be avoided when writing propositions and they should also be avoided in the normal course of human conversations since such statements do not express any sort of productive line of reasoning. The following propositions give examples of a tautology and a contradiction.  Tautology: P or not P  Contradiction: P and not P Department of IT, SMVEC 84
  • 85. 85 Pseudocode: English-language statements that describe the processing steps of a program in paragraph form. START READ EMPLOYEE DATA COMPUTE GROSS PAY COMPUTE DEDUCTIONS COMPUTE NET PAY WRITE EMPLOYEE PAYCHECK STOP Example
  • 86. 86 START STOP SYMBOLS NAME Terminal interrupt symbols USE Terminal point (start, stop, or break) Input/Output symbol Reading data from an input medium or writing data to an output medium Process symbol Processing input data
  • 87. 87 SYMBOLS NAME Flowline symbol USE Sequence of operations and direction of data flow Decision symbol Decision-making operations Predefined-process symbol Operations specified elsewhere (not in the current algorithm)
  • 88. 88 SYMBOLS NAME Connector symbol USE Exit to, or entry from, another part of the Flowchart Preparation symbol Control operations: Set limit on loop-control variables, Initialize accumulators, etc.
  • 89. Department of IT, SMVEC 89
  • 90.  Example: if "1" print response "I am case 1“ if "2" print response "I am case 2" Department of IT, SMVEC 90