0% found this document useful (0 votes)
6 views11 pages

Maxima Sheets

NMNML;LIP8YITGKBNM,'LO]=-809YIHKNLM

Uploaded by

adhamkhalel2011
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views11 pages

Maxima Sheets

NMNML;LIP8YITGKBNM,'LO]=-809YIHKNLM

Uploaded by

adhamkhalel2011
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

lOMoARcPSD|56109903

Maxima sheets

Management Essential (Symbiosis International University)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Adham Ibrahim ([email protected])
lOMoARcPSD|56109903

Practical Slips for F.Y.B.Sc.(Computer Science)


Mathematics using Maxima Software
PAPER-I: MTC-111 (Credit- 2)

MATRIX ALGEBRA
Practical no. 4: Introduction to Maxima software(MTC-111)
1. Describe historical evolution of Maxima software.
2. Write the list of preliminary commands in Maxima software with description.
3. Write the list of basic arithmetic operators in Maxima software with description.
4. Perform the following arithmetic operations:
(i) Compute
√ 5·6+9
(ii) Add 5 to the previous output.
(iii) Find a decimal approximation for the previous output.
(iv) Square the previous output.

5. Define the expressions A = 5 20 and B = 5, then find decimal approximations
for A + B and A/B.
6. Evaluate the following for a = 12, b = 25 using Maxima.
a) (4a + b) + 3(a − 6b). c) a2 − 7b + 10.
b) (a + b)3 d) a25−1 + b2 +2b+3
a−2

7. If  
1 2 −3 2 2
A= 2 5 8 6 10  .
3 4 −5 2 5
then obtain the following.
a) Enter matrix A, then find the order of A using Maxima software.
b) Obtain first, third and fifth row, also second and fourth column of A.
c) Swap row 2 and row 5, then first and third column of A.
d) Add row (2,5,6,8,0) and column (-7,8,3) in A.
e) Perform row operations R2 − 4R1 , R3 + 7R2 and R1 − 8R3 simultaneously
on A.
8. Generate diagonal matrix of order 5 × 5 with diagonal entries {1, −2, 5, 8, 4}.
9. Plot the points [-3, 1] and [2, 5] on a grid for x-range [-10, 10] and
y-range [-10, 10]. Include a label above each point.
10. Plot a black vertical line x = 3, and plot the unit circle in red with
x-range [-4; 4] and y-range [-4; 4]. Include the x and y axes, a grid and a title.
11. Plot the function P (x) = x3 + x2 − 6x and identify its zeros.

Downloaded by Adham Ibrahim ([email protected])


lOMoARcPSD|56109903

Practical no. 5: Problems on unit 1 and unit 2(MTC-111)

Unit 1: Introduction to Matrix Theory


1. In maxima,
 enter
 the following
 matrices.
1 1 4 2
A= B=
2 3 1 3
Then, compute

a) A + B b)4A c)3A − 2B
d) AT e) A−1 f) (A − 5B)T
g) A · B h) A2 i) A2 − 4A + I2

2. In maxima,
 enter the following
 matrices. 
e 2 3 1 1 −4
A = 0 1 −1 and B =
   π 3 0 
−2
6 0 3 −3 1 1
Further

a) verify that (A + B)T = AT + B T


b) find (A + B)−1
   
1 −3 5
3. Let A = and X = . Find (AX)T , X T AT , XX T .
−2 4 3
Is AT X T defined?

4. Find inverse of the following matrices


 
    4 0 −7 −7
1 −2 −1 −2 −7 −9  −6 1 11 9 
(a) −1
 5 −6  (b)  2 5 6  (c)  
 7 −5 10 19 
5 −4 5 1 3 4
−1 2 3 −1
 
1 −2 −1
5. Let A =  −1 5 −6  . Find second and third columns of A−1
5 −4 5

Downloaded by Adham Ibrahim ([email protected])


lOMoARcPSD|56109903

Unit 2: Linear Equations in Linear Algebra I


1. Reduce the following matrices to row echelon form.
 
1 −2 1 2    
0 1 2 1 3 7 aa bb
 2 3 −1 −5  
(a)  , (b) 1 −1 0
 2 , (c)  −1 8 5 2  ,
 4 −1 1 −1 
1 2 1 1 9 2 11 4
5 −3 2 1
 
    0 −3 −6 4 9
1 1 3 1 2 −3 2 2  −1 −2 −1 3 1 
(d)  3 5 8  , (e)  2 5 −8 6 5  , (f )  .
 −2 −3 0 3 −1 
