Download as pdf or txt
Download as pdf or txt
You are on page 1of 54

NAME: DHRUVI SETHI

ROLL NO.: N236


SAP ID: 70472019247

MPSTME, SVKM’s NMIMS, Shirpur


Department of Computer Engineering
Name: DHRUVI SETHI Year: 2021-22
Roll No: N236 Class: MBA TECH A2 Branch: CS
SAP: 70472019247 Subject: PROBABILTY AND STATISTICS

Programming Assignment 4
Topic: Discrete Probability distributions-2

Note:
1. All the questions are compulsory.
2. Students shall paste the screenshots (code and output) immediately after the given
questions.
3. The implementation shall be in any language of student’s choice.
4. They shall upload this assignment on web Portal with the file name
“PSA2_Rollnumber.doc”

Part-A

The binomial distribution is a finite discrete distribution. The binomial distribution arises in
situations where one is observing a sequence of what are known as Bernoulli trials. A Bernoulli
trial is an experiment which has exactly two possible outcomes: success and failure. Further the
probability of success is a fixed number p which does not change no matter how many times we
conduct the experiment. A binomial distributed variable counts the number of successes in a
sequence of N independent Bernoulli trials. The probability of a success (head) is denoted by p.
For N trials we can obtain between 0 and N successes.
Poisson distribution is a probability distribution that is used to show how many times an event is
likely to occur over a specified period. In other words, it is a count distribution. Poisson
distributions are often used to understand independent events that occur at a constant rate within a
given interval of time. It was named after French mathematician Simon Denis Poisson. The
Poisson distribution is a discrete function, meaning that the variable can only take specific values
in a (potentially infinite) list. Put differently, the variable cannot take all values in any continuous
range. For the Poisson distribution (a discrete distribution), the variable can only take the values
0, 1, 2, 3, etc., with no fractions or decimals.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247

Part-B
1. The probability of entering students in chartered accountant will graduate is 0.5. Determine
the probability that out of 10 students
i. None
ii. One
iii. At least one will graduate
Write a R program for above problem.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247

2. Find binomial distribution if the mean is 5 and variance is 10/3.


Write a R program for above problem. Also write a R program to plot probability
distribution and cumulative probability distribution.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247

3. The number of traffic accidents that occur on a particular stretch of road during a month
follows a Poisson distribution with a mean of 7.6. Find the probability that
i. less than three accidents will occur next month on this stretch of road.
ii. Exactly three accidents will occur next month on this stretch of road.
Write a R program for above problem.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247

4. The probability that on joining engineering college, a student will not successfully
complete the course of studies is 2/5. Determine the probability that out of 5 students
joining the college: i) none, ii) at least 2 will successfully complete the course.

Write a R program for above problem.


NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247

5. If the probability of recovering loan amount according to repayment schedule is 0.8 for a
particular category of loans. What is the probability of recovering at least 4 out of 6 loans
sectioned in this category? Also calculate the expected number of recoveries and the
extent of variation, k
Write a R program for above problem.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247

6. Out of 800 families with 5 children each, how many would be expected to have
i) 3 boys and 2 girls (ii) 5 girls (iii) 5 boys?
Write a R program for above problem.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247

7. Between the hrs of 2 and 4 PM the average number of phone calls per minute coming into
the switch board of a company is 2.5. Find the probability that during a particular minute
there will be (i) no phone calls, (ii) 4 or less calls and (iii) more than 6 calls.
Write a R program for above problem.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247

8. In the inspection of tin plates produced by a continuous electrolytic process, 0.2


imperfection is spotted on the average per minute. Find the probability of spotting:
a) One imperfection in 3 minutes
b) At least 2 imperfections in 5 minutes
c) At most 1 imperfection in 15 minutes.
Write a R program for above problem.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

MPSTME, SVKM’s NMIMS, Shirpur


Department of Computer Engineering
Name: DHRUVI SETHI Year: 2021-22
Roll No: N236 Class: MBA TECH A Branch: CS
SAP: 70472019247 Subject: PROBABILITY AND STATISTICS

Programming Assignment 5
Topic: Continuous Probability distributions-1

Note:
1. All the questions are compulsory.
2. Students shall paste the screenshots (code and output) immediately after the given
questions.
3. The implementation shall be in any language of student’s choice.
4. They shall upload this assignment on web Portal with the file name
“PSA2_Rollnumber.doc”

Part-A

The multinomial distribution is the type of probability distribution used in finance to


