0% found this document useful (0 votes)
235 views

APR - 16/SLIP/ (PR) - 2 S.Y. B.Sc. (Computer Science)

This document contains 6 examination slips with questions on C programming and Scilab programming. Each slip has 3 questions - the first two questions involve writing programs in C and Scilab, and the third question involves tasks using Scilab like matrix operations, function definitions, and plotting graphs. The questions test skills like generating points on geometric shapes, root finding using methods like bisection and Newton-Raphson, matrix operations, interpolation, and sorting points with respect to lines, boxes and rectangles.

Uploaded by

rajnishmishra
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)
235 views

APR - 16/SLIP/ (PR) - 2 S.Y. B.Sc. (Computer Science)

This document contains 6 examination slips with questions on C programming and Scilab programming. Each slip has 3 questions - the first two questions involve writing programs in C and Scilab, and the third question involves tasks using Scilab like matrix operations, function definitions, and plotting graphs. The questions test skills like generating points on geometric shapes, root finding using methods like bisection and Newton-Raphson, matrix operations, interpolation, and sorting points with respect to lines, boxes and rectangles.

Uploaded by

rajnishmishra
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/ 25

P289 APR - 16/SLIP/[PR] - 2

S.Y. B.Sc. (Computer Science)


MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-1
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program to generate n uniformly spaced points on the circle


x2 y2  r 2 . [20]

Q2) Write a Scilab program to estimate a root of an equation f (x) = 0 in [a, b]


using Regula - Falsi method correct up to four decimal places. [20]
OR The maximum number of iterations is 15.

Q3) Using Scilab [5]


 2 e 2 3 ¯
¡ °
¡4 6 1 1°
a) Declare the matrix A = ¡¡ °.
¡0 0 1 0 °°
¡2 3 6 4 °±
¢
Find eigen values and eigen vectors of A.

b) Define the following function using ‘deff’. [5]


f ( x)  x 2 1, if x p 0
1
 , if x  0
x 1
Find f (1) and f (–1)

ZZZ

1
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-2
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program to generate n uniformly spaced points on the ellipse


x2 y2
1 . [20]
a 2 b2

Q2) Write a Scilab program to estimate a root of an equation f (x) = 0 in [a, b]


using Newton - Raphson method correct up to four decimal places.
OR The maximum number of iterations is 15. [20]

Q3) Using Scilab [5]


 2 3¯°
¡ 3 9 6
¡ °
a) Declare the matrix A = ¡¡ 4 6 3 8° .
°
¡ 1 0 1 0°
¡ °
¡¢ e 1 5 1 4°±
Find eigen values and eigen vectors of A.
b) Define the following function using ‘deff’ command. [5]
f ( x, y )  sin ( x 2 y 2 ).


Find f (0,0) and f Q 2 , Q 2

ZZZ
2
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-3
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program that [20]


a) Accepts a set S of n points in XY-plane.
b) Accepts two points A and B on a line L.
c) Sorts the points of S with respect to the line L.

Q2) Write a Scilab program that [20]


a) Accepts the set of values (xi, yi), i = 1, 2, ..., n,
where xi + 1 – xi = constant, for all i.
b) Estimates the value of y for given x ‰< x1 , xn > , by using Newton’s forward
difference interpolation formula.

Q3) Using Scilab [5]


a) Plot a graph of the following function.
1
f ( x) 
1 x 2 where x‰<2,2 > .

 1 3 5¯
¡ °
b) Declare the matrix A = ¡¡ 6 7 8 °° [5]
¡5 4 3 °
¢ ±
Find the determinant of A. Also find inverse of A, if it exists.

ZZZ
3
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-4
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program that [20]


a) Accepts xmin, xmax, ymin, ymax, zmin, and zmax for a rectangular box with its
faces parallel to the coordinate planes.
b) Accepts a set S of points in the 3-dimensional space.
c) Sorts the points of S with respect to the rectangular box.

Q2) Write a Scilab program that [20]


a) Accepts a set of values (xi, yi), i = 1, 2,...,n,
Where xi + 1 – xi = constant, for all i.
b) Estimates the value of y for given x ‰< x1 , xn > , by using Newton’s
backward difference interpolation formula.

Q3) Using Scilab [5]


  2 1 4 3¯  e 4 3 2¯
¡ ° ¡ °
¡0 i 1 2° ¡ 2 1 1 1°
a) Accept the matrices A = ¡ ° and B= ¡ °
¡3 2 1 1°° ¡ 5 2 1 4°°
¡ ¡
¡ 0 0 1 4±° ¡3 3 0 4°±
¢ ¢
Compute A + B, A2 and 2A – B.