2 −1 3 3 4 −5 2 5
1 4 5 −9 −7
2. In Maxima, solve the following system using matrix inversion method.
(X = A−1 B)

x−y+z = 4
2x + y − 3z = 0
x+y+z = 2

3. Solve the following homogeneous system.

3x + 5y − 4z = 0
−3x − 2y + 4z = 0
6x + y − 8z = 0

4. Solve the following non-homogeneous system.

x+y+z =4

x − y + 2z = 3
2x + 3y − z = 6

5. Solve the following non-homogeneous system.

x − 2w = −3

2y + 2z = 0
z + 3w = 1
−2x + 3y + 2z + w = 5

Downloaded by Adham Ibrahim ([email protected])


lOMoARcPSD|56109903

Practical no. 6: Problems on unit 3 and unit 4(MTC-111)

Unit 3: Linear Equations in Linear Algebra-II

1. Find LU factorization
 of the matrices
 given below.

3 −1 2 −5 3 4
(a)  −3 −2 10  (b)  10 −8 −9 
9 −5 6 15 1 2
 
  1 3 −5 −3
2 −4 2  −1 −5 8 4 
(c)  1 5 −4  (d)  
 4 2 −5 −7 
−6 −2 4
−2 −4 7 5
2. Find echelon form of the following matrices and hence find basis for its column
space.    
1 4 8 −3 −7 3 −1 7 3 9
 −1 2 7 3 4   −2 2 −2 7 5 
(a) A = 
 −2 2
 (b) A =  
9 5 5   −5 9 3 3 4 
3 6 9 −5 −2 −2 6 6 3 7
3. Find null space Nul A and column space Col A for the following matrices. Also
find rank and nullity and hence verify rank nullity theorem.
 
  4 −7 3 7 5
1 3 4 0
 −3 −6 −7 2 

 6 −8 5 12 −8 
(a) A = 
  (b)  −7 10 −8 −9 14 
3 3 0 −4   
 3 −5 4 2 −6 
−5 −3 2 9
−5 6 −6 −7 3
 
4 −2 5 −5
 −9 7 −8 0 
(c)
 −6 4

5 3 
5 −3 8 −4

Unit 4: Determinants
1. Compute
 the determinants
  of the following matrices.
  
−1 2 3 0 2 5 4 1 1 5 4 1
 3 4 3 0   4 7 6 2   0 −2 −4 0 
(a) 
 11 4 6 6  b)  6 −2 −4 0  (c)  3
    
5 4 1 
4 2 4 3 −6 7 7 0 −6 5 5 0
   
9 1 9 9 9 4 8 8 8 5
 9 0 9 9 2   0 1 0 0 0 
   
(d) 
 4 0 0 5 0  (e)  6 8 8 8 7 
  
 9 0 3 9 0   0 8 8 3 0 
6 0 0 7 0 0 8 2 0 0

Downloaded by Adham Ibrahim ([email protected])


lOMoARcPSD|56109903

2. Verify that
 det(AB) = 
det(A). det(B)
 for thefollowing matrices.
5 1 −1 1 0 3
(a) A =  1 −3 −2 , B =  4 0 −1 
0 5 3 3 8 6
   
4 0 0 5 1 −2 5 2
 1 7 2 −5 
 B= 0 0 3 0 

(b) A =  3 0 0 0   2 −4 −3 5 

8 3 1 7 2 0 3 5
3. Compute
 the adjoint
 of the following
 matrices
 
0 −2 −1 1 1 3 3 5 4
(a)  5 0 0  (b) −2 2 1 (c) 1 0 1
−1 1 1 0 1 1 2 1 1
 
1 −2 1 2    
1 0 −2 a b c
 2 3 −1 −5 
(d) 
 4 −1
 (e)  −3 1 4  (f )  d e f 
1 −1 
2 −3 4 g h i
5 −3 2 1

4. Verify that for the matrix A, det(5A) = (53 ) det(A)

1 5 −4
−1 −4 5 .
−2 −8 7

Downloaded by Adham Ibrahim ([email protected])


lOMoARcPSD|56109903

PAPER-II: MTC-112 (Credit- 2)

DISCRETE MATHEMATICS
Practical no. 10: Introduction to Maxima software(MTC-112)

1. Rationalize the numbers 0.1, 2.34, 77.915, 111.666

2. Use sum to compute the sum 2 + 4 + 6 + · · · + 50.

3. Use prod to compute the product of first 50 odd natural numbers


 
o 11π
4. Compute sin(85 ) and tan .
12
5. Assign A to the expression 2x + 5 and B to the expression 6 − x4 , then compute
A + B, A - B and A*B in expanded form. Further Assign f(x) to the square root
function. Evaluate f(4), f(-4) and f(A).

6. Define fn (x) = sin(nπx), then list fn (x) for several values of n.


45!
7. Obtain 13!, 60!, using Maxima
98!
32
15 45 C14
8. Obtain C5 , C23 , 13 C
using Maxima.
7

9. Enter the following recurrence relations in Maxima software


a) ar = 7ar−1 + 10ar−2 .
b) ar − 4ar−1 + 4ar−2 = 0.
c) ar = 6ar−1 − 11ar−2 + 6ar−3 .
d) ar − 5ar−1 + 6ar−2 = 8r2 .

10. The Fibonacci sequence is defined by a recursive formula fn = fn−1 + fn−2 ; Use
a do-loop to generate the first twenty terms of the Fibonacci sequence.

11. Make a plot of the sine function on the interval [0; 4π]. Identify the period and
the first three zeros (roots) of the sine function.

12. Plot f (x) = cosx, g(x) = cosx + 1, and h(x) = cosx − 2 on the same graph using
red, blue and black, respectively. Include a key to identify each plot in the graph.

13. Make a quick plot of the paraboloid z = x2 + y 2 using wxplot3d. In addition, use
plot3d to draw the paraboloid in a GNUplot window, then manipulate the plot
with a mouse.

Downloaded by Adham Ibrahim ([email protected])


lOMoARcPSD|56109903

Practical no. 11: Problems on unit 1 and unit 2(MTC-112)

Unit 1: Logic
1. If

p : x2 − 8 = 20
q : y + 17 < 30

then determine the truth values of following statements using Maxima for
{x, y} ∈ Z.
a) p ∨ q, b) (p ∧ q) → p, c) p → q,
d) ¬q ∧ ¬p, e) ¬p → q, f) p ↔ q.

2. If

p : x − 10 = 4
q : y + 4 6= 9
r : z + 9 < 18

then determine the truth values of following statements using Maxima for
{x, y, z} ∈ Z.
a) p ∨ (q ∨ r). b) (p ∧ q) ∧ r. c) p → q(→ r).
d) (¬p ∨ ¬q) ∧ r. e) (¬p → q) ∧ r. f) (p ∨ q) ↔ (q ∧ r).

3. Show the following logical equivalences holds using Maxima

(a) ¬(p ∨ q) ≡ ¬p ∧ ¬q
(b) ¬(p ∧ q) ≡ ¬p ∨ ¬q
(c) p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
(d) p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)
(e) p → (q ∨ r) 6= (p → q) ∧ (p → r)

4. For the expression “x + y < 3”, find the following using Maxima software.

(a) Possible list of assumptions


(b) Is x ∗ y > 0 ? c) Is x < 3 ?

Unit 2: Lattices and Boolean Algebra


1. In each of the following relation, find the matrix of the relation R defined on the
given set A using Maxima.

a) {1, 2, 3, 4, 5, 6, 7}, R={(1, 2), (1, 5), (1, 6)(2, 1), (2, 3), (2, 7), (3, 4),
(3, 5), (4, 2), (4, 7), (5, 4), (6, 2), (7, 1), (7, 4)}

Downloaded by Adham Ibrahim ([email protected])


lOMoARcPSD|56109903

b) {1, 2, 3, 4, 5, 6}, R={(x, y) | y − x = 1}


c) {1, 2, 3, 4, 5, 6, 7, 8}, R is defined as xRy if and only if x = 1 + y.

2. In each of the following relation, find the digraph of the relation R defined on the
given set A using Maxima.

a) A={1, 2, 3, 4}, R={(1, 2), (2, 1), (1, 4), (4, 1), (2, 3), (3, 2), (3, 4),
(4, 3), (1, 3), (4, 2)}.
b) A={1, 2, 3, 4, 5}, R={(1, 2), (1, 3), (2, 3), (2, 4), (3, 4), (3, 5),
(4, 1), (4, 5), (5, 1), (5, 2)}.
c) A={1, 2, 3, 4, 5, 6}, R={(1, 2), (1, 6), (1, 5), (2, 3), (2, 4), (2, 5), (3, 4)
(3, 5), (4, 5), (5, 6), (6, 2)}.