determine things such as the likelihood a company will report better-than-expected
earnings while competitors report disappointing earnings. The term describes calculating
the outcomes of experiments involving independent events which have two or more
possible, defined outcomes. The more widely known binomial distribution is a special type
of multinomial distribution in which there are only two possible outcomes, such as true/false
or heads/tails.
Normal distribution, also known as the Gaussian distribution, is a probability
distribution that is symmetric about the mean, showing that data near the mean are more
frequent in occurrence than data far from the mean. In graph form, normal distribution will
appear as a bell curve.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

Part-B
1. An experiment of drawing a random card from an ordinary playing cards deck is
done with replacing it back. This was done ten times. Find the probability of
getting 2 spades, 3 diamond, 3 club and 2 hearts

Write an R program for above problem.


NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

2. Suppose we have a bowl with 10 marbles: 2 red, 3 green and 5 blue marbles. We
randomly select 4 marbles from the bowl with replacement, what is the probability
of selecting 2 green and 2 blue marbles. Write an R program for above problem.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

3. A firm has been monitoring its total daily telephone usage. The daily use of time
(measured in hrs.) conforms to the following pdf:
3
(4 − 𝑥), 0 ≤ 𝑥 ≤ 4
𝑓(𝑥) = 64 𝑥
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
a) Graph density function,
b) Find the expected daily telephone usage and also calculate variance of it.
c) Find the probability that the time telephone usage by the firm will exceeds two
hrs. for a selected week,
d) The current budget of the firm covers only 3 hrs. of daily telephone usage, how
often will the budgeted figure be exceeded?
Write an R program for above problem.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

4. The distribution function of the random variable 𝑥, the time (in months) from the
diagnosis age until death for one population of AIDS patient is as follows:
.
𝐹(𝑥) = 1 − 𝑒 . , 𝑥>0
a) Find the probability density function of 𝑥
b) Plot PDF and CDF
c) Find probability that person from this population will survive between 10 to 15
months.
d) Find the probability that a randomly selected person from this population
survives at least 12 months.
Write an R program for above problem.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

5. In a sample of 1000 cases, the mean of a certain test is 14 and standard deviation
is 2.5. Assuming the distribution to be normal, find
i. How many students score between 12 and 15?
ii. How many score above 18?
iii. How many score below 8?
iv. Also find minimum marks scored by top 30% students
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

Write a R program for the above problem. Also plot the graph for each case.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

6. In a male population of 1000, the mean height is 68.16 inches and standard
deviation is 3.2 inches. How many men may be more than 6 feet (72 inches)?
Write a R program for the above problem. Also plot the graph.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

7. In an intelligence test administered to 1000 students, the average was 42 and


standard deviation was 24. Find the number of students
i. Exceeding the score 50
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

ii. Between 30 and 54


Write an R program for above problem.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

MPSTME, SVKM’s NMIMS, Shirpur


Department of Computer Engineering
Name: DHRUVI SETHI Year: 2021-22
Roll No: N236 Class: MBA TECH A Branch: CS
SAP: 70472019247 Subject: PROBABILITY AND STATISTICS
Programming Assignment 6
Topic: Continuous Probability distributions-2
Note:
1. All the questions are compulsory.
2. Students shall paste the screenshots (code and output) immediately after the
given questions.
3. The implementation shall be in any language of student’s choice.
4. They shall upload this assignment on web Portal with the file name
“PSA2_Rollnumber.doc”

Part-A
The exponential distribution is a continuous distribution that is commonly used to measure
the expected time for an event to occur. For example, in physics it is often used to
measure radioactive decay, in engineering it is used to measure the time associated with
receiving a defective part on an assembly line, and in finance it is often used to measure the
likelihood of the next default for a portfolio of financial assets. It can also be used to measure
the likelihood of incurring a specified number of defaults within a specified time period.
Gaussian distribution (also known as normal distribution) is a bell-shaped curve, and it is
assumed that during any measurement values will follow a normal distribution with an equal
number of measurements above and below the mean value. In order to understand normal
distribution, it is important to know the definitions of “mean,” “median,” and “mode.” The
“mean” is the calculated average of all values, the “median” is the value at the center point
(mid-point) of the distribution, while the “mode” is the value that was observed most
frequently during the measurement. If a distribution is normal, then the values of the mean,
median, and mode are the same. However, the value of the mean, median, and mode may
be different if the distribution is skewed (not Gaussian distribution). Other characteristics of
Gaussian distributions are as follows:
▪Mean±1 SD contain 68.2% of all values.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