b) Define the polynomial 2x3 – 3x2 – 3x + 2 by using ‘poly’ command. Find


its roots. [5]

ZZZ
4
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-5
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program that [20]


a) Accepts number of vertices n of a convex polygon.
b) Accepts coordinates of n vertices of the polygon.
c) Accepts a point P in the XY – plane.
d) Check if the point P is inside the polygon.

Q2) Write a Scilab program that [20]


a) Accepts a set of values (xi, yi), i = 1, 2, ..., n,
b) Estimates the value of y for given x ‰< x1 , xn > , by using Lagrange’s
interpolation formula.

Q3) Using Scilab [5]


a) Plot a graph for the following function.
f ( x, y )  x 2 y 2 , x, y ‰<10,10 > .
b) Generate each of the following matrices: [5]
i) Random matrix of order 4 x 4, with integer entries. Find its trace
also.
ii) Zero matrix of order 2 x 5.
iii) Identity matrix of order 3 x 3.
iv) Matrix of order 3 x 4 containing all entries equal to 1.

ZZZ

5
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-6
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program that [20]


a) Accepts xmin, xmax ymin, and ymax for the rectangle R with its sides parallel
to the coordinate axes.
b) Accepts a set S of points in the XY - plane.
c) Sorts the points of S with respect to the rectangle R.

Q2) Write a Scilab program that [20]


a) Accepts a set of values (xi, yi), i = 1, 2,...,n.
b) Estimates the value of y for given x ‰< x1 , xn > , by using Newton’s
divided difference interpolation formula.

Q3) Using Scilab [5]


a) Declare the following matrices:
  2 e 5¯  i 0 3¯
A=¡ ° and B= ¡ °
¡¢3 4 7°± ¡¢10 2 7°±
Find A + B and 2A – B.

b) Define the following function by using ‘deff’ command [5]


f ( x)  e 2 x x 5 .
Also find f (1) and f (3).

ZZZ

6
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-7
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program that [20]


a) Accepts a set S of n points in the XY-plane.
b) Find a pair (or pairs) of points in S which have least mutual distance.

Q2) Write a Scilab program that [20]


a) Accepts a set of n + 1 points (xi, yi), where xi + 1 – xi = constant for
i = 1, 2, ..., n + 1 and yi = f (xi), for function ‘f’.
xn 1

b) Estimates the integral ¨ f ( x ) dx , by using Trapezoidal rule.


x1

Q3) Using Scilab [5]


a) Solve the following system of linear equations:
x + y + 2z + 3w = 13
x–y+z–w=8
3x + y + z – w = 1

b) Plot the graph of the following function: [5]


1
z ,for x ‰ [1,10]and y ‰ [1,5] .
xy

ZZZ

7
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-8
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program that [20]


a) Accepts a set S of n points in the XY-plane.
b) Find a pair (or pairs) of points in S which are farthest apart.

Q2) Write a Scilab program that [20]


a) Accepts a set of n + 1 points (xi, yi), where xi + 1 – xi = constant for
i = 1, 2, ..., n + 1 and yi = f (xi), for function ‘f’.
xn 1

b) Estimates the integral , by using Simpson’s 1 3


rule.
rd
¨ f ( x) dx
x1

Q3) Using Scilab [5]


a) Solve the following system of linear equations:
x + 5y + 4z – 13w = 3
3x – y + 2z – 5w = 2
2x + 2y + 3z – 4w = 1

b) Define the function [5]


f ( x)  4 x  e x , 0 b x 5
1
 2 5b x b10
x 1
Evaluate f (5) and f (7.2).

ZZZ
8
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-9
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program that [20]


a) Accepts a set S of n points in the XY-plane.
b) Find a pair (or pairs) of points in S which have least mutual distance.

Q2) Write a Scilab program that [20]


a) Accepts a set of n + 1 points (xi, yi), where xi + 1 – xi = constant for
i = 1, 2, ..., n + 1 and yi = f (xi), for function ‘f’.
xn 1

b) Estimates the integral f ( x ) dx , by using Simpson’s 3 8


rule.
th
¨
x1

Q3) Using Scilab [5]


  1 3 3 ¯
¡ °
a) Declare the matrix A  ¡ 3 5 3°° .
¡
¡ 6 6 4 °
¢ ±
Find eigen values and eigen vectors of A. Also check whether A is
digonalizable.

b) Define the following polynomial by using ‘poly’ command [5]


p ( x)  x 1.5 x 15 x 5.2.
4 2

Find all roots of p(x).

