Tuesday 14 March 2023

FYBSC IT SEM ( NUMERICAL METHODS QUESTION BANK SOLUTIONS )

 FYBSC IT SEM ( NUMERICAL METHODS QUESTION BANK SOLUTIONS ) 

UNIT 1

1.Let p = 0.54617 and q = 0.54601. Use three significant figures to approximate p − q and determine the absolute and relative errors using  (i) rounding and (ii) chopping 

Solution:

Using three significant figures, we have p = 0.546 and q = 0.546.

(i) Rounding:

p - q = 0.546 - 0.546 = 0.000

Absolute error = |0.000 - 0.00016| = 0.00016

Relative error = |0.00016/0.00016| = 1

(ii) Chopping:

p - q = 0.546 - 0.546 = 0.000

Absolute error = |0.000 - (-0.00017)| = 0.00017

Relative error = |0.00017/0.00017| = 1

Note that the true value of p - q is 0.00016.

2.Find the absolute error and relative error and also determine the number of significant digits in the approximations for the following.

True value =98350 and approximate value =98000

Find the absolute error and relative error and also determine the number of significant digits in the approximations for the following.

solution : 

True value =98350 and approximate value =98000

The absolute error is the difference between the true value and the approximate value: Absolute error = |true value - approximate value| = |98350 - 98000| = 350

The relative error is the absolute error divided by the true value: Relative error = Absolute error / True value = 350 / 98350 = 0.00356 (rounded to 5 decimal places)

To determine the number of significant digits in the approximation, we count the number of digits that are certain plus one uncertain digit. In this case, the approximation has two certain digits (98) and one uncertain digit (000). Therefore, there are three significant digits 

3. Create a hypothetical floating-point number set for a machine that stores information using 7-bit words.

solution : 

For a machine that uses 7-bit words, we could use the following format for a floating-point number:

1 bit for the sign (S)

3 bits for the exponent (E) 

3 bits for the mantissa (M)


4.Determine the absolute and relative errors when approximating p by p when i) p = 0.3000 × 101 and p = 0.3100 × 101 ii) p = 0.3000 × 10−3 and p = 0.3100 × 103

solution : 

To determine the absolute and relative errors when approximating p by p when p = 0.3000 × 10^1 and p = 0.3100 × 10^1, we use the following formulas:

Absolute error = |p - p|

Relative error = |(p - p)/p|

Substituting the values given in the problem, we get:

absolute error = |0.3000 × 10^1 - 0.3100 × 10^1| = |-0.0100 × 10^1| = 0.100

Relative error = |(0.3000 × 10^1 - 0.3100 × 10^1)/(0.3000 × 10^1)| = |-0.0100/0.3000| = 0.0333...

Therefore, the absolute error is 0.100 and the relative error is 0.0333... or approximately 3.33%.

ii) To determine the absolute and relative errors when approximating p by p when p = 0.3000 × 10^-3 and p = 0.3100 × 10^-3, we use the same formulas:

Absolute error = |p - p|

Relative error = |(p - p)/p|

Substituting the values given in the problem, we get:

Absolute error = |0.3000 × 10^-3 - 0.3100 × 10^-3| = |-0.0100 × 10^-3| = 0.000010

Relative error = |(0.3000 × 10^-3 - 0.3100 × 10^-3)/(0.3000 × 10^-3)| = |-0.0100/0.3000| = 0.0333...


UNIT 5

1. Fit a Poisson distribution to the following data and calculate theoretical frequencies.
No. of deaths 0 1 2 3 4  Frequency 122 60 15 2 1