▪Mean±2 SD contain 95.5% of all values.


▪Mean±3 SD contain 99.7% of all values.

Part-B

Question: Write R program for the following problems:


1. A pumping station operator observes that the demand for water at a certain
hour of the day can be modeled as an exponential random variable with a mean
of 100 cfs (cubic
feet per second).
a. Find the probability that the demand will exceed 200 cfs on a randomly
selected day.
b. What is the maximum water producing capacity that the station should
keep on line for this hour so that the demand will have a probability of
only 0.01 of exceeding this production capacity?

Ans1.

2. In a particular forest, the distance between any randomly selected tree and the
tree nearest to it is exponentially distributed with a mean of 40 feet.
a. Find the probability that the distance from a randomly selected tree to
the tree nearest to it is more than 30 feet?
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

b. Find the probability that the distance from a randomly selected tree to
the tree nearest to it is more than 80 feet given that the distance is at
least 50 feet?
c. Find the minimum distance that separates at least 50% of the trees from
their nearest neighbor.

Ans2.

3. Under average driving conditions, the life lengths of automobile tires of a


certain brand is found to follow an exponential distribution, with a mean of
30,000 miles. Find the probability that one of these tires, bought today, will last
the following numbers of miles.
a. Over 30,000 miles
b. Over 30,000 miles, given that it already has gone 15,000 miles
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

4. The service times at teller windows in a bank were found to follow an


exponential distribution with a mean of 3.4 minutes. A customer arrives at a
window at 4:00 p.m.
a. Find the probability that he will still be there at 4:02 p.m.
b. Find the probability that he will still be there at 4:04 p.m. given that he
was there at 4:02.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

5. In deciding how many customer service representatives to hire and in planning


their schedules, a firm that markets lawnmowers studies repair times for the
machines. One such study revealed that repair times have an approximately
exponential distribution, with a mean of 36 minutes.
a. Find the probability that a randomly selected repair time will be less than
10 minutes.
b. The charge for lawnmower repairs is $60 for each half hour (or part
thereof) for labor. What is the probability that a repair job will result in a
charge for labor of $120?
c. In planning schedules, how much time should the firm allow for each
repair to ensure the chance of any one repair time’s exceeding this
allowed time is only 0.01?
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

6. The magnitudes of earthquakes recorded in a region of North America can be


modeled by an exponential distribution with a mean of 2.4, as measured on the
Richter scale. Find the probabilities that the next earthquake to strike this
region will have the following characteristics.
a. It will be no more than 2.5 on the Richter scale.
b. It will exceed 4.0 on the Richter scale.
c. It will fall between 2.0 and 3.0 on the Richter scale.
d. find the probability that, of the next ten earthquakes to strike the
region, at least one will exceed 5.0 on the Richter scale.
e. The variance and standard deviation of the magnitudes of
earthquakes for this region
f. The magnitude of earthquakes that we can assured that no more than
10% of the earthquakes will have larger magnitudes on the Richter
scale.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

7. Find the following probabilities for a standard normal random variable Z.


NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

8. For a standard normal random variable Z, find a number z0 such that the
following probabilities are obtained.

9. The weekly amount spent for maintenance and repairs in a certain company
has an approximately normal distribution, with a mean of $600 and a standard
deviation of $40.
a. If $700 is budgeted to cover repairs for next week, what is the probability
that the actual costs will exceed the budgeted amount?
b. how much should be budgeted weekly for maintenance and repairs to
ensure that the probability that the budgeted amount will be exceeded in any
given week is only 0.1?
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

10. A firm that manufactures and bottles apple juice has a machine that
automatically fills bottles with 16 ounces of juice. (The bottle can hold up to 17
ounces.) Over a long period of time, the average amount dispensed into the
bottle has been 16 ounces. However, there is variability in how much juice is
put in each bottle; the measurements have a standard deviation of one ounce.
If the ounces of fill per bottle can be assumed to be normally distributed, find
the probability that the machine will overflow any one bottle.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

11. A machining operation produces steel shafts were diameters have a normal
distribution, with a mean of 1.005 inches and a standard deviation of 0.01 inch.
Specifications call for diameters to fall within the interval 1.00 ± 0.02 inches.
What percentage of the output of this operation will fail to meet specifications?