3. Find the truth values of following Boolean functions using Maxima.

a) F (x, y) = (x ∧ y) ∨ (x ∨ ȳ).
c) F (x, y) = (x̄ ∨ y) ∧ (x̄ ∨ ȳ) ∨ (x ∧ y).
d) F (x, y, z) = (x̄ ∨ y ∧ z) ∨ (x ∨ ȳ ∧ z).
e) F (x, y, z) = (x̄ ∧ ȳ ∨ z) ∧ (x ∧ ȳ ∧ z) ∨ (x̄ ∨ ȳ ∧ z).

4. Find Disjunctive normal form and Conjunctive normal form for the following
functions

a) f (x, y) = (x̄ ∧ ȳ) ∨ (x ∨ ȳ).


b) f (x, y, z) = x.z
¯ + ((x + y).(z̄ + x̄)).

5. Simplify the following Boolean expression using Maxima.

a) f (x, y, z) = x̄ ∨ (y ∧ (z̄ ∨ x)).


b) f (x, y, z) = [(x̄ ∨ (y ∧ z))] ∨ [ȳ ∧ (x̄ ∨ z)].

Downloaded by Adham Ibrahim ([email protected])


lOMoARcPSD|56109903

Practical no. 12: Problems on unit 3 and unit 4(MTC-112)

Unit 3: Counting Principles


1. By using Maxima determine

(a) In how many ways can all the cards be arranged from a 52 card deck?
(b) How many different 10 letter “words” (sequence) are there with no repeated
letter, formed from 26 letter alphabet?

2. In how many ways a committee can be formed from 4 men and 6 women with at
least two men and al least twice as many women as men?

3. Find the number of ways in which 20 books on C + +, 15 books on Java and 10


books on Discrete Mathematics can be arranged in such a way that neither all
the books on C + +, nor all books on Java, nor still all the books on Discrete
Mathematics are together By using Maxima.

4. By using Maxima find the number of ways to select 4 unordered elements from
a set with 6 elements when repetition is allowed.

5. By using Maxima determine

a) In how many ways can all the letters in “MATHEMATICAL” be arranged?


b) In how many ways arrangements in (a) are the letters C and E adjacent?
c) In how many ways arrangements in (a) are the vowels adjacent?
d) In how many ways arrangements in (a) are the consonants adjacent?

6. There are 8 men and 7 women. By using Maxima determine the number of ways
of selecting a committee consisting of

a) 5 persons with at most one woman,


b) 5 persons with at least one woman,
c) 5 persons having both men and women,
d) An equal number of men and women.

Unit 4: Recurrence Relations


1. Solve the following homogeneous recurrence relations

a) The Fibonacci relation ar = ar−1 + ar−2 ; a0 = 0, a1 = 1.


b) ar = 7ar−1 + 10ar−2 ; a0 = 10, a1 = 20.
c) ar − 4ar−1 + 4ar−2 = 0; a0 = 5, a1 = 10.
d) ar = 6ar−1 − 11ar−2 + 6ar−3 ; a0 = 2, a1 = 5 a2 = 15.

Downloaded by Adham Ibrahim ([email protected])


lOMoARcPSD|56109903

10

e) ar − 5ar−1 + 8ar−2 − 4ar−3 = 0; a0 = 4, a1 = −15 a2 = 23.


f) ar + 6ar−1 + 12ar−2 + 8ar−3 = 0; a0 = −1, a1 = −2 a2 = −3.

2. Solve the following nonhomogeneous recurrence relations

a) ar − 5ar−1 + 6ar−2 = 8r2 with initial conditions a0 = 4, a1 = 7.


b) ar − 7ar−1 + 10ar−2 = 3r , a0 = 0, a1 = 1.
c) ar + ar−1 = 3.r.2r , a1 = 20.
d) ar + 5ar−1 + 6ar−2 = 3r2 − 2r + 1, a0 = a1 = 2.
e) ar − 10ar−1 + 9ar−2 = 3 + 8r, a0 = 3, a1 = 25 .
f) ar − 4ar−1 + 4ar−2 = 4(r + 1)3r , a0 = 20, a1 = −38.
g) ar − 6ar−1 + 8ar−2 = 2r + 3r + 5, a0 = 11, a1 = 18.

Downloaded by Adham Ibrahim ([email protected])

You might also like