Statistics and Probability Answers

Questions: 18 160

Answers by our Experts: 16 242

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

in r studio
## Exponential distribution
Use the "rexp" function to sample samples of sizes in "sizes" for the binomial distribution with parameter $\lambda = 2$.
Plot the histogram of the distribution for this exponential random variable, and then plot the histograms for each of the diffent samples (use "par" to get all plots in a single frame.)
```{r}

```



## Gamma distribution
Use the "rgamma" function to sample samples of sizes in "sizes" for the binomial distribution with parameter $\alpha = 2, \beta = 0.1$.
Plot the histogram of the distribution for this gamma random variable, and then plot the histograms for each of the diffent samples (use "par" to get all plots in a single frame.)
```{r}
in r studio
## Binomial distribution.
Use the "rbinom" function to sample samples of sizes in "sizes" for the binomial distribution with parameter $n=30, p = 0.4$.
Plot the histogram of the distribution for this binomial random variable, and then plot the histograms for each of the diffent samples (use "par" to get all plots in a single frame.)
```{r}

```


## Normal distribution.
Use the "rnorm" function to sample samples of sizes in "sizes" for the binomial distribution with parameter $\mu=5, \sigma = 1.2$.
Plot the histogram of the distribution for this normal random variable, and then plot the histograms for each of the diffent samples (use "par" to get all plots in a single frame.)
```{r}

```
in r studio
# Sampling from Distributions.
When simulating experiments, we will need to derive random samples from population with a fix distribution.

In this exercise, we will derive samples of different sizes from a fixed distribution, then construct the histogram for the sample values.
One would hope that as the size of the sample increases, the distribution of the sample will look more like the distribution of the population.
We will be using the plot functions for various distributions that we have constructed so far.

Set the sample sizes vector be set as follows:
```{r}
sizes <- c(5, 10, 20, 30, 50, 200, 10000)
```
in r studio
## The Chi-Squared Distribution
Recall that the Chi-Squared distribution is defined by the $\nu$ parameter.
The density function of the gamma distribution with parameters $\alpha = \frac{\nu}{2}$ and $\beta = 2$ gives the density for the Chi-Squared distribution.

For $\nu = 5, 10, 20, 30, 50, 100$ plot the Chi-Squared distribution in a single plot.

```{r}

```

Note at least two observations about this plot.
in R studio
## The Exponential Distribution
The density funtion for the exponential distribution is "dexp" with parameter $\lambda$.
Note that the parameter $\lambda$ defined in class is denoted by the "rate" parameter in the R-function "dexp".

Write a function plot_exp that takes input the "rate" parmeter, and outputs a plot of the exponential distribution.
Also write a function lines_exp that inputs the "rate" parameter, and ouputs a plots that will overlay on the plot_exp output.

```{r}
#plot_exp

#lines_exp
```

Use the plot_exp, lines_exp, and a for loop, to plot the density of the exponetial distribution for lambda values $\lambda = 5, 3, 2, 1, 0.5, 0.1$ in a single plot.

```{r}
lambdas <- c(5, 3, 2, 0.5, 0.4)
```
In R studio
# The Gamma Family
The Gamma distribution is defined using two parameter $\alpha$ (the shape parameter) and $\beta$ (the scale parameter).
We will try to visualize the gamma distribution for different choices of $\alpha$ and $\beta$.
A random variable that that has the gamma distribution as it's probability distribution will be called a gamma random variabe.
Note the values of the gamma random variable are the set of all positive real numbers.
Since the density funtion for the gamma random variable take very small values when $x$ gets large, when plotting this distribution, we fix the range of $x$ to be between 0 and 6.
The average life of a certain type of small motor is 10 years with a side of 2 yrs. The manufacturer replaces free all motors that fail while under guarantee. If he is willing to replace only 3% of the motors that fail how long a guarantee should be offer? Assume that the lifetime ofa motor follows normal distribution.
The Crown Bottling Company has just installed a new bottling process that will fill 15-ounce bottles of the popular Crown Classic Cola soft drink. Both overfilling and underfilling bottles are undesirable: Underfilling leads to customer complaints and overfilling costs the company considerable money. In order to verify that the filler is set up correctly, the company wishes to see whether the mean bottle fill, µ, is close to the target fill of 15 ounces. To this end, a random sample of 36 filled bottles is selected from the output of a test filler run. If the sample results cast a substantial amount of doubt on the hypothesis that the mean bottle fill is the desired 15 ounces, then the filler's initial setup will be readjusted.



(a) The bottling company wants to set up a hypothesis test so that the filler will be readjusted if the null hypothesis is rejected. Set up the null and alternative hypotheses for this hypothesis test.
Assume that we have two independent samples from two populations: n
subjects from population A and n subjects from populations B. To test if the population A
has a larger location parameter than that of population B, we can use (a) the Wilcox ranksum test or (b) the permutation test on sample means difference. What are the smallest
values of n for each test so that, at α=0.01 level, the test can reject the null hypothesis of
equal population mean? Show your calculation.
(Not asking the likelihood of rejecting the null hypothesis, just the existence of a single
data set that allows rejecting the null hypothesis.
For example, when n=1, no such data set exists.
Even if you got the following data set: one from A with value 1billion and one from B
with value zero. The two tests still can not reject the null hypothesis for this data set, at
α=0.01 level.)

The average length of time for students to register for summer classes at a certain college has been 50 minutes with a standard deviation of 10 minutes. A new registration procedure using modern computing machines is being tried. If a random sample of 12 students had an average registration time of 42 minutes with standard deviation of 11·9 minutes under the new system, test the hypothesis that the population mean has not changed.


LATEST TUTORIALS
APPROVED BY CLIENTS