Concept explainers
College students are usually interested in their scores on exams. The following are the scores on a statistics exam: 27, 23, 28, 38, 26, 28, 42, 50, 27, 33, 42, 44, 29, 46, 18, 28, 27, 41. We represent these as a vector x in R by making the following assignmemt:
x <- c(27, 23, 28, 38, 26, 28, 42, 50, 27, 33, 42, 44, 29, 46, 18, 28, 27, 41)
Define the vector y using the assignment y <- cumsum(x)
Define the vector w using the assignment w <- y + 2
Define z by the assignment z <- c(x,y,w)
x, y, w and z are
a) Calculate is the maximum value of z.
b) Calculate the sum of the squares of the elements in z.
c) Calculate the sample mean of z.
d) Calculate the sample variance of z.
e) Calculate the sample standard deviation of z
f) What is the 6th element of y? (value of y[6])
g) Calculate the sample variance of x.
h) Calculate the sample variance of 2*x
i) What is the length(# of elements) of z?
j) How many unique(different) values are in z?
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images
- Type in Latex **Problem**. Let $$A = \begin{bmatrix} .5 & .2 & .3 \\ .3 & .8 & .3 \\ .2 & 0 & .4 \end{bmatrix}.$$ This matrix is an example of a **stochastic matrix**: its column sums are all equal to 1. The vectors $$\mathbf{v}_1 = \begin{bmatrix} .3 \\ .6 \\ .1 \end{bmatrix}, \mathbf{v}_2 = \begin{bmatrix} 1 \\ -3 \\ 2 \end{bmatrix}, \mathbf{v}_3 = \begin{bmatrix} -1 \\ 0 \\ 1\end{bmatrix}$$ are all eigenvectors of $A$. * Compute $\left[\begin{array}{rrr} 1 & 1 & 1 \end{array}\right]\cdot\mathbf{x}_0$ and deduce that $c_1 = 1$.* Finally, let $\mathbf{x}_k = A^k \mathbf{x}_0$. Show that $\mathbf{x}_k \longrightarrow \mathbf{v}_1$ as $k$ goes to infinity. (The vector $\mathbf{v}_1$ is called a **steady-state vector** for $A.$) **Solution**. To prove that $c_1 = 1$, we first left-multiply both sides of the above equation by $[1 \, 1\, 1]$ and then simplify both sides:$$\begin{aligned}[1 \, 1\, 1]\mathbf{x}_0 &= [1 \, 1\, 1](c_1\mathbf{v}_1 +…arrow_forwardFor input vector x, write a function to check whether there exists at most 5 elements in x whose values are less than 7.arrow_forwardGiven a budget (type long) and a list of prices represented as entries of a container of type vector<long>, find out how many items on the price_list you can afford at most. This is the return value of the function. Here is its prototype: int get_most_items(std::vector<long>price_list, long budget) To solve this homework, it is a good idea to first sort the price_list in ascending order. For sorting in ascending order, you can use the function std::sort(). It can be called as std::sort(v.begin(), v.end()) .Note that there may be items on the price list whose prices are negative to make the problem a bit more interesting. If the size of price_list is zero, the function returns 0. All necessary libraries have been included. All numbers are expressed in Cents to avoid rounding errors. Here is a simple example:std::vector<long> price_list = { 10, 199, 1}; long budget = 11; int no_items = get_most_items(price_list, budget);The variable no_items will then have the…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education