Solution: 
To fit a Poisson distribution, we first need to calculate the mean of the data. The mean of a Poisson distribution is equal to its parameter λ. The formula for the mean of a Poisson distribution is: λ = Σ (xi * fi) / Σfi
Where xi is the value of the the category (0, 1, 2, 3, 4) and fi is the frequency of that category.
Using the given data, we can calculate the mean as:
λ = (0 * 122 + 1 * 60 + 2 * 15 + 3 * 2 + 4 * 1) / (122 + 60 + 15 + 2 + 1) = 0.534
Now, we can use the Poisson probability mass function to calculate the theoretical frequencies for each category:
P(X = k) = (e^-λ * λ^k) / k!
Where X is the random variable representing the number of deaths, λ is the mean or parameter of the Poisson distribution, and k is the number of deaths.
Using the mean λ = 0.534, we can calculate the theoretical frequencies as follows:
P(X = 0) = (e^-0.534 * 0.534^0) / 0! = 0.588
P(X = 1) = (e^-0.534 * 0.534^1) / 1! = 0.313
P(X = 2) = (e^-0.534 * 0.534^2) / 2! = 0.084
P(X = 3) = (e^-0.534 * 0.534^3) / 3! = 0.014
P(X = 4) = (e^-0.534 * 0.534^4) / 4! = 0.002
To calculate the theoretical frequencies, we multiply each probability by the total number of observations
Theoretical frequency of 0 deaths = P(X = 0) * (122 + 60 + 15 + 2 + 1) = 93.97 ≈ 94
Theoretical frequency of 1 death = P(X = 1) * (122 + 60 + 15 + 2 + 1) = 50.32 ≈ 50
Theoretical frequency of 2 deaths = P(X = 2) * (122 + 60 + 15 + 2 + 1) = 13.59 ≈ 14
Theoretical frequency of 3 deaths = P(X = 3) * (122 + 60 + 15 + 2 + 1) = 2.26 ≈ 2
Theoretical frequency of 4 deaths = P(X = 4) * (122 + 60 + 15 + 2 + 1) = 0.31 ≈ 0
Therefore, the theoretical frequencies for a Poisson distribution with λ = 0.534 are approximately 94, 50, 14, 2, and 0 for 0, 1, 2, 3, and 4 deaths, respectively

2.If 4 jobs arrive on an average per minute. What is the probability of waiting less than or equal to 30 seconds.
Solution:
To solve this problem, we need to first convert the arrival rate from per minute to per second. Since there are 60 seconds in a minute, the arrival rate per second would be:
λ = 4 / 60 = 0.067
Next, we need to use the Poisson distribution to calculate the probability of having 0, 1, 2, 3, or 4 arrivals in the next 30 seconds. The Poisson distribution formula is:
P(X = k) = (λ^k / k!) * e^(-λ)
where X is the random variable (number of arrivals), λ is the arrival rate, k is the number of arrivals we are interested in, and e is the mathematical constant e (approximately equal to 2.71828).
Using this formula, we can calculate the probabilities as follows:
P(X = 0) = (0.067^0 / 0!) * e^(-0.067) ≈ 0.934
P(X = 1) = (0.067^1 / 1!) * e^(-0.067) ≈ 0.062
P(X = 2) = (0.067^2 / 2!) * e^(-0.067) ≈ 0.002
P(X = 3) = (0.067^3 / 3!) * e^(-0.067) ≈ 0.00005
P(X = 4) = (0.067^4 / 4!) * e^(-0.067) ≈ 0.000001
To find the probability of waiting less than or equal to 30 seconds, we need to add up the probabilities of having 0, 1, 2, 3, or 4 arrivals in the next 30 seconds:
P(X ≤ 4) = P(X = 0) + P(X = 1) + P(X = 2) + P(X = 3) + P(X = 4) ≈ 0.999
Therefore, the probability of waiting less than or equal to 30 seconds is approximately 0.999 or 99.9%.

