- c(13, 23, 21, 27, 37, 52, 34, 42, 31, 40, 54, 30, 15, 35, 19, 23, 22, 18) Fine the vector y by the assignment - cumsum(x) fine the variable w using the assignment <-714-y

Linear Algebra: A Modern Introduction
4th Edition
ISBN:9781285463247
Author:David Poole
Publisher:David Poole
Chapter1: Vectors
Section1.3: Lines And Planes
Problem 18EQ
icon
Related questions
Question
Mickey Mantle played for the New York Yankees for 18 years from 1951 to 1968. Year by year he hit the following numbers of home runs: 13, 23,
21, 27, 37, 52, 34, 42, 31, 40, 54, 30, 15, 35, 19, 23, 22, 18. We represent these as a vector x in R by making the following assignmemt:
x <-c(13, 23, 21, 27, 37, 52, 34, 42, 31, 40, 54, 30, 15, 35, 19, 23, 22, 18)
Define the vector y by the assignment
y <- cumsum(x)
Define the variable w using the assignment
w <-714-y
Define z with the assignment
z <-c(X,Y,W)
x, y, w and z are vectors. Answer the following using R code.
f) What is the 18th element of w? (value of w[18]) 1
h) Calculate the sample variance of 5*x 713.268
i) What is the length(# of elements) in 5*x|
j) How many unique(different) values are in z? 49
X
X
Transcribed Image Text:Mickey Mantle played for the New York Yankees for 18 years from 1951 to 1968. Year by year he hit the following numbers of home runs: 13, 23, 21, 27, 37, 52, 34, 42, 31, 40, 54, 30, 15, 35, 19, 23, 22, 18. We represent these as a vector x in R by making the following assignmemt: x <-c(13, 23, 21, 27, 37, 52, 34, 42, 31, 40, 54, 30, 15, 35, 19, 23, 22, 18) Define the vector y by the assignment y <- cumsum(x) Define the variable w using the assignment w <-714-y Define z with the assignment z <-c(X,Y,W) x, y, w and z are vectors. Answer the following using R code. f) What is the 18th element of w? (value of w[18]) 1 h) Calculate the sample variance of 5*x 713.268 i) What is the length(# of elements) in 5*x| j) How many unique(different) values are in z? 49 X X
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer