Water samples are collected from ten different locations alo
Water samples are collected from ten different locations along a beach, eight different slides of bacterial cultures are prepared from each water sample, and the number of bacteria on the slides is counted. The following table gives the resulting count data: Find the (sample) mean of the bacterial count. Try the MATLAB function mean(x). Find the (sample) standard deviation of bacterial count. Try the MATLAB function std(x) Find the range (i.e., the maximum and the minimum values) of the bacterial count. Try the MATLAB functions max(x), mints), and range (x). Divide the range into N = 10 equal-length segments (hereafter called \"bins\"), and for each bin, find its bounds (a_j, b_j) as well as its center c_j. Place each measured bacterial count x_i into that bin whose lower bound is less than or equal to x_i and whose upper bound is greater than x_i; thereafter, for each bin count the number of x_i assigned to it (= n_j). Plot a histogram of the measured bacterial counts using N = 10 bars. Try the MATLAB functions hist(x, N) and bar(c, n) Produce a vector Y of measured bacterial counts in which the counts arc arranged in ascending order. Determine the median of measured bacterial counts (at the center of the sorted vector Y) by writing a script that is usable for both odd and even number of samples. Try the MATLAB function median(x). Define a random variable as the bacterial count on a single slide, and estimate (i.e., determine approximately) the probability mass function of this random variable evaluated at the bin centers c_j. Estimate the (cumulative) probability distribution function of the same random variable, evaluated at the same points (i.e. argument values) c_j. Try the MATLAB function cumsum(n_j/Sigma n_j). Produce a plot of the cumulative probability distribution function (found above) as a function of its argument, in which the plot has a title, axes have a scale and a label, and the graph is piece-wise linear between points. Plot both the histogram and the cumulative probability distribution function in a single graph.
Solution
Here we first enter all the elements under a single vector as :
x =[105,97,245,163,207,134,218,199 ; 160,196,221,154,228,131,180,178 ; ........]
where each row elements are separated with a semicolon sign (;).
And to get their mean of all these 80 elements , thus entered in above row vector, we use the function mean (x)
so that it returns the value mean (x) = 162.7
That is the answer of question 1.
