Roll no.: 2100320120167 Name: Srajal Dixit Page no.
Practical No. – 1
Objective: Write a program in C to find the Union of two sets A and B i.e., A U B.
Theory: The union of two sets is a set containing all elements that are in A or in B (possibly
both). For example, {1,2}∪{2,3}={1,2,3}.
Source Code:
#include<stdio.h>
void main(){
int a[10],b[10],c[10],flag,n;
printf("Enter the length of Array: );
scanf("%d",&n);
printf("Enter the first Array: ");
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}
printf("Enter the second Array: ");
for (int i=0;i<n;i++){
scanf("%d",&b[i]);
} int k=0;
for(int i=0;i<n;i++){
c[i]=a[i];
k++;
}
for(int i=0;i<n;i++){
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 2
flag=0;
for(int j=0;j<n;j++){
if(b[i]==c[j]){
flag=1;
break;
}
}
if(flag==0)
{
c[k]=b[i];
k++;
}
}
for(int i=0;i<k;i++)
{
printf("%d ",c[i]);
}
}
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 3
Output:
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 4
Practical No. – 2
Objective: Write a program in C to find the Intersection of two sets A and B i.e., A U B.
Theory: The intersection of two or more given sets is the set of elements that are common to
each of the given sets. The intersection of sets is denoted by the symbol '∩'.
Source Code:
#include<stdio.h>
void main()
{
int ar[10],br[10],cr[10];
int n;
printf("Enter the length of array: ");
scanf("%d",&n);
printf("Enter array elements of 1st array: ");
for(int i=0;i<n;i++)
{
scanf("%d",&ar[i]);
}
printf("Enter array elements of 2nd array: ");
for(int i=0;i<n;i++)
{
scanf("%d",&br[i]);
}
int k=0;
for(int i=0;i<n;i++)
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 5
{
for(int j=0;j<n;j++)
{
if(ar[j]==br[i]){
cr[k]=ar[j];
++k;
}
}
}
printf("The intersection of array is : ");
for(int i=0;i<k;i++)
{
printf("%d ",cr[i]);
}
}
Output:
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 6
Practical No. – 3
Objective: Write a program in C to find the Difference of two sets A and B i.e., A -B.
Theory: The difference of the sets A and B in this order is the set of elements which belong to A
but not to B. The set A−B consists of elements that are in A but not in B. For example, if
A={1,2,3} and B={3,5}, then A−B={1,2}.
Source Code:
#include<stdio.h>
int main()
{
int ar[20],br[20],cr[20];
int n,m; int k=0; int flag;
printf("Enter the length of 1st array: ");
scanf("%d",&n);
printf("Enter the length of 2nd array: ");
scanf("%d",&m);
printf("Enter array elements of 1st array: ");
for(int i=0;i<n;i++)
{
scanf("%d",&ar[i]);
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 7
}
printf("Enter array elements of 2nd array: ");
for(int i=0;i<m;i++)
{
scanf("%d",&br[i]);
}
for(int i=0;i<n;i++)
{ flag=0;
for(int j=0;j<m;j++)
{
if(ar[i]==br[j])
{
flag=1;
}
} if(flag==0)
{
cr[k]=ar[i];k++;
}
}
printf("The A-B of array is : \n");
for(int i=0;i<k;i++)
{
printf("%d ",cr[i]);
}
return 0;
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 8
Output:
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 9
Practical No. – 4
Objective: Write a program in C to find the symmetric difference of two sets A and B i.e A Δ B
Theory:
The symmetric difference between two sets is also called as disjunctive union. Symmetric difference
between two sets is a set of elements that are in both sets but not in their intersection. The
symmetric difference between two sets A and B is represented by A Δ B
Example:- Set A = {1, 2, 3, 4, 5}
Set B = {3, 5}
So, the symmetric difference between the given sets A and B is A Δ B = {1, 2, 4}
Source Code:
#include <stdio.h> void main()
int n1,n2,i,j,k=0,f;
int A[10],B[10],S[10];
printf("Enter number of elements in set A : "); scanf("%d",&n1);
printf("Enter the elements \n"); for(i=0;i<n1;i++)
scanf("%d",&A[i]);
printf("Enter number of elements in set B : ");
scanf("%d",&n2);
printf("Enter the elements \n"); for(j=0;j<n2;j++)
scanf("%d",&B[j]);
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 10
for(i=0;i<n1;i++)
{ f=0;
for(j=0;j<n2;j++)
if(A[i]==B[j])
f=1;
break;
if(f==0)
S[k]=A[i]; k++;
for(i=0;i<n2;i++)
{ f=0;
for(j=0;j<n1;j++)
if(B[i]==A[j])
f=1;
break;
if(f==0)
S[k]=B[i]; k++;
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 11
printf("The Symmetric Difference of sets is :"); for(i=0;i<k;i++)
printf("%d ",S[i]);
Output:
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 12
Practical No. – 5
Objective: Write a program in C to find the Complement of sets A i.e A’.
Theory:
If universal set (U) is having a subset A then the complement of set A which is represented as
A', is other than the elements of set A which includes the elements of the universal set but not
the elements of set A.
Here, A' = {x ∈ U : x ∉ A}.
In other words, the complement of a set A is the difference between the universal set and set
A.
Source Code:
#include<stdio.h>
int main()
{
int a[10],b[10],c[20],i,j,m,n,k=0,flag=0;
printf("enter the no of elements in universal set:");
scanf("%d",&m);
printf("enter the elements of universal set :");
for(i=0;i<m;i++)
{
scanf("%d",&a[i]);
}
printf("Universal set U is: ");
for(i=0;i<m;i++)
{
printf("%d ",a[i]);
}
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 13
printf("\n");
printf("enter the no of elements in set A:");
scanf("%d",&n);
printf("enter the elements of set A:");
for(i=0;i<n;i++)
{
scanf("%d",&b[i]);
}
printf("Set A is: ");
for(i=0;i<n;i++)
{
printf("%d ",b[i]);
}
for(i=0;i<m;i++)
{
flag=0;
for(j=0;j<n;j++)
{
if(a[i]==b[j])
flag=1;
}if(flag==0){
c[k]=a[i];
k++;
}
}
printf("\n");
printf("Complement of A is:");
for(i=0;i<k;i++)
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 14
{
printf("%d ", c[i]);
}
return 0;
}
Output:
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 15
Practical No. – 6
Objective: Write a program in C to find the power set of set.
Theory:
A power set is defined as the set or group of all subsets for any given set, including the empty
set, which is denoted by {}, or, ϕ.
Let us find the power set of set A.
Set A = {1,2,3}
Subsets of set A = {}, {1}, {2}, {3}, {1,2}, {2,3}, {1,3}, {1,2,3}
Power set P(A) = { {}, {1}, {2}, {3}, {1,2}, {2,3}, {1,3}, {1,2,3} }
Source Code:
#include<stdio.h>
#include<math.h>
int main()
{
int set[50],set_size,i,j,c;
int power_set;
printf("Enter set_size:");
scanf("%d",&set_size);
printf("Enter the elements:");
for(i=0;i<set_size;i++)
{
scanf("%d",&set[i]);
}
power_set=pow(2,set_size);
printf("power set are:");
for(i=0;i<1;i++)
{
printf("{}");
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 16
}
for(c=0;c<power_set;c++)
{
for(j=0;j<set_size;j++)
{
if( c & (1<<j))
printf("%d",set[j]);
}
printf("\n");
}
return 0;
}
Output:
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 17
Practical No. – 7
Objective: Write a program in C to find the Cartesian product of set.
Theory: A cartesian product of two non-empty sets A and B is the set of all possible
ordered pairs where the first component of the pair is from A, and the second
component of the pair is from B. The set of ordered pairs thus obtained is denoted by
A×B.
A × B = {(a, b) : a ∈ A and b ∈ B}
Example:
Let A = {1, 2} and B = {4, 5, 6}
A × B = {(1, 4), (1, 5), (1, 6), (2, 4), (2, 5), (2, 6)}
Source Code:
#include<stdio.h>
#include<math.h>
int main()
{
int set[50],set_size,i,j,c;
int power_set;
printf("Enter set_size:");
scanf("%d",&set_size);
printf("Enter the elements:");
for(i=0;i<set_size;i++)
{
scanf("%d",&set[i]);
}
power_set=pow(2,set_size);
printf("power set are:");
for(i=0;i<1;i++)
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 18
{
printf("{}");
}
for(c=0;c<power_set;c++)
{
for(j=0;j<set_size;j++)
{
if( c & (1<<j))
printf("%d",set[j]);
}
printf("\n");
}
return 0;
}
Output:
Practical No. – 8
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 19
Objective: Write a program in c to find the truth table of different gates.
Theory:
OR Gate: The function of a logical OR gate efficiently finds the maximum between two
binary digits,
Y=A+B
AND Gate: AND gate is a digital device which produces high output only when all inputs are
high and produces low output at all other inputs conditions.
Y=A.B
NOT Gate: A logic gate which performs the function of logical operator NOT is called as NOT
gate. Some of the function of NOT gate are as follow: It performs a basic logic function
called inversion or complementation.
Y=A’
NAND Gate: It is a combination of an AND gate and NOT gate. If we connect the output of
AND gate to the input of a NOT gate, the gate so obtained is known as NAND gate.
Y= (A.B)’
Source Code:
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 20
#include<stdio.h>
#include<stdlib.h>
int find_OR(int x,int y)
if(x==1 && y==1)
return 1;
if(x==1 && y==0 || x==0 && y==1)
return 1;
if(x==0 && y==0)
return 0;
int find_AND(int x,int y)
if(x==1 && y==1)
return 1;
if(x==1 && y==0)
return 1;
if(x==0 && y==1)
return 0;
else
return 0;
}
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 21
int find_NOT(int x)
if(x==1)
return 0;
else
return 1;
int find_NAND(int x, int y)
if(x==1 && y==1)
return 0;
if(x==1 && y==0)
return 1;
if(x==0 && y==1)
return 1;
else
return 1;
int main()
int ch,a,b;
printf("1. OR\n");
printf("2. AND\n");
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 22
printf("3. NOT\n");
printf("4. NAND\n");
printf("5 .exit\n");
while(1)
printf("\nEnter your choice\n");
scanf("%d",&ch);
switch(ch)
case 1: printf("Give two input 1 for true and 0 for false\n");
scanf("%d%d",&a,&b);
printf("%d",find_OR(a,b));
break;
case 2: printf("Give two input 1 for true and 0 for false\n");
scanf("%d%d",&a,&b);
printf("%d",find_AND(a,b));
break;
case 3: printf("Give an input 1 for true and 0 for false\n");
scanf("%d",&a);
printf("%d",find_NOT(a));
break;
case 4: printf("Give an input 1 for true and 0 for false\n");
scanf("%d%d",&a, &b);
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 23
printf("%d",find_NAND(a,b));
case 5: exit(0);
default: printf("Wrong key\n");
Output:
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 24
Practical No. – 9
Objective: Write a program in C to check the given set is equivalence or not.
Theory: An equivalence relation is a kind of binary relation that should be reflexive,
symmetric and transitive. The equivalence relation is a relationship on the set which is generally
represented by the symbol “∼”.
Reflexive: A relation is said to be reflexive, if (a, a) ∈ R, for every a ∈ A.
Symmetric: A relation is said to be symmetric, if (a, b) ∈ R, then (b, a) ∈ R.
Transitive: A relation is said to be transitive if (a, b) ∈ R and (b, c) ∈ R, then (a, c) ∈ R.
Source Code:
#include<stdio.h>
void main()
{
int n,a[100],b[100][100],r=0,s=0,t=0;
printf("Enter no of elements");
scanf("%d",&n);
printf("Enter elements of Set");
for(int x=0;x<n;x++)
{
scanf("%d",&a[x]);
}
printf("Enter values of matrix\n");
for(int x=0;x<n;x++)
{
for(int y=0;y<n;y++)
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 25
{
printf("Enter value at position %d,%d",(x+1),(y+1));
scanf("%d",&b[x][y]);
}
}
for(int x=0;x<n;x++)
{
if(b[x][x]==1)
{
r++;
}
}
if(r!=n)
{
printf("Not equivalence");
exit(0);
}
for(int x=0;x<n;x++)
{
for(int y=0;y<n;y++)
{
if(b[x][y]!=b[y][x])
{
s++;
break;
}
if(b[x][y]==b[y][x])
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 26
{
if(b[x][x]!=1)
{
t++;
break;
}
}
}
}
if(s>0|| t>0)
{
printf("Not equivalence");
exit(0);
}
else
{
printf("Equivalence");
}
}
Output:
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 27
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 28
Practical No. – 10
Objective: Write a program in C to check whether the given set relation is partial order relation
or not.
Theory: : A relation R on a set A is called a partial order relation if it satisfies the following three
properties: Relation R is Reflexive, i.e. aRa ∀ a∈A. Relation R is Antisymmetric, i.e., aRb and bRa
⟹ a = b. Relation R is transitive, i.e., aRb and bRc ⟹ aRc.
Source Code:
#include<stdio.h>
int main()
int r[20][20],a[20],i,j,k,relation,n,count=0,flag=0;
printf("Enter the no. of elements of set A:");
scanf("%d",&n);
printf("Enter the elements of set A:");
for(i=0;i<n;i++)
scanf("%d",&a[i]);
printf("Enter the relation in form of Matrix:\n");
for(i=0;i<n;i++)
for(j=0;j<n;j++)
scanf("%d",&r[i][j]);
}
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 29
printf("\n\n");
printf("The relation is:\n");
for(i=0;i<n;i++)
for(j=0;j<n;j++)
printf("%d ",r[i][j]);
printf("\n");
for(i=0;i<n;i++)
for(j=0;j<n;j++)
if(r[i][i]==1)
count++;
if(count==n)
{ flag=1; }
if(r[i][j]==1 && r[j][i]==1 || r[i][i]==1)
flag=2;
if(r[i][j]==1)
flag=3;
}
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 30
if(flag==3)
printf("\n\nThe Given relation is partial order relation!");
else {
printf("The given relation is not partial order relation");
return 0;
Output:
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 31
Practical No. – 11
Objective: Write a program in C to Prove DE Morgan’s Theorem.
Theory:
De Morgan’s First Law states that the complement of the union of two sets is the intersection
of their complements. Whereas
De Morgan’s second law states that the complement of the intersection of two sets is the
union of their complements
Source Code:
#include<stdio.h> void demorgans1()
{
int a[50],ac[50],bc[50],l=0,m=0,b[50],c[50],k=0,na,nb,i,j,nu,u[50],f=0,in[50],n=0,aub[50],y=0,co
unt=0;
printf("Enter the number of elements of set A:"); scanf("%d",&na);
printf("Enter the elements of A:");
for(i=0;i<na;i++)
{
scanf("%d",&a[i]);
}
printf("Enter the number of elements of set B:"); scanf("%d",&nb);
printf("Enter the elements of B:");
for(i=0;i<na;i++)
{
scanf("%d",&b[i]);
}
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 32
//AUB for(i=0;i<na;i++)
{
c[k]=a[i]; k++;
}
for(i=0;i<nb;i++){ f=0;
for(j=0;j<na;j++){
if(b[i]==c[j])
{
f=1;
break;
}
}
if(f==0){
c[k]=b[i];
k++;
}
}
printf("AUB is:\n"); for(i=0;i<k;i++)
{
printf("%d ",c[i]);
}
printf("\n");
//A'
printf("Enter the number of elements of universal set:"); scanf("%d",&nu);
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 33
printf("Enter the elements of universal set:"); for(i=0;i<nu;i++)
{
scanf("%d",&u[i]);
}
for(i=0;i<nu;i++){
for(j=0;j<na;j++)
{
if(a[j]==u[i]){
break;
}
if(j==na){
ac[l]=u[i]; l++;
}
printf("The compliment of set A is:\n"); for(i=0;i<l;i++){
printf("%d ",ac[i]);
}
for(i=0;i<nu;i++){
for(j=0;j<nb;j++){
if(b[j]==u[i]){
break;
}
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 34
}
if(j==nb){
bc[m]=u[i];
m++;
}
}
printf("\n");
printf("The compliment set of B is:\n"); for(i=0;i<m;i++){
printf("%d ",bc[i]);
}
//A' INTERSECTION B'
for(i=0;i<l;i++){
for(j=0;j<m;j++){
if(ac[i]==bc[j]){
in[n]=ac[i]; n++;
break;
}
}
}
printf("\n");
printf("A' INTERSECTION B' is:\n"); for(i=0;i<n;i++){
printf("%d ",in[i]);
}
//(AUB)'
for(i=0;i<nu;i++){
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 35
for(j=0;j<k;j++){
if(c[j]==u[i]){
break;
}
}
if(j==k){
aub[y]=u[i];
y++;
}
}
printf("\n\n");
printf("(AUB)':"); for(i=0;i<y;i++){
printf("%d ",aub[i]);
}
for(i=0;i<n;i++){
for(j=0;j<y;j++){
if(in[i]==aub[j]){
count++; break;
}
}
}
printf("\n\n");
if(count==n){
printf("verified!!!");
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 36
}
else{
printf("no");
}
}
void demorgans2(){
int
a[50],ac[50],bc[50],l=0,m=0,b[50],c[50],k=0,na,nb,i,j,nu,u[50],f=0,un[50],n=0,aub[50],y=0,co
unt=0;
printf("Enter the number of elements of set A:"); scanf("%d",&na);
printf("Enter the elements of A:");
for(i=0;i<na;i++)
{
scanf("%d",&a[i]);
}
printf("Enter the number of elements of set B:"); scanf("%d",&nb);
printf("Enter the elements of B:"); for(i=0;i<na;i++)
{
scanf("%d",&b[i]);
}
//(A intersection B) for(i=0;i<na;i++)
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 37
{
for(j=0;j<nb;j++)
{
if(a[i]==b[j])
{
c[k]=a[i]; k++;
break;
}
}
}
printf("Enter the number of elements of universal set:"); scanf("%d",&nu);
printf("Enter the elements of universal set:"); for(i=0;i<nu;i++)
{
scanf("%d",&u[i]);
}
//(A intersection B)'
printf("The compliment of (A intersection B) is:\n"); for(i=0;i<nu;i++){
for(j=0;j<k;j++){
if(c[j]==u[i]){break;
}
}
if(j==k){ aub[f]=u[i]; f++;
}
}
for(i=0;i<f;i++){
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 38
printf("%d\t",aub[i]);
}
printf("\n\n");
//A' for(i=0;i<nu;i++){
for(j=0;j<na;j++){
if(a[j]==u[i]){
break;
}
}
if(j==na){ ac[l]=u[i]; l++;
}
}
printf("Compliment of set A:"); for(i=0;i<l;i++){
printf("%d ",ac[i]);
}
printf("\n");
//B' for(i=0;i<nu;i++){
for(j=0;j<nb;j++){
if(b[j]==u[i]){
break;
}
}
if(j==nb){ bc[m]=u[i]; m++;
}
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 39
printf("Compliment of set B:"); for(i=0;i<m;i++){
printf("%d ",bc[i]);
}
// A' U B'
for(i=0;i<l;i++)
{
un[n]=ac[i]; n++;
}
for(i=0;i<m;i++)
{ f=0;
for(j=0;j<l;j++)
{
if(bc[i]==un[j])
{ f=1;
break;
}
}
if(f==0)
{
un[n]=bc[i]; n++;
}
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 40
}
printf("\n\n");
printf("The A'U B' is:\n"); for(i=0;i<n;i++)
{
printf("%d\t",un[i]);
for(i=0;i<n;i++){
for(j=0;j<f;j++){
if(un[i]==aub[j]){
count++;
break;
}
}
printf("\n\n"); if(count==n || count==f){
printf("verified!!!");
}
else{
printf("no");
}
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 41
}
int main()
{
int ch;
printf("[Link] 1 for (AUB)' = (A'INTERSECTION B')\n"); printf("[Link] 2 for (A INTERSECTION B)'
= (A'U B')\n"); printf("Select the operation:");
scanf("%d",&ch); switch(ch){
case 1:
demorgans1(); break;
case 2:
demorgans2(); break;
default:
printf("Enter correct choice!!!");
}
return 0;
}
Output:
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 42
Practical No. – 12
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 43
Objective: Introduction to Maple and working of computation software (Working of
Computation software).
Theory:
Starting Maple
Documents versus Worksheets
A Maple Document can be thought of like a document in a word processing program. You can
type text, change the font, insert images, and use other typical word processing tasks. But you
also have a powerful mathematical engine at your fingertips.
A Maple Worksheet is more focused on executing Maple commands. When you start a Maple
Worksheet, you immediately see a command prompt. The goal of this manual is to help you
explore and learn discrete mathematics, so the execution of Maple commands is the focus. For
this reason, you should generally use a Worksheet rather than a Document. So go ahead and
click on "Start with Blank Worksheet" now.
Maple Commands:-
>S1 := {a,b,c,d};
>S2 := {c,d,e,f,g};
>S1 ∩ S2; >S1 U S2;
>S1\{a};
>S1\S2;
>S2 U {x};
>S3 := {};
>S1 ⊆ S2;
>{a} ⊆ S1;
>evalb(c ∈ S2);
>evalb(m ∉ S2);
Write a maple script to identify that the 2 digit no. is positive, negative or zero.
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 44
Practical No. – 13
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 45
Objective: To Perform Set Operations using Maple Software.
Theory:
Union:- The union of A and B is equal to the set that contains all the elements present in set A
and set B.
Intersection:- The intersection of A and B is the subset of universal set U, which consist of
elements common to both A and B.
Set Difference:- The difference of two sets A and B is equal to the set which consists of
elements present in A but not in B.
Subset:- Set A is said to be a subset of Set B if all the elements of Set A are also present in Set
B. In other words, set A is contained inside Set B. it is denoted by the symbol ⊆.
Evaluate B:- It is a Boolean function which returns True or False. It simply checks whether the
value belongs to the given set or not. It is denoted by ‘evalb’.
Source Code:
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 46
Practical No. – 14
Objective: To Perform Factorial of a given number using maple software
Theory:
Factorial- The factorial of a whole number is the function that multiplies the number by every
natural number below it.
Ex.: 5! can be written as: 5! = 5 × 4 × 3 × 2 × 1 = 120.
Source Code:
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 47
Practical No. – 15
Objective: To Perform Fibonacci series using maple software
Theory:
The Fibonacci sequence is a set of integers (the Fibonacci numbers) that starts with a zero,
followed by a one, then by another one, and then by a series of steadily increasing numbers.
The sequence follows the rule that each number is equal to the sum of the preceding two
numbers.
The Fibonacci sequence begins with the following 14 integers:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233 ...
Roll no.: 2100320120167 Name: Srajal Dixit Page no. 48
Source Code: