Browsing resource, all submissions are temporary.
a. Run the following commands:
x <- c(1,2,3,4) y <- c(0,1,1,0) plot(x,y) polygon(x,y,col="blue")
What do you see? A blue pentagon A blue rectangle Two blue right-angled triangles separated by a white rectangle A blue trapezoid with vectices at (1,0), (2,1), (3,1) and (4,0)
b. Run the following commands:
x1 <- -1 y1 <- 0 x2 <- 1.5 y2 <- 0 xcurve <- c(-1,0,1.5) ycurve <- dnorm(xcurve) x <- c(x1, xcurve, x2) y <- c(y1, ycurve, y2) curve(dnorm(x), xlim=c(-3,3)) polygon(x,y, col="gold")
What do you see? The standard normal curve between x = -1 and x = 1.5 is missing and is replaced by a 5-sided gold polygon. A 5-sided polygon shaded with gold color with 2 vectices on the x-axis and 3 vectices on the standard normal curve. Only the standard normal curve is plotted. An error message: "gold" is an invalid color. No plot is shown.
c. Run the following commands:
xstart <- 1.2 ystart <- 0 xend <- 4 yend <- 0 xcurve <- seq(xstart, xend, length.out=100) ycurve <- dnorm(xcurve) x <- c(xstart, xcurve, xend) y <- c(ystart, ycurve, yend) curve(dnorm(x), xlim=c(-xend,xend)) polygon(x,y, col="skyblue")
What do you see? The region above the standard normal curve with 1.2 < x < 4 is shaded with skyblue color The region under the standard normal curve with 1.2 < x < 4 is shaded with skyblue color The region with 1.2 < x < 4 (both above and below the curve) is shaded with skyblue color The region under the standard normal curve with -4 < x < 1.2 is shaded with skyblue color The region under the standard normal curve with -4 < x < 4 is shaded with skyblue color