12. Wires manufactured for a certain computer system are specified to have a
resistance of between 0.12 and 0.14 ohm. The actual measured resistances of
the wires produced by Company A have a normal probability distribution, with
a mean of 0.13 ohms, and a standard deviation of 0.005 ohms.
a. What is the probability that a randomly selected wire from Company A’s
production lot will meet the specifications?
b. If four such wires are used in a single system and all are selected from
Company A, what is the probability that all four will meet the
specifications?
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

MPSTME, SVKM’s NMIMS, Shirpur


Department of Computer Engineering
Name: DHRUVI SETHI Year: 2021-22
Roll No: N236 Class: MBA TECH A Branch: CS
SAP: 70472019247 Subject: PROBABILITY AND STATISTICS
Programming Assignment 7
Topic: Gamma Distribution and Moments
Note:
1. All the questions are compulsory.
2. Students shall paste the screenshots (code and output) immediately after the given
questions.
3. The implementation shall be in any language of student’s choice.
4. They shall upload this assignment on web Portal with the file name
“PSA2_Rollnumber.doc”

Part-A

In probability theory and statistics, the gamma distribution is a two-parameter family of continuous
probability distributions. The exponential distribution, Erlang distribution, and chi-square distribution
are special cases of the gamma distribution. There are two different parameterizations in common
use: With a shape parameter k and a scale parameter θ. With a shape parameter α = k and an inverse
scale parameter β = 1/θ, called a rate parameter. In each of these forms, both parameters are positive
real numbers.
The gamma distribution has been used to model the size of insurance claims and rainfalls. This means
that aggregate insurance claims and the amount of rainfall accumulated in a reservoir are modelled
by a gamma process – much like the exponential distribution generates a Poisson process. It is also
used to model errors in multi-level Poisson regression models, because a mixture of Poisson
distributions with gamma distributed rates has a known closed form distribution, called negative
binomial. In wireless communication, the gamma distribution is used to model the multi-path fading
of signal power.
In mathematics, the moments of a function are quantitative measures related to the shape of the
function's graph. If the function represents mass, then the first moment is the center of the mass, and
the second moment is the rotational inertia. If the function is a probability distribution, then the first
moment is the expected value, the second central moment is the variance, the third standardized
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

moment is the skewness, and the fourth standardized moment is the kurtosis. The mathematical
concept is closely related to the concept of moment in physics.

Part-B

Question: Write R program for the following problems:


1. Find the probability that the value of a RV will exceed 4, if it has a Gamma distribution with
i. λ=1/3 and k=2
ii. λ=1/4 and k=3.
Write a R program for the above problem.

2. Suppose that the time ( in hours) taken by a home owner to mow his lawns is a random variable
𝑥 having a gamma distribution with parameters 𝑘 = 2, 𝜆 = 2. Find the probability that it
takes:
a) at most 1 hour, b) at least 2 hours, c) between 0.5 and 1.5 hours to mow the lawn.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

3. In a certain city, the daily consumption of electric power in millions of kilowatt-hours can be
1
treated as random variable having a gamma distribution with parameters 𝜆 = 2 , 𝑘 = 3. If the
power plant of this city has a daily capacity of 12 million kilowatt-hours, what is the
probability that this power supply will be inadequate on any given day?

4. The lifetime 𝑥 (in months) of a computer has a gamma distribution with mean 24 months and
standard deviation 12 months. Find the probability that the computer will: a) last between 12
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

and 24 months, b) last at most 24 months, c) suppose that the test will actually be terminated
after t months, determine the value of t such that only one half of 1% of all computers would
still be functioning at termination.

5. If a random variable 𝑥 has the gamma distribution with 𝑘 = 2, 𝜆 = 1/2, find a) the mean, b)
standard deviation, c) the probability that 𝑥 will take a value less than 4.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

6. A random variable X has the following probability distribution


X=x: 0 1 2
P(X=x): 1/3 1/3 1/3,
Find the moment generating function, first four raw moments and the first four central
moments.

7. The first three moments of the distribution about the value 3 of the random variable are 2, 10,
-30 respectively. Calculate first four moments about mean and also find mean, variance and
skewness.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

4
𝑥(9 − 𝑥 2 ), 0 ≤ 𝑥 ≤ 3
8. A continuous random variable has density function 𝑓(𝑥) = {81
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Find first four moments about origin and about mean.

9. Find first four raw and central moments of eruptions from the dataset Faithful.
NAME: DHRUVI SETHI
ROLL NO.: N236
SAP ID: 70472019247
MBA TECH A2

10. Find third central moment of dataset BJ

You might also like