Chapter 4.2 Counting
Read: 4.2
Next Class: 4.3
Motivation
1
Section 3.2
We have already seen that different sets can have different
numbers of elements. Even infinite sets can have different
complexities.
Counting of the number of elements in a set (or co
Chapter 4.1 Sets
Read: 4.1
Next Class: 4.2
Set theory
1
Section 3.1
Sets: Powerful tool in computer science to solve real world
problems.
A set is a collection of distinct objects called elements.
Traditionally, sets are represented by capital letters, an
Chapter 4.3 Principles of Inclusion
and Exclusion
Read: 4.3
Next Class: 4.4
Principle of Inclusion & Exclusion
1
If A and B are subsets of universal set S, then (A-B), (B-A) and
(A B) are disjoint sets.
As seen from the figure, (A-B) (B-A) (A B) is the sa
Permutation and Combinations
Read: 4.4
Next Class: 4.6
Motivations
1
Section 3.4
Different counting principles (multiplication and addition)
provide a basis to calculate the number of possible outcomes or
equivalently the size of a set constructed using b
Probability
Read: 4.6
Next Class: 5.1
Introduction to Finite Probability
1
If some action can produce Y different outcomes and X of those
Y outcomes are of special interest, we may want to know how
likely it is that one of the X outcomes will occur.
For e
5.1 Relations
Read: 5.1
Next Class: 5.2
Motivation
1
Section 4.1
Given different sets, it is important to be able to
manipulate different elements and to be able to relate them
to each other.
Operations present transformations from elements of a set
to ot
Topological Sorting
Reading: 5.2
Next Class: 5.4
Example: Topological Sorting
1
Ernie and his brothers run a woodworking shop in the hills of
New Hampshire that manufactures rocking chairs with padded
cushion seats. The manufacturing process can be broken
Chapter 5.4 Functions
Reading: 5.4
Next Class: 5.5
Motivation
1
Section 4.4
Different types of relations allow different techniques to be
applied efciently.
Partial orderings permit to represent any ordered set or general
sets with precedence constraints.
Chapter 5.4 & 5.5 Functions (contd)
Reading: 5.5
Next Class: 5.7
Motivations
1
Section 4.4
Functions can be used to characterize important aspects of
problems.
A number of problems can be recast as problems regarding
functions making it important to be ab
Experiment-4
Experiment 4
To perform event handling and GUI programming
Program 1
Aim:Write a program to find the Area of a circle through default
constructor, parameterized constructor and by modifying the radius
value at main method.
Code:
importjavax.s
OBJECT ORIENTED PROGRAMMING WITH JAVA
EXPRIMENT - 3(1)
AIM: Write a program to check an object is an instance a
particular class or not.
import java.io.*;
class Parent
cfw_
public Parent()
cfw_
class Child extends Parent
cfw_
public Child()
cfw_
super()
Advance Processor (150701)
Experiment No: 3
Aim: Write a program to perform Addition, Subtraction and Multiplication for
two BCD numbers
ADDITION
Program:
Instructions
Status
Comments
MOV AL,08H
AL=08H
MOV BL,06H
BL=06H
ADD AL,BL
AL=0E
Put immediate
08H t
AdvancedProcessor(150701)
Experiment No: 9
Aim: WAP to transfer block of String from one location to another
Transfer Block Of String
Program:
Instructions
Status
.MODEL SMALL
.DATA
Str db WELCOME
Dest db 10dup(0)
.CODE
Mov ax,@data
ax=data
Mov ds,ax
ds=a
Advance Processor (150701)
Experiment No:- 9
Aim: Write a program to transfer a block of string from one location to
another.
INSTRUCTIONS
STATUS
COMMENTS
TRANSFER BLOCK OF STRING
.Model small
Small type model.
.Data
Data segment start.
STR1 dw Example
ST
Experiment-2
Experiment 2
To perform Objects and Classes programs
Program 1
Aim: Write a program to find the Area of a circle through default
constructor, parameterized constructor and by modifying the radius
value at main method.
Code:
public class TestS
Advance Processor (150701)
EXPRIMENT - 7
AIM: Write a program to find largest number from given array.
INSTRUCTIONS
STATUS
COMMENTS
LARGEST FROM GIVEN ARRAY
.Model small
.Data
arr db 10h,13h,7h,2h,15h
count dw 04h
Data segment start.
ARR=10h,13h,7h,2h,15h
Advance Processor (150701)
INSTRUCTIONS
STATUS
COMMENTS
ADDITION OF TWO 32b NUMBERS
.Model small
.Data
Data segment start.
a dd 1234f678H;
a=1234f678H
b dd 03451111H;
b=03451111H
ans dd ?;
ans = ?
.Code
1234f678H is store in
variable a.
03451111H is store
Advance Processor (150701)
Experiment No:- 8
Aim: Write a program to sort n numbers in ascending order.
INSTRUCTIONS
STATUS
COMMENTS
SORT N NUMBER IN ASCENDING
.Model small
.Data
Arr db10h,30h,20h,40h,50h
count dw 04h
Data segment start.
ARR=10h,30h,20h,
Experiment 1
To perform Java basic programs
Program 1
Aim: Program to print Hello Java
Code:
import java.*;
public class H
cfw_
public static void main(String args[])
cfw_
System.out.println("Hello Java");
Output:
Name: DEEPAN PANCHOLI | Enrolment No.:
Chapter 5.7 Matrices
Read: 5.7
Next Class: 6.1
Motivations
1
Section 4.6
Arrays are very common data structures to store sorted
data in an efficient way which allows easy access to
individual elements.
Arrays can also represent a wide variety of problems