CSC102-Discrete Mathematics
LECTURE # 14
INVERSE OF A RELATION:
Let R be a relation from A to B. The inverse relation R-1 from B to A is defined
as:
R-1 = cfw_(b,a) BA | (a,b) R
More simply, the inverse relation R-1 of R is obtained by interchanging the e
Discrete Mathematics
LECTURE # 8
UNION:
Let A and B be subsets of a universal set U. The union of sets A and B is the set of
all elements in U that belong to A or to B or to both, and is denoted A B.
Symbolically:
A B = cfw_x U | x A or x B
EMAMPLE:
Let U
Discrete Mathematics
LECTURE
A well defined collection of cfw_distinctobjects is called a set.
The objects are called the elements or members of the set.
Sets are denoted by capital letters A, B, C , X, Y, Z.
The elements of a set are represented by lower
CSC102-Discrete Mathematics
LECTURE # 15
RELATIONS AND FUNCTIONS:
A function F from a set X to a set Y is a relation from X to Y that satisfies the following two
properties
1.For every element x in X, there is an element y in Y such that (x,y) F.
In other
CSC102-Discrete Mathematics
LECTURE # 12
REFLEXIVE RELATION:
Let R be a relation on a set A. R is reflexive if, and only if, for all a A,
(a, a) R. Or equivalently aRa.
That is, each element of A is related to itself.
REMARK
R is not reflexive iff there i
CSC102 Discrete Mathematics
LECTURE # 11
ORDERED PAIR:
An ordered pair (a, b) consists of two elements a and b in which a is the
element and b is the second element.
The ordered pairs (a, b) and (c, d) are equal if, and only if, a= c and b = d.
Note that
p
q
pq
p
q
T
T
T
T
T
T
F
F
T
F
F
T
T
F
T
F
F
T
F
F
Discrete Mathematics
LECTURE # 5
EXAMPLE
An interesting teacher keeps me awake. I stay awake in Discrete Mathematics class.
Therefore, my Discrete Mathematics teacher is interesting.
Is the above argument
Discrete Mathematics
LECTURE # 1
Course Objective:
1.Express statements with the precision of formal logic
2.Analyze arguments to test their validity
3.Apply the basic properties and operations related to sets
4.Apply to sets the basic properties and oper
Discrete Mathematics
LECTURE # 9
SET IDENTITIES:
Let A, B, C be subsets of a universal set U.
1.
Idempotent Laws
a.
AA=A
b.
AA=A
2.
Commutative Laws
a.
AB=BA
b.
AB=BA
3.
Associative Laws
a.
A (B C) = (A B) C
b.
A (B C) = (A B) C
4.
Distributive Laws
a.
A
CSC102-Discrete Mathematics
LECTURE # 13
EXERCISE:
Suppose R and S are binary relations on a set A.
a. If R and S are reflexive, is R S reflexive?
b. If R and S are symmetric, is R S symmetric?
c. If R and S are transitive, is R S transitive?
SOLUTION:
a.
Discrete Mathematics
LECTURE #3
APPLYING LAWS OF LOGIC
Given any statement variables p, q, and r , a tautology t and a contradiction c, the following
logical equivalences hold.
1. Commutative laws:
p q q p and
p q q p
2. Associative laws:
(p q) r p (q r)
p
~p
~(~p)
T
F
T
F
Discrete Mathematics
T
F
LECTURE #2
Truth Tables for:
1.
~pq
2.
~ p (q ~ r)
3.
(pq) ~ (pq)
Truth table for the statement form ~ p q
p
q
~p
T
T
F
~p
q
F
T
F
F
F
F
T
T
T
F
F
T
F
Truth table for ~ p (q ~ r)
Truth table for (pq) ~ (pq)
p
q
Discrete Mathematics
LECTURE # 4
BICONDITIONAL
If p and q are statement variables, the biconditional of p and q is
p if, and only if, q and is denoted pq. if and only if abbreviated iff.
The double headed arrow " " is the biconditional operator.
TRUTH TAB
Interacting with computers has been my passion ever since I was a young kid. I
was initially drawn to them because I fancied computer games. However, the more
I operated with computers, the more I began to understand how they work,
discovering just how mu
Apology letter
Dear Mrs. Fischer,
I am writing to apologize for passing notes in class.
I realize that you were discussing important concepts that are going to help
us write our upcoming analysis essays and do well on the final, and I
should have been pay
Object Passing
1. Create a class Distance with two constructors (no argument, and two argument),
two data members ( feet and inches) . Create setter, getter and display method. Create
a function that adds two Distance Objects and returns the added Distanc
Lab Task 2
Constructor Overloading
1. Create an Encapsulated class circle class with radius as data member. Create two
constructors and a function to calculate Circumference.
2. Create an Encapsulated class Rectangle with length and width as data members.
Lab Task 6
Static Class Data and Static Member Function
1.
Create a SavingsAccount class. Use a static data member annualInterestRate to store the
annual interest rate for each of the savers. Each member of the class contains a private data
member savings
Lab 1 Tasks
1.
2. Two numbers are entered through keyboard. Write a program to find
the value of one number raised to the power of another.
3. Write a program to find the factorial of a number entered by
user.
4. Write a program that reads in 5 numbers an
Declarative
A declarative sentence (also known as a statement) makes a statement and ends with a
period. It's named appropriately because it declares or states something.
There are five million people at risk.
London is the capital of England.
I am no win
CHAPTER
16
EVENT-DRIVEN
PROGRAMMING
Objectives
To get a taste of event-driven programming (16.1).
To describe events, event sources, and event classes (16.2).
To define listener classes, register listener objects with the source object,
and write the code
CHAPTER
8
OBJECTS AND CLASSES
Objectives
To describe objects and classes, and use classes to model objects (8.2).
To use UML graphical notation to describe classes and objects (8.2).
To demonstrate how to define classes and create objects (8.3).
To create
CHAPTER
12
GUI BASICS
Objectives
To distinguish between Swing and AWT (12.2).
To describe the Java GUI API hierarchy (12.3).
To create user interfaces using frames, panels, and simple GUI
components (12.4).
To understand the role of layout managers and us
CHAPTER
9
STRINGS
Objectives
To use the String class to process fixed strings (9.2).
To construct strings (9.2.1).
To understand that strings are immutable and to create an interned
string (9.2.2).
To compare strings (9.2.3).
To get string length and char
CHAPTER
17
GUI COMPONENTS
Objectives
To create graphical user interfaces with various user-interface
components (17.217.8).
To create listeners for JCheckBox, JRadioButton, and JTextField
(17.2).
To enter multiple-line texts using JTextArea (17.3).
To sel
CHAPTER
15
ABSTRACT CLASSES
AND INTERFACES
Objectives
To design and use abstract classes (15.2).
To generalize numeric wrapper classes, BigInteger, and BigDecimal
using the abstract Number class (15.3).
To process a calendar using the Calendar and Gregori
Object Oriented Programming and Concepts
CSC-244
Week-02
1
Saba Anwar, CIIT Lahore
February 26, 2015
Java: an object oriented language
In java a program is build up using objects. Object belong
to classes.
Class contains
Data
Methods
In next slides we wil
Object Oriented Programming and Concepts
CSC-244
Week-11
1
Saba Anwar, CIIT Lahore
May 7, 2015
Swing Components
2
Saba Anwar, CIIT Lahore
May 7, 2015
Swing Components
Components can be of two types:
Basic Controls:
Atomic components like
Containers:
3
But
Object Oriented Programming and Concepts
CSC-244
Week-11
1
Saba Anwar, CIIT Lahore
April 27, 2015
User Interfaces
Command Line Interfaces
(CLI)
2
A command line interface
(CLI) enables users to type
commands in a terminal or
console window to interact
wit