E1) CLDS Documentation D1-D10
E1) CLDS Documentation D1-D10
IT : CLDS Roll No : 57
PRACTICAL NO 1
SETS THEORY
-->B=[3,4,5]
B =
3. 4. 5.
-->C=[5,6]
C =
5. 6.
-->IEP(A,B,C)
the no of element in AorBorC means A umion B union C is 6
-->A=[1,2,3,4]
A =
1. 2. 3. 4.
->B=[3,4]
B =
3. 4.
-->IEP(A,B)
the no of element in AorB means A union B is 4
F.Y.Bsc.IT : CLDS Roll No : 57
Q.3 let no of student studying German, French, English, both German and French,
both French and English, both German and English, all three languages are
45,40,50,12,14,16,4 respectively find the number of students studying at least one of
the subjects.
-->function[]=IEP(G,F,E,GF,FE,GE,GFE)
--> x=G+F+E-GF-FE-GE+GFE
--> printf("the no of student whose studying at least one subject is %d",x)
-->endfunction
-->IEP(45,40,50,12,14,16,4)
the no of student whose studying at least one subject is 97
F.Y.Bsc.IT : CLDS Roll No : 57
B)POWER SETS
Q.1 let set A={1,2,5,4,5,6} find the number of elements in the power set A.
-->function[]=ps(A)
--> a=length(A)
--> x=2^a
--> printf("the number of elements in the power set is %d",x)
-->endfunction
-->A=[1,2,3,4,5,6]
A =
1. 2. 3. 4. 5. 6.
-->ps(A)
the number of elements in the power set is 64
F.Y.Bsc.IT : CLDS Roll No : 57
PRACTICAL NO 2
FUNCTION AND ALGORITHM
A) RECURSIVE DEFINE FUNCTION
B) CARDINALITY OF SETS
C) POLYNOMIAL EVOLUSION
--> function[]=pe(a,b,c)
--> disc=b^2-4*a*c
--> if(disc<0)
--> printf("the roots are not real and complex")
--> else
--> x1=(-b+sqrt(disc))/2*a
--> x2=(-b-sqrt(disc))/2*a
--> printf("the roots of given equation are %f and %f",x1,x2)
--> end
--> endfunction
--> pe(1,2,1)
the roots of given equation are -1.000000 and -1.000000
--> pe(1,2,2)
the roots are not real and complex
F.Y.Bsc.IT : CLDS Roll No : 57
PRACTICAL NO 5
COUNTING ONE
C) FACTORIAL
D) BIONOMIAL COEFFICIENT
PRACTICAL NO 6
COUNTING TWO
A) PERMUTATION
Q.1 In how many ways we can write the word “mississippi” with repetition of
character.
--> function[]=permu(y,z,d,f,h)
--> n=factorial(y)
--> a=factorial(z)
--> b=factorial(d)
--> e=factorial(f)
--> c=factorial(h)
--> x=n/(a*b*e*c)
--> printf("we can arrange the character in mississippi word in %d different ways.",x)
--> endfunction
--> permu(11,1,4,4,2)
we can arrange the character in mississippi word in 34650 different ways.
F.Y.Bsc.IT : CLDS Roll No : 57
C) COMBINATION
Q.1 There are 8 different ice creamflavour in the ice cream shop so how many ways
can we choose 5 flavour out of this 8 flavour
--> function[]=comb(s,y)
--> n=factorial(s+y-1)
--> a=factorial(y)
--> b=factorial((s+y-1)-y)
--> x=n/(a*b)
--> printf("in %d different ways we can group the 5 flavour of ice cream out of 8.",x)
--> endfunction
--> comb(8,5)
in 792 different ways we can group the 5 flavour of ice cream out of 8.
F.Y.Bsc.IT : CLDS Roll No : 57
PRACTICAL NO 10
RECURRENCE RELATIONS