Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
of
Computer
Science
SCSJ
3203
Lecturers
Details
Dr.
Zalmiyah
Zakaria
Email:
zalmiyah@utm.my
/
zalmiyah@gmail.com
Room:
N28A
L5-16-01
Tel:
07
5538814
References
Teaching
Module
for
tutorial
sessions
Books
Grading
No.
Assessment
Assignment
1
(Take
home
work)
Quizzes
2
(in-class
10-min
assessment)
Tutorials
3
(in-class
exercises
with
lecturers
supervision)
Number
% each
% total
10%
10
5%
10
4%
20
4 Mid-Term Test
25%
25
5 Final Exam
35%
35
Overall
Total
Sept2011
100
Theory of Computer Science
How
to
do
well
This
is
essenUally
a
math
course:
you
must
learn
the
concepts
well;
if
you
dont
theres
almost
no
chance
of
success
if
you
do
learn
the
concepts,
there
is
very
liele
else
(facts,
etc.)
to
learn;
you
can
do
really
well!
You
must
do
problems.
Theres
no
replacement
for
this.
Aeending
lectures
is
highly
advised!
It
will
be
very
hard
to
learn
the
concepts
by
yourself
or
from
textbook.
Important
Notes
No
programming
in
this
course
It
is
assumed
that
you
are
familiar
with:
programming
and
basic
algorithms
notaUon
big-oh
sets
Theory of Computer Science
10
Sept2011
11
12
Sets
Importance:
languages
are
sets
Sets
are
a
collecUon
of
well
dened
objects
E.g.
:
A
=
{set
all
items
in
kitchen}
=
{utensils,
stove,
spoons.....}
B
=
{set
all
natural
numbers}
=
{1,
2,
3,
...}
Sets
are
denoted
by
capital
leeers
-
A,
B,
C,
etc.
&
the
objects
by
small
leeers
-
a,
b,
c,
etc.
The
objects
called
the
elements
or
members
of
the
set.
Theory of Computer Science
13
Sets
Sets
can
be
nite
or
innite.
Finite
sets
are
sets
with
a
small
number
of
members
can
dened
explicitly;
that
is,
their
members
can
be
listed.
.
E.g.:
X
=
{1,
2,
3},
Y
=
{a,
b,
c,
d,
e}
An
innite
set
contains
innitely
many
elements.
Sets
having
a
large
nite
or
innite
number
of
members
must
be
dened
implicitly.
E.g.:
set
of
natural
numbers
=
N
=
{0,
1,
2,
3,
...},
set
of
integers
=
Z
=
{
...
,
-2,
-1,
0,
1,
2,
...
}.
Note:
".
.
.
means
"conUnue
the
sequence
forever".
Theory of Computer Science
14
Sets
There
are
two
common
ways
of
lisUng
the
members
of
a
set:
Explicitly
-
List
all
the
elements,
e.g.
{a,
e,
i,
o,
u}.
Implicitly
-
Provide
some
sort
of
an
algorithm
or
rule,
such
as
a
grammar,
e.g.
{set
of
vowel
leeers},
{
x
|
x
A
or
x
B
}.
Theory of Computer Science
15
Sets
NotaUon:
If
x
is
a
member
of
set
S,
we
write
x
S
We
denote
the
empty
set
(the
set
with
no
members)
as
{}
or
If
every
element
of
set
A
is
also
an
element
of
set
B,
we
say
that
A
is
a
subset
of
B
(A
B)
16
17
{1,
2}
=
Any
set
intersecUon
with
the
empty
set
yields
the
empty
set
18
Disjoint
sets
Two
sets
are
disjoint
if
they
have
no
elements
in
common,
that
is,
if
AB
=
.
E.g.:
The
set
of
the
even
numbers
and
the
set
of
the
odd
numbers
Formal
deniUon
for
disjoint
sets:
two
sets
are
disjoint
if
their
intersecUon
is
the
empty
set
Further
examples
{1,
2,
3}
and
{3,
4,
5}
are
not
disjoint
{Johor,
Melaka}
and
{3,
4}
are
disjoint
{1,
2}
and
are
disjoint
Their
intersecUon
is
the
empty
set
19
20
Complement
sets
The
complement
of
a
set
A,
wrieen
as
A
or
-A
or
(beeer)
A
with
a
bar
drawn
over
it,
is
the
set
containing
everything
that
is
not
in
A.
Formal
deniUon
for
the
complement
of
a
set:
=
{
x
|
x
A
}
Or
U
A,
where
U
is
the
universal
set
that
contains
"everything"
(meaning
"everything
we
are
interested
in
at
the
moment").
Then,
or
A
or
A
is
shorthand
for
U
-
A.
Further
examples:
{1,
2,
3}
=
{
,
-2,
-1,
0,
4,
5,
6,
}
Theory of Computer Science
22
Take 5..!
23
AddiUonal
terminology
The
cardinality
of
a
set
A,
wrieen
|A|,
is
the
number
of
elements
in
a
set
A.
The
powerset
of
a
set
A,
wrieen
P(A)
or
2A,
is
the
set
of
all
subsets
of
A.
The
notaUon
suggests
the
fact
that
a
set
containing
n
elements
has
a
powerset
containing
2n
elements,
including
empty
set.
Example:
2{a,b,c}
=
{,
{a},
{b},
{c},
{a,b},
{a,c},
{b,c},
{a,b,c}}
Note
that
the
empty
set
and
the
set
A
itself
are
in
As
power
set
Theory of Computer Science
24
25
{1,
2}
{red,
white}
=
{(1,
red),
(1,
white),
(2,
red),
(2,
white)}.
We
can
generalize
this
to
ordered
k-tuples:
A1
A2
Ak
=
{(a1,
a2,
,
ak
|
ai
Ai
for
each
i}
Theory of Computer Science
26