ZZZ

9
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-10
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program that [20]


a) Accepts the number n of vertices of a convex polygon.
b) Accepts coordinates of n vertices of the polygon.
c) Accepts a point P in the XY – plane.
d) Check if P is inside the polygon.

Q2) Write a Scilab program to solve a differential equation y a  f ( x, y) using


Euler’s method, given that y0 = f (x0) and constant increment h. [20]

Q3) Using Scilab [5]

  Q 0 3¯
¡ °
a) Declare the matrix A = ¡1 6 1°° .
¡
¡ 7 2 5°
¢ ±
Evaluate A2 – 4A + 5I.
b) Plot a graph for the following function: [5]
f ( x)  e x ,  5b x b 5 .

ZZZ

10
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-11
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program to generate uniformly spaced n points on the circle [20]
x2 + y2 = r2.

dy
Q2) Write a Scilab program to solve a differential equation  f ( x, y ), [20]
dx
by using Runge Kutta method of second order; given that y0 = f (x0) and
constant increment h.

Q3) Using Scilab [5]


a) Define the polynomial whose roots are o i and o1 .
Evaluate the polynomial at 2.5 and –4.
b) Solve the following system of linear equations: [5]
2x + y + z = 10
3x + 2y + 3z = 18
x + 4y + 9z = 16

ZZZ

11
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-12
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program to generate n uniformly spaced points on the ellipse


x2 y2
1 . [20]
a 2 b2

dy
Q2) Write a Scilab program to solve a differential equation  f ( x, y ) , by using
dx
Runge Kutta method of fourth order; given that y0  f ( x 0 ) and constant
increment h.
[20]

Q3) Using Scilab [5]


a) Declare the matrices
  2 1 1¯  4 3 2¯
¡ ° ¡ °
¡1 0 2° ¡1 1 4°
A=¡ ° and B  ¡ °
¡3 0 1°° ¡ 0 4 1°°
¡ ¡
¡ 0 1 2±° ¡3 8 5°±
¢ ¢
Find reduced row echelon from of [A, B] and rank of [A, B].
b) Define the following function using ‘deff’. [5]
f ( x)  4 x 2  e x sin ( x) and evaluate f (3.6), f (10).

ZZZ

12
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-13
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program to generate n uniformly spaced points on the ellipse


x2 y2
1 . [20]
a 2 b2

Q2) Write a Scilab program to estimate a root of an equation f (x) = 0 in [a, b]


using Regula - Falsi method correct up to four decimal places,
Or the maximum number of iterations is 15. [20]

Q3) Using Scilab [5]


a) Solve the following system of linear equations:
x  y z 3w 13
x y z  w8
3x y z  w  0

 1 3 5¯
¡ °
b) Declare the matrix A = ¡¡6 7 8 °° . [5]
¡5 4 3 °
¢ ±
Find characteristic polynomial of A, eigen values and eigen vectors of A.

ZZZ

13
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-14
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program to generate n uniformly spaced points on the circle


x2 y2  r 2 . [20]

Q2) Write a Scilab program to estimate a root of an equation f (x) = 0 in [a, b]


using Newton - Raphson method correct up to four decimal places,
Or the maximum number of iterations is 15. [20]

Q3) Using Scilab [5]


a) Solve the following system of linear equations:
x y z w 6
2x y  z 3
3 x y 2w  6

  1  3 3¯
¡ °
b) Declare the matrix A = ¡¡ 3 5 3°°
¡ 6  6 4°
¢ ±
Find eigen values and eigen vectors of A. Compute p–1 AP, where P is
a matrix that diagonalizes A. [5]

ZZZ

14
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-15
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program that [20]


a) Accepts xmin, xmax, ymin, and ymax for a rectangle R with its sides parallel to
the coordinate axes.
b) Accepts a set S of points in the XY - plane.
c) Sorts the points of S with respect to the rectangle R.

Q2) Write a Scilab program that [20]


a) Accepts a set of values (xi, yi), i = 1, 2,...,n,
where xi + 1 – xi = constant, for all i.
b) Estimates the value of y for given x ‰< x1 , xn > , by using Newton’s
forward difference interpolation formula.

Q3) Using Scilab [5]


  2 1 4 3¯  1 4 3 2¯
¡ ° ¡ °
¡0 0 1 2° ¡2 1 1 1 °
a) Accept the matrices A = ¡¡ ° and B= ¡ °
¡3 2 1 1°° ¡5
¡ 5 1 4°°
¡ 0 3 1 4±° ¡3 3 0 4°±
¢ ¢
Verify that det (AB) = det (A).det (B).
b) i) Find the polynomial with roots 1, –1 and 2.
ii) Find the roots of polynomial x3 – 3x2 – 2x + 6.
[5]

