Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1220
PRACTICAL NO. 41
Question:
Prime 2
Input:
disp('the prime factorisation of 21,24 and 1729 respectively are:')
k=factor(21)
l=factor(24)
n=factor(1729)
disp(k)
disp(l)
disp(n)
OUTPUT:
the prime factorisation of 21,24 and 1729 respectively are:
3. 7.
2. 2. 2. 3.
7. 13. 19.
RAJESH LANDE ROLL NO. 1220
PRACTICAL NO. 42
Question:
Fundamental theorem of arithmetic
Input:
a=2^4*3^3*7*11*13
b=2^3*3^2*5^2*11*17
V=int32([a,b]);
[d]=gcd(V)
lcm1=2^4*3^3*5^2*7*11*13*17
OUTPUT:
1.838D+08
RAJESH LANDE ROLL NO. 1220
PRACTICAL NO. 43
Question:
Congruence relation
Input:
x=poly(0,'x');
g=3*x^2-7*x+5
m=horner(g,2)
n=horner(g,8)
j=m-n
disp(n,'for n=')
if(modulo(j,6)==0) then
end
OUTPUT:
for n=
141.
3 is congruent to 141(mod 6)
RAJESH LANDE ROLL NO. 1220
PRACTICAL NO. 44
Question:
Linear congruence equation
Input:
disp('solving for the congruence equation 8x @ 12(mod 28),where @ is the sign
for congruence')
a=8;
b=12;m=28;
V=int32([a,m]);
d=gcd(V);
a1=a/d;
b1=b/d;
m1=m/d;
disp(a1,b1,m1)
OUTPUT:
solving for the congruence equation 8x @ 12(mod 28),where @ is the sign for
congruence
2
RAJESH LANDE ROLL NO. 1220
PRACTICAL NO. 45
Question:
Linear congruence equation
Input:
disp('solving for the congruence equation 8x @ 12(mod 28),where @ is the sign
for congruence')
a=8;
b=12;m=28;
V=int32([a,m]);
d=gcd(V);
a1=a/d;
b1=b/d;
m1=m/d;
disp(a1,b1,m1)
OUTPUT:
solving for the congruence equation 8x @ 12(mod 28),where @ is the sign for
congruence
2
RAJESH LANDE ROLL NO. 1220
PRACTICAL NO. 46
Question:
Properties of operation
Input:
t=poly(0,'t')
f=t^3+t^2-8*t+4
g=factors(f)
t=poly(0,'t');
h=t^4-2*t^3+11*t-10
OUTPUT:
roots of f(t) are as follows:
- 3.5615528
2.
0.5615528
- 2.
1.5 + 1.6583124i
1.5 - 1.6583124i
1.
RAJESH LANDE ROLL NO. 1220
PRACTICAL NO. 47
Question:
Roots of polynomial
Input:
t=poly(0,'t');
f=t^4-3*t^3+6*t^2+25*t-39
g=factors(f)
OUTPUT:
2. + 3.i
2. - 3.i
- 2.3027756
1.3027756
RAJESH LANDE ROLL NO. 1220
PRACTICAL NO. 48
Question:
Boolean algebra as lattices
Input:
D=[1,2,5,7,10,35,70];
a=2;
b=14;
V=int32([a,b]);
thelcm=lcm(V)
V=int32([a,b]);
thegcd=gcd(V)
abar=70/a
bbar=70/b
j=[abar,b];
h=[a,bbar];
V=int32([j])
lcm1=lcm(V)
K=int32([h])
lcm2=lcm(K)
disp(lcm1,lcm2)
RAJESH LANDE ROLL NO. 1220
OUTPUT:
10
70