3.The monthly worldwide average number of airplane crashes of commercial airlines is 2.2. What is probability that there will be
i) More than 2 such accidents in the next month
ii) Less than 4 such accidents in the next months
Solution : 
Given that the monthly worldwide average number of airplane crashes of commercial airlines is 2.2, we can assume that the number of such accidents follows a Poisson distribution.
i) Probability of having more than 2 accidents in the next month:
Let X be the number of airplane crashes in the next month. We want to find P(X > 2).
Using the Poisson distribution, we have:
P(X > 2) = 1 - P(X ≤ 2) = 1 - [P(X = 0) + P(X = 1) + P(X = 2)]
Where P(X = k) = (e^-λ * λ^k) / k!
λ = 2.2 (monthly worldwide average number of airplane crashes of commercial airlines)
Substituting the values, we get:
P(X > 2) = 1 - [((e^-2.2 * 2.2^0) / 0!) + ((e^-2.2 * 2.2^1) / 1!) + ((e^-2.2 * 2.2^2) / 2!)]
P(X > 2) = 1 - [(0.108 + 0.238 + 0.262)]
P(X > 2) = 0.392
Therefore, the probability of having more than 2 accidents in the next month is 0.392.
ii) Probability of having less than 4 accidents in the next month:
Let X be the number of airplane crashes in the next month. We want to find P(X < 4).
Using the Poisson distribution, we have:
P(X < 4) = P(X = 0) + P(X = 1) + P(X = 2) + P(X = 3)
Where P(X = k) = (e^-λ * λ^k) / k!
λ = 2.2 (monthly worldwide average number of airplane crashes of commercial airlines)
Substituting the values, we get:
P(X < 4) = ((e^-2.2 * 2.2^0) / 0!) + ((e^-2.2 * 2.2^1) / 1!) + ((e^-2.2 * 2.2^2) / 2!) + ((e^-2.2 * 2.2^3) / 3!)
P(X < 4) = 0.699
Therefore, the probability of having less than 4 accidents in the next month is 0.699.


4.In a certain examination mean of marks scored by 400 students is 45 and a standard deviation of 15.Assuming the distribution to be normal find
i) Number of students scoring marks between 30 and 60
ii) Number of students who scored marks more than 70
Solution : 
We are given that the distribution of marks is normal, with a mean of 45 and a standard deviation of 15.
Let's use the z-score formula to convert the given range of scores to z-scores:
z = (x - μ) / σ
where x is the score, μ is the mean, and σ is the standard deviation.
For the range of scores between 30 and 60:
z1 = (30 - 45) / 15 = -1
z2 = (60 - 45) / 15 = 1
Using a standard normal distribution table or calculator, we can find the proportion of the distribution that falls between z1 and z2:
P(-1 < z < 1) = 0.6827
Therefore, the number of students scoring marks between 30 and 60 is:
0.6827 * 400 ≈ 273
For the number of students who scored marks more than 70:
z = (70 - 45) / 15 = 1.67
Using the standard normal distribution table or calculator, we can find the proportion of the distribution that falls to the right of z:
P(z > 1.67) = 0.0475
Therefore, the number of students who scored marks more than 70 is:
0.0475 * 400 ≈ 19
Hence, the number of students scoring marks between 30 and 60 is approximately 273 and the number of students who scored marks more than 70 is approximately 19.



5.The length of life in years X of heavily used terminal in a student computer laboratory is exponentially distributed with mean =0.5 years. Write the PDF of the distribution and find the probability that the life of a computer terminal is at least 2 years
Solution
The PDF (Probability Density Function) of an exponential distribution with mean μ is given by:
f(x) = (1/μ) * exp(-x/μ), for x ≥ 0
where μ = 0.5 years is the mean life of a computer terminal.
So, the PDF of the distribution of the length of life in years X of heavily used terminal in a student computer laboratory is:
f(x) = (1/0.5) * exp(-x/0.5) = 2 * exp(-2x), for x ≥ 0
To find the probability that the life of a computer terminal is at least 2 years, we need to calculate:
P(X ≥ 2) = ∫2∞ f(x) dx
= ∫2∞ (2 * exp(-2x)) dx
= -exp(-2x) | 2∞
= exp(-4)
≈ 0.0183
Therefore, the probability that the life of a computer terminal is at least 2 years is approximately 0.0183 or 1.83%.