ZZZ
15
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-16
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program that [20]


a) Accepts a set S of n points in XY-plane.
b) Accepts two points A and B on a line L.
c) Sorts the points of S with respect to the line L.

Q2) Write a Scilab program that [20]


a) Accepts the set of values (xi, yi), i = 1, 2, ..., n,
where xi + 1 – xi = constant, for all i.
b) Estimates the value of y for given x ‰< x1 , xn > , by using Newton’s
backward difference interpolation formula.

Q3) Using Scilab [5]


a) Plot a graph of the following function.
  Q Q¯
f ( x)  sin ( x 1), where x ‰ ¡ , ° .
¡¢ 2 2 °±

  3 2 1¯  1¯
¡ ° ¡ °
b) Declare the matrices A = ¡¡6 2 1 °° and B= ¡¡ 0 °° . [5]
¡5 4 3 ° ¡1°
¢ ± ¢ ±
Find the augmented matrix [A, B] and find rank of [A, B].

ZZZ
16
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-17
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program that [20]


a) Accepts a set S of n points in the XY-plane.
b) Find a pair (or pairs) of points in S which are farthest apart.

Q2) Write a Scilab program that [20]


a) Accepts a set of points (xi, yi), i = 1, 2, ..., n.
b) Estimates the value of y for given x ‰< x1 , xn > , by using Lagrange’s
interpolation formula.

Q3) Using Scilab [5]


  2 5 3 2 ¯
¡ °
¡2 3 2 5°
a) Declare the matrix A = ¡ °.
¡1 3 2 2 °°
¡
¡ 1 6 4 3 °±
¢
Find trace, determinant, size and inverse of A.
b) Plot the graph of the following function: [5]
f ( x, y )  x 2  2 y y 2 ,for x , y ‰<1,10 > .

ZZZ

17
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-18
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program that [20]


a) Accepts a set S of n points in XY-plane.
b) Accepts two points A and B on a line L.
c) Sorts the points of S with respect to the line L.

Q2) Write a Scilab program that [20]


a) Accepts the set of values (xi, yi), i = 1, 2, ..., n.
b) Estimates the value of y for given x ‰< x1 , xn > , by using divided difference
interpolation formula.

Q3) Using Scilab [5]


a) Plot a graph of the following function.
f ( x)  x 3 3x 4 , where x‰< 20, 20 > .
 4 1 e¯
¡ °
b) Declare the matrix A = ¡ 1  2 3°. [5]
¡ °
¡ 5 3 3°
¢ ±
Find length, trace, diagonal and size of A.

ZZZ

18
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-19
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program that [20]


a) Accepts number of vertices n of a convex polygon.
b) Accepts coordinates of n vertices of the polygon.
c) Accepts a point P in the XY - plane.
d) Check if the point P is inside the polygon.

Q2) Write a Scilab program that [20]


a) Accepts a set of n + 1 points (xi, yi), where xi + 1 – xi = constant, for
i = 1, 2, ..., n + 1 and yi = f (xi), for function ‘f’.
xn 1

b) Estimates the integral ¨ f ( x ) dx , by using Trapezoidal rule.


x1

Q3) Using Scilab [5]


a) Plot a graph for the following function
y  log x, x ‰<1, 25> .

b) Find eigenvalues of the following matrix: [5]


 4 6 6¯
¡ °
A=¡ 1 3 2°
¡ °
¡1 4 3°
¢ ±

Hence verify œ i
i = trace (A).

ZZZ
19
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-20
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program that [20]


a) Accepts xmin, xmax ymin, ymax, zmin, and zmax for a rectangular box with its
faces parallel to the coordinate planes.
b) Accepts a set S of points in the 3 - dimensional space.
c) Sorts the points of S with respect to the rectangular box.

Q2) Write a Scilab program that [20]


a) Accepts a set of n values (xi, yi), i = 1, 2,..., n,
where xi + 1 – xi = constant, for all l and yi = f (xi), for function ‘f’.
xn

b) Estimates the integral ¨ f ( x) dx , by using Simpson’s 1 3


rd rule.
x1

Q3) Using Scilab [5]


a) Solve the following system of linear equations:
2 x y z 10
3 x 2 y 3z 18
x 4 y 9 z 16

  1 0 0¯
¡ °
b) Declare the matrix A  ¡0 2 3° . [5]
¡ °
¡0 3 2°
¢ ±
Find eigen values and eigen vectors of A. Compute p–1 AP, where P is
a matrix that diagonalizes A.

ZZZ
20
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-21
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program that [20]


a) Accepts a set S of n points in the XY-plane.
b) Find a pair (or pairs) of points in S which are farthest apart.

Q2) Write a Scilab program that [20]


a) Accepts a set of n + 1 points (xi, yi), where xi + 1 – xi = constant for
i = 1, 2, ..., n + 1 and yi = f (xi), for function ‘f’.
x n 1

b) Estimates the integral ¨ f ( x) dx , by using Simpson’s (3/3)th rule.


x1

Q3) Using Scilab [5]


 2 2 0 1 ¯
¡ °
¡4 5 3 1°
a) Declare the matrix A = ¡¡ °.
¡0 1 0 1 °°
¡4 5 1 9°±
¢
Compute A3 + 3A2 – 4A + 6I.
b) Define the following function using ‘deff’ command. [5]
f ( x)  x 3, x  2
 x, 0b x b 2
 x  5, x  0

ZZZ
21
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-22
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program that [20]

a) Accepts a set S of n points in the XY-plane.

b) Find a pair (or pairs) of points in S which have least mutual distance.

Q2) Write a Scilab program to solve a differtial equation y a  f ( x, y) , using Euler’s


method, given that y0  f ( x0 ) and constant increment h. [20]

Q3) Using Scilab [5]

 1 4 2¯
¡ °
a) Declare the matrix A = ¡3 4 0 ° .
¡ °
¡3 1 3 °
¢ ±

Find eigen values and eigen vectors of A. Also check whether A is


digonalizable.

b) Generate a random matrix of order 3 x 3 with all integer entries less than
or equal to 99. Hence compute A2 + 2A. [5]

ZZZ

22
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-23
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program that [20]


a) Accepts xmin, xmax ymin, ymax, zmin, and zmax for a rectangular box with its
faces parallel to the coordinate planes.
b) Accepts a set S of points in the 3-dimensional space.
c) Sorts the points of S with respect to the rectangular box.

dy
 f ( x, y ) , by using
Q2) Write a Scilab program to solve a differential equation
dx
Runge Kutta method of second order; given that y0 = f (x0) and constant
increment h. [20]

Q3) Using Scilab [5]


a) Solve the following system of linear equations:
2 x 3 y 4 z 1
2x y z  2
x y 2 z  2
b) Define the function: [5]
f ( x, y )  x y  2 xy , using ‘deff’ command.
2

Find f (2, –3) and f (0.5, –1).

ZZZ

23
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-24
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program to generate n uniformly spaced points on the circle


x2 y2  r 2 . [20]

dy
 f ( x, y ) , by using
Q2) Write a Scilab program to solve a differential equation
dx
Runge Kutta method of fourth order; given that y0 = f (x0) and constant
increment h. [20]

Q3) Using Scilab [5]


a) Declare the matrices
  1 5 3¯   0 4¯
¡ ° ¡ °
A = ¡1 2 0° and B  ¡ 2 2°
¡ ° ¡ °
¡ 0 5 1° ¡ 4 0°
¢ ± ¢ ±
Find reduced row echelon form of [A, B] and rank of [A, B].
 4 6 6¯
¡ °
b) ¡
Declare the matrix A = ¡ 1 3 2° [5]
°
¡ 1 4 3°
¢ ±
Find eigen values and eigen vectors of A. Compute p–1AP, where P is a
matrix that diagonalizes A.

ZZZ

24
P289 APR - 16/SLIP/[PR] - 2
S.Y. B.Sc. (Computer Science)
MATHEMATICS PRACTICAL EXAMINATION
C - Programming and Scilab
Algorithm (Paper - III) (2013 Pattern)
SLIP No.-25
Time : 2 hours] [Max. Marks : 50

Q1) Write a C-program to generate n uniformly spaced points on the ellipse


x2 y2
1 . [20]
a 2 b2

Q2) Write a Scilab program that [20]


a) Accepts a set of n + 1 points (xi, yi), where xi + 1 – xi = constant for
i = 1, 2, ..., n + 1 and yi = f (xi), for function ‘f’.
x n 1

b) Estimates the integral ¨ f ( x) dx , by using Trapezoidal rule.


x1

Q3) Using Scilab [5]


a) Solve the following system of linear equations:

x y 2z 7
x  2 y 3 z  6
3 x  7 y 6 z 1

b) Find all roots of the following polynomials: [5]


i) x3 – x2 – x – 1,
ii) x4 – 4x – 5

ZZZ

25

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy