Beruflich Dokumente
Kultur Dokumente
my
Chapter Summary
http://fskik.upsi.edu.my
Propositional Logic
Summary
The Language of Propositions
Connectives
Truth Values
Truth Tables
Applications
Translating English Sentences
System Specifications
Logic Puzzles
Logic Circuits
Logical Equivalences
Important Equivalences
Showing Equivalence
Satisfiability
http://fskik.upsi.edu.my
Propositional Logic
Section 1.1
http://fskik.upsi.edu.my
Section Summary
Propositions
Connectives
Negation
Conjunction
Disjunction
Implication; contrapositive, inverse,
converse
Biconditional
Truth Tables
http://fskik.upsi.edu.my
Computer science:
to design computer circuits.
to construct computer programs.
to verify the correctness of programs.
http://fskik.upsi.edu.my
Logic
Logic is a study of reasoning.
Logic examines general forms which
arguments may take, which forms are
valid, and which are fallacies.
Axiomatic concepts in math:
Equals
Opposite
Truth and falsehood
Statement
Objects
Collections
http://fskik.upsi.edu.my
Logic
We intuitively know that Truth and
Falsehood are opposites. That statements
describe the world and can be true/false.
That the world is made up of objects and
that objects can be organized to form
collections.
Propositions
To avoid painful head-aches, we ban
such silly non-sense and avoid the
most general type of statements
limiting ourselves to statements with
valid truth-values instead.
Propositions
Basic building blocks of logic.
Propositions a statement / declarative
sentence (sentence that declares a fact)
which is either TRUE or FALSE, but not
BOTH. It may also change according to
certain circumstances (ex: Today is Friday).
Atomic proposition a statement with
none values (statements without first
having to determine the truth or falsity of
other propositions)
http://fskik.upsi.edu.my
Propositions
Examples of propositions:
a) The Moon is made of green cheese.
b) Trenton is the capital of New Jersey.
c) Melaka is the capital of Malaysia.
d) 1+0=1
e) 0+0=2
Examples that are not propositions.
a) Sit down!
b) What time is it?
c) x+1=2
d) x+y=z
http://fskik.upsi.edu.my
Propositions
The value of a proposition is called TRUTH
VALUE (T/1, F/O).
p q p q
p p 1 1 T T
1 0 T F
1 orT or
0 F 0 1 F T
0 0 F F
Propositions - Opinions
Opinions:
http://fskik.upsi.edu.my
Propositions Interrogative
Statement
Interrogative statement:
- who, whom, whose, what, when, where,
why, which, how.
- Question tag: doesnt he?
1. Do you love me?
2. Who used my computer?
3. Which color that suits me best?
4. She loves chatting, doesnt she?
5. You didnt abuse drugs, did you?
http://fskik.upsi.edu.my
Propositions Imperative
Sentence
Imperative sentence:
http://fskik.upsi.edu.my
Propositions Examples
Examples:
1.2 + 3 = 5.
2.4 * 4 = 8.
3.Perak is the capital of Malaysia.
4.There are 12 months a year.
http://fskik.upsi.edu.my
Propositions Examples
Answers:
1. 2 + 3 = 5. (True)
2. 4 * 4 = 8.
(False)
3. Perak is the capital of Malaysia.
(False)
4. There are 12 months a year. (True)
http://fskik.upsi.edu.my
Propositions Exercise 1
Consider the following sentences:
Propositions Exercise 1
Consider the following sentences:
Propositions Exercise 1
Answers:
Questions 1 3
Not propositions because it is not a declarative sentences. It is a
question.
Questions 4 6
Not propositions because it is not a declarative sentences. It is an order.
Question 7
Not propositions because it is not a declarative sentences. It is a
statement (either True, False, or Both).
Questions 8 9
Not propositions because it is neither True or False. No initial value for
x, y and z.
http://fskik.upsi.edu.my
Propositions Exercise 2
Friday is the day after Thursday.
It is raining.
The grass is green.
The sun orbits the earth.
Please close the windows.
I am happy.
10 < 15.
x + 7 = 10 where x = 3.
http://fskik.upsi.edu.my
Propositional Logic/Variables
(Statement Variables)
Variables that represent atomic
propositions such as p, q, r, s, .
Propositional Logic/Variables
(Statement Variables)
Propositional logic (propositional calculas) is
a static discipline of statements which lack
semantic content.
the study of how simple propositions can
come together to make more complicated
propositions.
Propositional Logic/Variables
(Statement Variables)
Constructing Propositions
Propositional Variables: p, q, r, s,
The proposition that is always true is denoted by T
and the proposition that is always false is denoted
by F.
Compound Propositions; constructed from logical
connectives and other propositions
Negation
Conjunction
Disjunction
Implication
Biconditional
Exclusive OR
http://fskik.upsi.edu.my
Logical
Connectives/Operators
Connectives or operators are used
to create a compound proposition from
two or more other propositions.
Negation.
Conjunction/logical conjunction/and.
Disjunction/logical disjunction/or.
Exclusive or/XOR.
Implication/imply.
Biconditional.
http://fskik.upsi.edu.my
Logical
Connectives/Operators
Operator Symbol Usage
Negation not
Conjunction and
Disjunction or
Exclusive or xor
Conditional if,then
Biconditional if
http://fskik.upsi.edu.my
Example
Example 1:
Compound Propositions
Compound propositions
Compound Propositions -
Example
p = Ferry only sails on sea.
q = Ferry sails in Penang Island.
r = Penang Island is a sea.
r = Penang Island is not a sea.
p q = Ferry only sails on sea and sails
in Penang Island.
p q r = If ferry only sails on sea and
sails in Penang Island, then the Penang
Island is a sea.
http://fskik.upsi.edu.my
Compound Propositions:
Negation
A proposition can be negated.
Negation just turns a false proposition to true and
vice versa.
Example:
p = 23 = 15 +7
Compound Propositions:
Negation
The negation of a proposition p is denoted
by p and has this truth table:
p p
T F
F T
Compound Propositions:
Negation
Negation is a unary operator (the only
non-trivial one possible).
Logical operators are defined by truth
tables.
tables which give the output of the operator
in the right-most column.
p p p p
1 0 T F
0 1
orF T
http://fskik.upsi.edu.my
Compound Propositions:
Negation
Exercise:
p = Today is Monday.
Find p.
Compound Propositions:
Negation
Exercise:
Compound Propositions:
Negation
Answers:
Compound Propositions:
Negation
Find the negation of the proposition
i. Michaels PC runs Linux and
express this in simple English.
Conjunction
Conjunction is a binary operator in that it
operates on two propositions when creating
compound proposition.
Conjunction
For p and q to be true, it must be
the case that BOTH p is true, as well
as q.
Conjunction
Example:
Conjunction
The conjunction of propositions p and q is
denoted by p q and has this truth table:
p q pq
T T T
T F F
F T F
F F F
Conjunction
p q pq p q pq
1 1 1 T T T
1 0 0 T F F
0 1 0 F T F
0 0 0 F F F
http://fskik.upsi.edu.my
Conjunction - Exercise
Exercise:
p = Today is Monday.
q = Tomorrow is Friday.
r = 3 + 5 = 8
Disjunction
Conversely, disjunction is true when
at least one of the components is
true.
The disjunction of propositions p and
q is denoted by p q.
Example: If p denotes I am at
home. and q denotes It is raining.
then p q denotes I am at home or it
is raining.
http://fskik.upsi.edu.my
Disjunction
p q pq p Q pq
1 1 1 T T T
1 0 1 T F T
0 1 1 F T T
0 0 0 F F F
http://fskik.upsi.edu.my
Disjunction - Example
Example:
Students who have taken discrete or
computer science can take this class.
- Take both (T T = T).
- Take discrete (T F = T).
- Take computer science (F T = T).
- Not taken (F F = F).
http://fskik.upsi.edu.my
Disjunction - Exercise
Find the conjunction of the
propositions p and q where p is
proposition Rebeccas PC has more
than 16 GB free hard disk space and
q is proposition The processor in
Rebeccas PC runs faster than 1
GHz.
http://fskik.upsi.edu.my
T F T
F T T
F F F
http://fskik.upsi.edu.my
Disjunction : Caveat
Note: English version of disjunction
or does not always satisfy the
assumption that one of p/q being true
implies that p or q is true.
Disjunction : Caveat
A: The entre is served with
soup or salad.
Exclusive Or (XOR)
XOR of two propositions is true when exactly
one of its propositions is true and the other
one is false.
Example:
Exclusive Or (XOR)
p q P q p q P q
1 1 0 T T F
1 0 1 T F T
0 1 1 F T T
0 0 0 F F F
Note:
In this course any usage of or will connote the
logical operator as opposed to the exclusive-or.
http://fskik.upsi.edu.my
Exclusive Or (XOR) -
Example
Example:
Exclusive Or (XOR) -
Example
Rebeccas PC has more than 16 GB
free hard disk space or the
processor in Rebeccas PC runs faster
than 1 GHz
http://fskik.upsi.edu.my
Conditional (Implication)
The proposition that is false when p is
true and q is false and true otherwise.
p = hypothesis/antecedent/premise
q = conclusion/ consequence.
Conditional (Implication)
This one is probably the least intuitive. Its
only partly akin to the English usage of
if,then or implies.
Semantics: p implies q is true if one can
mathematically derive q from p.
Example:
1.If it rains, the grass gets wet.
2.If the sprinklers operate, the grass gets wet.
3.If you buy your air ticket in advance, then it
is cheaper.
http://fskik.upsi.edu.my
Conditional (Implication)
In p q there does not need to be any connection between
the antecedent or the consequent. The meaning of p q
depends only on the truth values of p and q.
These implications are perfectly fine, but
would not be used in ordinary English.
If the moon is made of green cheese, then I have
more money than Bill Gates.
If the moon is made of green cheese then Im on
welfare.
If 1 + 1 = 3, then your grandma wears combat
boots.
http://fskik.upsi.edu.my
Conditional (Implication)
The implication p q can be
equivalently read as:
if p then q
p implies q
if p, q
p only if q
q if p
q when p
http://fskik.upsi.edu.my
Conditional (Implication)
The implication p q can be
equivalently read as:
q whenever p
p is a sufficient condition for q
q is a necessary condition for p
q follows from p
http://fskik.upsi.edu.my
Conditional (Implication)
Some of the ways reverse the order of p
and q but have the same connotation:
Conditional (Implication)
p q P q p q P q
T T T
1 1 1
1 0 0 T F F
0 1 1 F T T
0 0 1 F F T
http://fskik.upsi.edu.my
Conditional (Implication)
Example 1:
Conditional (Implication)
Example 2:
Conditional (Implication)
One way to view the logical conditional is to
think of an obligation or contract.
If I am elected, then I will lower taxes.
If you get 100% on the final, then you will
get an A.
Conditional (Implication)
Exercise:
3. If sin x = 0, then x = 0.
http://fskik.upsi.edu.my
Conditional (Implication)
Answers:
Question 1 2:
Conditional (Implication)
Answers:
Question 3:
Why F F is True?
Remember, all of these are mathematical
constructs, not attempts to mimic English.
Mathematically, p should imply q
whenever it is possible to derive q by from
p by using valid arguments.
For example consider the mathematical
analog of no. 4:
If 0 = 1 then 3 = 9.
Q: Is this true mathematically?
http://fskik.upsi.edu.my
Why F F is True?
A: YES mathematically and YES by the
truth table.
Why F F is True?
A: YES mathematically and YES by the
truth table.
Why F F is True?
As we want the conditional to make
sense in the semantic context of
mathematics, we better define it as
we have!
Biconditional
If p and q are propositions, then we can form the
biconditional proposition p q , read as p if and only if
q . The biconditional p q denotes the proposition with
this truth table:
p q p q
T T T
T F F
F T F
F F T
Biconditional
For p q to be true, p and q must have
the same truth value.
Else, p q is false:
p q P q p q P q
1 1 1 T T T
1 0 0 T F F
0 1 0 F T F
0 0 1 F F T
http://fskik.upsi.edu.my
p q pq q p P q
1 1 1 1 1
1 0 0 1 0
0 1 1 0 0
0 0 1 1 1
http://fskik.upsi.edu.my
Biconditional
Some common or alternative ways p if
and only if q is expressed in English:
p if and only if q
p is necessary and sufficient for q
if p then q, and conversely
p iff q
http://fskik.upsi.edu.my
Biconditional
Example:
Biconditional
Examples:
Biconditional
Exercises:
3. x 0 if and only if x 0.
http://fskik.upsi.edu.my
Biconditional
Answers:
Questions 1 -2
True: Both implications hold.
Question 3
False: The converse holds. That is if x 0
then x 0. However the implication is
false; consider x = -1. Then the hypothesis
is true, 1 0 but the conclusion fails.
http://fskik.upsi.edu.my
Biconditional
Q : Which operator is the opposite of?
A : has exactly the opposite truth table as .
p q r r pq pq
r
T T T F T F
T T F T T T
T F T F T F
T F F T T T
F T T F T F
F T F T T T
F F T F F T
F F F T F T
http://fskik.upsi.edu.my
((p q) q)
0
http://fskik.upsi.edu.my
1 1
1 0
0 1
0 0
http://fskik.upsi.edu.my
1 1 1
1 0 0
0 1 0
0 0 0
http://fskik.upsi.edu.my
1 1 1 0
1 0 0 1
0 1 0 0
0 0 0 1
http://fskik.upsi.edu.my
1 1 1 0 1
1 0 0 1 1
0 1 0 0 0
0 0 0 1 1
http://fskik.upsi.edu.my
Equivalent Propositions
Two propositions are equivalent if they
always have the same truth value.
Example: Show using a truth table
that the biconditional is equivalent to
the contrapositive.
p q p q p q q
Solution: p
T T F F T T
T F F T F F
F T T F T T
F F T T T T
http://fskik.upsi.edu.my
Problem
How many rows are there in a truth table
with n propositional variables?
Precedence of Logical
Operators
Operator Precedence
1
2
3
4
5
p q r is equivalent to (p q)
r
If the intended meaning is p (q r )
then parentheses must be used.
http://fskik.upsi.edu.my
Applications of
Propositional Logic
Section 1.2
http://fskik.upsi.edu.my
Applications of Propositional
Logic: Summary
Translating English to Propositional
Logic
System Specifications
Boolean Searching
Logic Puzzles
Logic Circuits
AI Diagnosis Method (Optional)
http://fskik.upsi.edu.my
Translating English
Sentences
Steps to convert an English sentence to
a statement in propositional logic
Identify atomic propositions and represent
using propositional variables.
Determine appropriate logical connectives
If I go to Harrys or to the country, I will
not go shopping.
p: I go to Harrys
If p or q then not r.
q: I go to the country.
r: I will go shopping.
http://fskik.upsi.edu.my
Example
Problem: Translate the following sentence
into propositional logic:
You can access the Internet from campus
only if you are a computer science major or
you are not a freshman.
One Solution: Let a, c, and f represent
respectively You can access the internet
from campus, You are a computer science
major, and You are a freshman.
a (c f )
http://fskik.upsi.edu.my
System Specifications
System and Software engineers take
requirements in English and express them in a
precise specification language based on logic.
Example: Express in propositional logic:
The automated reply cannot be sent when the
file system is full
Solution: One possible solution: Let p denote
The automated reply can be sent and q
denote The file system is full.
q p
http://fskik.upsi.edu.my
Consistent System
Specifications
Definition: A list of propositions is consistent
if it is possible to assign truth values to the
proposition variables so that each proposition
is true.
Exercise: Are these specifications
consistent?
The diagnostic message is stored in the bufer or it is retransmitted.
The diagnostic message is not stored in the bufer.
If the diagnostic message is stored in the bufer, then it is retransmitted.
Solution: Let p denote The diagnostic message is not stored in the
bufer. Let q denote The diagnostic message is retransmitted The
specification can be written as: p q, p q, p. When p is false and q
is true all three statements are true. So the specification is consistent.
What if The diagnostic message is not retransmitted is added.
Solution: Now we are adding q and there is no satisfying assignment. So
the specification is not consistent.
http://fskik.upsi.edu.my
Logic Puzzles
An island has two kinds of inhabitants, knights, who always
tell the truth, and knaves, who always lie.
You go to the island and meet A and B. Raymond
Smullyan
A says B is a knight.
(Born
B says The two of us are of opposite types. 1919)
Example: What are the types of A and B?
Solution: Let p and q be the statements that A is a knight
and B is a knight, respectively. So, then p represents the
proposition that A is a knave and q that B is a knave.
If A is a knight, then p is true. Since knights tell the truth, q
must also be true. Then (p q) ( p q) would have to be
true, but it is not. So, A is not a knight and therefore p must be
true.
If A is a knave, then B must not be a knight since knaves always
lie. So, then both p and q hold since both are knaves.
Logic Circuits
http://fskik.upsi.edu.my
The inverter (NOT gate)takes an input bit and produces the negation of that bit.
The OR gate takes two input bits and produces the value equivalent to the
disjunction of the two bits.
The AND gate takes two input bits and produces the value equivalent to the
conjunction of the two bits.
More complicated digital circuits can be constructed by combining these
basic circuits to produce the desired output given the input signals by
building a circuit for each piece of the output expression and then
combining them. For example:
http://fskik.upsi.edu.my
Diagnosis of Faults in an
Electrical System (Optional)
AI Example (from Artificial Intelligence:
Foundations of Computational Agents by
David Poole and Alan Mackworth, 2010)
Need to represent in propositional logic the
features of a piece of machinery or circuitry
that are required for the operation to
produce observable features. This is called
the Knowledge Base (KB).
We also have observations representing
the features that the system is exhibiting
now.
http://fskik.upsi.edu.my
l2
http://fskik.upsi.edu.my
Observations (opt)
Observations need to be added to
the KB
Both Switches up
up_s1
up_s2
Both lights are dark
lit_l1
lit_l2
http://fskik.upsi.edu.my
Diagnosis (opt)
We assume that the components are working ok, unless
we are forced to assume otherwise. These atoms are
called assumables.
The assumables (ok_cb1, ok_s1, ok_s2, ok_s3, ok_l1,
ok_l2) represent the assumption that we assume that the
switches, lights, and circuit breakers are ok.
If the system is working correctly (all assumables are
true), the observations and the knowledge base are
consistent (i.e., satisfiable).
The augmented knowledge base is clearly not consistent
if the assumables are all true. The switches are both up,
but the lights are not lit. Some of the assumables must
then be false. This is the basis for the method to
diagnose possible faults in the system.
A diagnosis is a minimal set of assumables which must
be false to explain the observations of the system.
http://fskik.upsi.edu.my
Propositional Equivalences
Section 1.3
http://fskik.upsi.edu.my
Section Summary
Tautologies, Contradictions, and
Contingencies.
Logical Equivalence
Important Logical Equivalences
Showing Logical Equivalence
Normal Forms (optional, covered in
exercises in text)
Disjunctive Normal Form
Conjunctive Normal Form
Propositional Satisfiability
Sudoku Example
http://fskik.upsi.edu.my
Tautologies, Contradictions,
and Contingencies
P p p p p p
T F T F
F T T F
http://fskik.upsi.edu.my
Logically Equivalent
p q p p q p q
T T F T T
T F F F F
F T T T T
F F T T T
http://fskik.upsi.edu.my
Logically Equivalent
Exercises:
Are (p r) v (q r ) and (p q) r logically equivalent? Prove it using
truth table.
p q r pr q (p r) v (q pq (p q)
r r) r
1
1
1
1
0
0
0
0
http://fskik.upsi.edu.my
p q r pr q r (p r) v (q pq (p q)
r) r
1 1
1 1
1 0
1 0
0 1
0 1
0 0
0 0
http://fskik.upsi.edu.my
p q r pr q r (p r) v (q pq (p q)
r) r
1 1 1 1
1 1 0 0
1 0 1 1
1 0 0 0
0 1 1 1
0 1 0 1
0 0 1 1
0 0 0 1
http://fskik.upsi.edu.my
p q r pr q r (p r) v (q pq (p q)
r) r
1 1 1 1 1
1 1 0 0 0
1 0 1 1 1
1 0 0 0 1
0 1 1 1 1
0 1 0 1 0
0 0 1 1 1
0 0 0 1 1
http://fskik.upsi.edu.my
p q r pr q r (p r) v (q pq (p q)
r) r
1 1 1 1 1 1
1 1 0 0 0 0
1 0 1 1 1 1
1 0 0 0 1 1
0 1 1 1 1 1
0 1 0 1 1 1
0 0 1 1 1 1
0 0 0 1 1 1
http://fskik.upsi.edu.my
p q r pr q r (p r) v (q pq (p q)
r) r
1 1 1 1 1 1 1
1 1 0 0 0 0 1
1 0 1 1 1 1 0
1 0 0 0 1 1 0
0 1 1 1 1 1 0
0 1 0 1 1 1 0
0 0 1 1 1 1 0
0 0 0 1 1 1 0
http://fskik.upsi.edu.my
p q r pr q r (p r) v (q pq (p q)
r) r
1 1 1 1 1 1 1 1
1 1 0 0 0 0 1 0
1 0 1 1 1 1 0 1
1 0 0 0 1 1 0 1
0 1 1 1 1 1 0 1
0 1 0 1 1 1 0 1
0 0 1 1 1 1 0 1
0 0 0 1 1 1 0 1
http://fskik.upsi.edu.my
Logically Equivalent
Exercises:
Show that (p q) q is a tautology? Prove it using truth table.
p q pq (p q) q
1 1 1 1
1 0 0 1
0 1 0 1
0 0 0 1
http://fskik.upsi.edu.my
De Morgans Laws
Augustus De Morgan
1806-1871
Domination Laws: ,
Idempotent laws: ,
Negation Laws: ,
http://fskik.upsi.edu.my
Equivalence Proofs
Example: Show that
is logically equivalent to
Solution:
http://fskik.upsi.edu.my
Equivalence Proofs
Example: Show that
is a tautology.
Solution:
http://fskik.upsi.edu.my
Equivalence Proofs
Show that
( p q ) p and
q
( p ( p q ))
Show that p and
q
are logically equivalence.
http://fskik.upsi.edu.my
No
Disjunctive Normal Form is important for the
circuit design methods discussed in Chapter
12.
http://fskik.upsi.edu.my
(optional)
A compound proposition is in Conjunctive Normal
Form (CNF) if it is a conjunction of disjunctions.
Every proposition can be put in an equivalent CNF.
Conjunctive Normal Form (CNF) can be obtained by
eliminating implications, moving negation inwards
and using the distributive and associative laws.
Important in resolution theorem proving used in
artificial Intelligence (AI).
A compound proposition can be put in conjunctive
normal form through repeated application of the
logical equivalences covered earlier.
http://fskik.upsi.edu.my
Solution:
1. Eliminate implication signs:
Propositional Satisfiability
A compound proposition is satisfiable
if there is an assignment of truth
values to its variables that make it
true. When no such assignments
exist, the compound proposition is
unsatisfiable.
A compound proposition is
unsatisfiable if and only if its negation
is a tautology.
http://fskik.upsi.edu.my
Questions on Propositional
Satisfiability
Example: Determine the satisfiability of the
following compound propositions:
Notation
Sudoku
A Sudoku puzzle is represented by a 99
grid made up of nine 33 subgrids, known
as blocks. Some of the 81 cells of the
puzzle are assigned one of the numbers
1,2, , 9.
The puzzle is solved by assigning numbers
to each blank cell so that every row,
column and block contains each of the
nine possible numbers.
Example
http://fskik.upsi.edu.my
Encoding as a Satisfiability
Problem
Let p(i,j,n) denote the proposition
that is true when the number n is in
the cell in the ith row and the jth
column.
There are 99 9 = 729 such
propositions.
In the sample puzzle p(5,1,6) is true,
but p(5,j,6) is false for j = 2,3,9
http://fskik.upsi.edu.my
Encoding (cont)
For each cell with a given value, assert
p(d,j,n), when the cell in row i and column
j has the given value.
Assert that every row contains every
number.
Encoding (cont)
Assert that each of the 3 x 3 blocks
contain every number.
Solving Satisfiability
Problems
To solve a Sudoku puzzle, we need to find an
assignment of truth values to the 729 variables
of the form p(i,j,n) that makes the conjunction
of the assertions true. Those variables that are
assigned T yield a solution to the puzzle.
A truth table can always be used to determine
the satisfiability of a compound proposition. But
this is too complex even for modern computers
for large problems.
There has been much work on developing
efficient methods for solving satisfiability
problems as many practical problems can be
translated into satisfiability problems.
http://fskik.upsi.edu.my
Bit Strings
Electronic computers achieve their
calculations inside semiconducting
materials.
Bit Strings
In logic, only two truth values are
allowed. Thus propositional logic is
ideal for modeling computers.
Bit Strings
Thus voltage memory stored in a
computer can be represented by a
sequence of 0s and 1s such as:
01 1011 0010 1001
Another portion of the memory might
look like as follows:
10 0010 1111 1001
Each of the number in the sequence is
called a bit, and the whole sequence of
bits is called a bit string.
http://fskik.upsi.edu.my
Bit Strings
It turns out that the analogs of the logical
operations can be carried out quite easily
inside the computer, one bit at a time.
This can then be transferred to whole bit
strings.
Example, the exclusive-or of the previous bit
strings is: