Question 1.
(a) Write FORTRAN 77 and FORTRAN
90 expressions for the following

Ans.
EQUIVALENT FORTRAN EXPRESSION
= ((a * X + b ) / c) + (( 1.
- EXP(-ALPHA * SQRT(X))) /(1.
+ X * EXP(-ABS(X)))) + (ALPHA
* COS(OMEGA * T +PHI) / SQRT
(ALPHA**2 + OMEGA**2))
(b) Evaluate the following FORTRAN
77 expressions:
(i) 2 * * 3 * * 2 * 2 + 4/3
* 2,
(ii) (a/2) (a+2.5)/b,
a = 2.5 and b = 3.5,
(iii) 4 + 7 .LT. 9 .OR. 8 .GT.
4 + 7
Ans.
Solution 1(b)(i).
2**3**2*2+4/3*2
=2^3^2*2+4/3*2
=2^9*2+8/3
=2^10+2.6667
=1024+2.6667
=1026.6667 =1026.7
solution 1(b)(ii).
(a/2)(a+2.5)/b
=(2.5/2)(2.5+2.5)/3.5
=(1.25)(5)/3.5
=(1.25)(1.4286)
=2.6786
solution 1(b)(iii).
(4 + 7 .LT. 9 .OR. 8 .GT.
4 + 7)
PERFORMING THE RELATIONAL COMARISIONS
(.LT. , .GT. )LEFT TO RIGHT
(false .OR. 8 .GT. 4 + 7)
From the hierarchy table , when
both inputs are false, OR operator
is false
(false .OR. false ) gives false
Question 2.
(a) The mean annual salary
paid to all employees of a company
was Rs. 5000/-. The mean annual
salaries paid to male and female
employees were Rs. 5200/- and
Rs. 4200/- respectively. Determine
the percentage of males and
females employed by the company.
x1=5200, x2=4200, x=5000
x = n1x1 + n2x2
n1+n2
5000 = 5200n1 + 4200n2
n1+n2
5000(n1 + n2) = 5200n1 + 4200n2
5000n2 - 4200n2 = 5200n1 -
5000n1
8000n2=2000n1
8n2=2n1
n1/n2 = 8/2 =4/1
Therefore ,
percentage of male employee
in the company =4/4+1*100=400/5=80%
percentage of female employee
in the company =1/4+1*100=100/5=20%
(b) Three urns of the same appearance
have the following proportion
of balls
TOP
| First
urn: |
2
black |
1
white |
| Second urn: |
1
black |
2
white |
| Third
urn: |
2
black |
2
white |
(c) Calculate the correlation
coefficient for the following
heights (in inches) of fathers
(x) and their sons.
X: 65 66 67 67 68 69 70 72
Y: 67 68 65 68 72 72 69 71
Ans.
| X |
y |
X2 |
Y2 |
xy |
| 65 |
67 |
4225 |
4489 |
4355 |
| 66 |
68 |
4356 |
4624 |
4488 |
| 67 |
65 |
4489 |
4225 |
4355 |
| 67 |
68 |
4489 |
4624 |
4556 |
| 68 |
72 |
4624 |
5184 |
4896 |
| 69 |
72 |
4761 |
5184 |
4968 |
| 70 |
69 |
4900 |
4761 |
4830 |
| 72 |
71 |
5184 |
5041 |
5112 |
| åx=544 |
åy=552 |
åX2=37028 |
åY2=38132 |
åxy=
37560 |
| nåxy = 300480 |
n=8 |
| åx
åy = 300288 |
n åxy - åx åy=
300480 – 300288 =
192 |
| n
åX2 = 296224 |
n (åX2)
-(åx)2=296224
– 295936 = 288 |
| (åx)2 = 295936 |
n (åY2)
- (åy)2 = 305056 – 304704
= 352 |
| n
åY2= 305056 |
{nåX2-
(åx)2}
{n åY2-
(åy)2}
= 288 * 352 |
|
=
101376 |
|
(åy)2= 304704
|
√
({n åX2-
(åx)2}
{n åY2-
(åy)2})
=
318.396
|
r = (n åxy - åx
åy)
( {n åx2 -(åx)2}
{n*åy2-(åy)2} )
= 192
318.396
= 0.603023 |