Sei sulla pagina 1di 10

RAJESH LANDE ROLL NO.

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

mprintf('%i is congruent to %i(mod 6)',m,n)

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)

disp(r=roots(f),'roots of f(t) are as follows:')

t=poly(0,'t');

h=t^4-2*t^3+11*t-10

disp(r=roots(h),'the real roots of h(t) are 1 and -2')


RAJESH LANDE ROLL NO. 1220

OUTPUT:
roots of f(t) are as follows:

- 3.5615528

2.

0.5615528

the real roots of h(t) are 1 and -2

- 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)

disp(r=roots(f),'roots of f(t) are as follows:')

OUTPUT:

roots of f(t) are as follows:

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

Potrebbero piacerti anche