Chapter 1
Chapter 1
Chapter 1
Computation
• Computer science is a practical discipline. Those who work in it often
have a marked preference for useful and tangible problems over
theoretical speculation. Theory provides concepts and principles that
help us understand the general nature of the discipline. The field of
computer science includes a wide range of special topics, from
machine design to programming. The use of computers in the real
world involves a wealth of specific detail that must be learned for a
successful application. This makes computer science a very diverse
and broad discipline.
• In this course, we will look at models that represent features at the
core of all computers and their applications. To model the hardware
of a computer, we introduce the notion of an automaton (plural,
automata).
• An automaton is a construct that possesses all the indispensable
features of a digital computer. It accepts input, produces output, may
have some temporary storage, and can make decisions in
transforming the input into the output. A formal language is an
abstraction of the general characteristics of programming languages.
A formal language consists of a set of symbols and some rules of
formation by which these symbols can be combined into entities
called sentences. We can learn a great deal about programming
languages from formal languages. In Section 1.1, we review the main
ideas from mathematics that will be required.
1.1 Mathematical Preliminaries and Notation
Sets
𝑆 = {0,1,2}
• The usual set operations are union (∪),intersection (∩),and
difference(-), defined as;
𝑆 ∪ 𝜙 = 𝑆 − 𝜙 = 𝑆,
𝑆 ∩ 𝜙 = 𝜙,
𝜙 = 𝑈,
𝑆=𝑆
• The following useful identities, known as the DeMorgan's laws,
𝑆1 ∪ 𝑆2 = 𝑆1 ∩ 𝑆2
𝑆1 ∩ 𝑆2 = 𝑆1 ∪ 𝑆2
are needed on several occasions.
• A given set normally has many subsets. The set of all subsets of a set
𝑆 is called the powerset of 𝑆 and is denoted by 2𝑆 . Observe that 2𝑆 is
a set of sets.
Example 1.1
• In many of our examples, the elements of a set are ordered
sequences of elements from other sets. Such sets are said to be the
Cartesian product of other sets. For the Cartesian product of two
sets, which itself is a set of ordered pairs, we write
𝑓: 𝑆1 ⟶ 𝑆2
𝑒𝑖 = (𝑣𝑗 , 𝑣𝑘 )
• The level associated with each vertex is the number of edges in the
path from the root to the vertex. The height of the tree is the
Iargestlevel number of any vertex. These terms are illustrated in
Figure 1.2.
Figure 1.2
1.2 Three Basic Concepts
𝑤 = 𝑎𝑏𝑎𝑎𝑎
to indicate that the string named w has the specific value abaaa.
Example 1.3
Example 1.4