6.For the following probability distribution. Obtain i) P(X>2) ii) V(X)
X -2 -1 0 1 2 3    ,    P(X) 0.1 0.2 0.2 0.3 0.15 0.05
Solution : 
To obtain P(X>2), we need to add up the probabilities of all the values of X that are greater than 2:
P(X>2) = P(X=3) + P(X=2) = 0.15 + 0.05 = 0.2
Therefore, the probability of X being greater than 2 is 0.2.
ii) To obtain V(X), we need to use the formula:
V(X) = E(X^2) - [E(X)]^2
where E(X) is the expected value of X and E(X^2) is the expected value of X^2.
First, we calculate E(X):
E(X) = (-2)(0.1) + (-1)(0.2) + (0)(0.2) + (1)(0.3) + (2)(0.15) + (3)(0.05) = 0.4
Next, we calculate E(X^2):
E(X^2) = (-2)^2(0.1) + (-1)^2(0.2) + (0)^2(0.2) + (1)^2(0.3) + (2)^2(0.15) + (3)^2(0.05) = 1.7
Now we can substitute these values into the formula for V(X):
V(X) = E(X^2) - [E(X)]^2 = 1.7 - (0.4)^2 = 1.54
Therefore, the variance of X is 1.54.

7.In a factory 40% workers are skilled. A group of 5 workers is randomly selected from this factory. Find probability that a group consists of.
i) All skilled workers ii) At least 3 skilled workers.
Solution: 
i) To find the probability that all 5 workers are skilled, we need to find the probability of selecting 5 skilled workers from the total number of workers who are skilled.
Probability of selecting one skilled worker from the total number of workers = 0.4
Probability of selecting 5 skilled workers out of 5 workers = (0.4)^5
Therefore, the probability that all 5 workers are skilled = (0.4)^5 = 0.01024

ii) To find the probability that at least 3 workers are skilled, we need to find the probability of selecting 3 or 4 or 5 skilled workers from the total number of workers.

Probability of selecting three skilled workers out of 5 workers = (0.4)^3 x (0.6)^2 x 10 = 0.3456 where 10 is the number of ways of selecting 3 workers out of 5 workers.
Probability of selecting four skilled workers out of 5 workers = (0.4)^4 x (0.6)^1 x 5 = 0.0768
where 5 is the number of ways of selecting 4 workers out of 5 workers.
Probability of selecting five skilled workers out of 5 workers = (0.4)^5 x (0.6)^0 x 1 = 0.01024 where 1 is the number of ways of selecting 5 workers out of 5 workers.
Therefore, the probability that at least 3 workers are skilled = 0.3456 + 0.0768 + 0.01024 = 0.43264.
Hence, the probability that a group of 5 workers consists of all skilled workers is 0.01024 and the probability that a group of 5 workers consists of at least 3 skilled workers is 0.43264.


8.Fit a Binomial distribution to the following data
X 0 1 2 3 4 5
F 10 10 30 25 15 10
To fit a Binomial distribution, we need to know the number of trials and the probability of success for each trial. In this case, we don't have that information directly, but we can estimate it from the data.
Let's start by finding the total number of trials. We can do this by adding up the frequencies: n = 10 + 10 + 30 + 25 + 15 + 10 = 100
Next, we need to estimate the probability of success for each trial. Recall that the Binomial distribution represents the number of successes in a fixed number of trials, where each trial has the same probability of success. So, we need to think about what the "success" would be in this case. One way to approach this is to consider the distribution as a count of successes out of 5. For example, if we assume that the data represents the number of successes out of 5 trials, then we can estimate the probability of success as the mean number of successes divided by 5:
p = (110 + 230 + 325 + 415 + 510) / (5100) = 2.45/5 = 0.49
With these values, we can now fit a Binomial distribution to the data. The Binomial distribution with parameters n and p is given by:
P(X = k) = (n choose k) p^k (1-p)^(n-k)
where "n choose k" is the binomial coefficient.
Using our estimated values for n and p, we can compute the probabilities for each value of k:
k P(X = k)
0 0.00001024
1 0.00144900
2 0.02008114
3 0.13566406
4 0.35604104 
5 0.30875352
These probabilities represent the expected frequencies of each value of k, under the assumption that the data follows a Binomial distribution. We can compare these expected frequencies to the observed frequencies to see how well the distribution fits the data.