Question

Possible surprises in R: What output may be unexpected? Why do you suppose R is is...

Possible surprises in R: What output may be unexpected? Why do you suppose R is is written to to give these results?

(a) z = c(10^-3, 10^-10, 0); z; z^0

(b) set.seed(123); s = sample(1:200, 5); max(s); min(s); range(s); diff(range(s))

0 0
Add a comment Improve this question Transcribed image text
Answer #1

z

Output=

Output = (1,1,1)

set.seed(123)

s = sample(1:200, 5)

max(s)   Output = 185

min(s)   Output = 58

range(s) Output = 58 185

diff(range(s))   Output = 127

Add a comment
Know the answer?
Add Answer to:
Possible surprises in R: What output may be unexpected? Why do you suppose R is is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • mints) Give the following examples if possible. If it is not possible, explain why. You do...

    mints) Give the following examples if possible. If it is not possible, explain why. You do not have ove the properties hold 2 points) A list of 4 vectors in Rồ that is linearly independent. (3 points) A subspace W of R* that is complementary to V = | 22 23=0, 1334=0 =) (4 points) A linear map T:R?R? with image(T) - ker(T) = span ()

  • Please do in Java as simply as possible :) Exercise #3: Design and implement a program...

    Please do in Java as simply as possible :) Exercise #3: Design and implement a program (name it ArrayMethods), that defines 4 methods as follows: int arrayMax(int[] arr) returns the maximum value in the an array int arrayMin(int[] arr) returns the minimum value in an array void arraySquared(int[] arr) changes every value in the array to its square (value²) void arrayReverse(int[] arr) reverses the array (for example: array storing 7   8   9 becomes 9   8   7 ) The program main...

  • what code in R should I use if I want to achieve 10 different outputs with the same n. n= a number that doesnt satisfies the CLT my distributions are pois(0.8) and t(2) the one I used is below but...

    what code in R should I use if I want to achieve 10 different outputs with the same n. n= a number that doesnt satisfies the CLT my distributions are pois(0.8) and t(2) the one I used is below but I don’t think it’s right if anyone can help me please resolve this code so I can do the same thing with 10 different values of n. and of that n I need to know the mean, the min, max,...

  • Instead of having a known sigma equal to 10, suppose you simply do not know what...

    Instead of having a known sigma equal to 10, suppose you simply do not know what the true population standard deviation is. Instead you compute 's', the standard deviation of your sample and find that it equals 10. Based on your data you want make predictions about what the true population mean may be. 1) Given your original sample of 100 students: between what range of values can you be 95% confident that the mean (mu) is? (20 pts) 2)...

  • L. Assume that j : R-→ R-s C and satisfies what are known as the Cauchy-Riemann equations: (c) ...

    l. Assume that j : R-→ R-s C and satisfies what are known as the Cauchy-Riemann equations: (c) Let r-(r1, 2) and (s1, s2) be vectors in IR2 and suppose that (ri, 2)f(s1, 82) and Df(81,82)メ0. Show that f-1 satisfies the Cauchy-Riemann equations when evaluated at r. (Hint: Might I make a notational suggestion: Leta(s) = sim) = % (n, s) and b(s) 쓺(81, 82) =-警( )) 81,82 (d) For this last bit, drop the assumption that f satisfies the...

  • Using R, Exercise 4 (CLT Simulation) For this exercise we will simulate from the exponential distribution....

    Using R, Exercise 4 (CLT Simulation) For this exercise we will simulate from the exponential distribution. If a random variable X has an exponential distribution with rate parameter A, the pdf of X can be written for z 2 0 Also recall, (a) This exercise relies heavily on generating random observations. To make this reproducible we will set a seed for the randomization. Alter the following code to make birthday store your birthday in the format yyyymmdd. For example, William...

  • need help on all parts please and thank you (e) What is the correct output of...

    need help on all parts please and thank you (e) What is the correct output of this code? (2 pts) >>> def func(x): >>> res = 0 >>> for i in range (len (x)): res i >>> return res >>> print (func(4)) ( 4 5 ) 6 ()7 ( What could be described as an immutable list? (2 pts) () a dimple ( ) a tuple ( ) a truffle () a dictionary (g) What is the result of the...

  • 1. Consider the complex-valued signal r(t) with Fourier transform as shown in the figure. Keep in...

    1. Consider the complex-valued signal r(t) with Fourier transform as shown in the figure. Keep in mind that there are no symmetry properties this signal satisfies in the fre- quency domain. In particular, the Fourier transform is zero for negative frequencies Suppose we impulse-train sample x(t) at the rate of 500 samples/second. 200 400 600 800 1000 FREQUENCY (Hz.) (a) Sketch the Fourier transform of the impulse-train sampled signal in the range of frequencies from -1000 Hz. to 1000 Hz....

  • work and return back. You may attempt to take the midterm twice, however you est and...

    work and return back. You may attempt to take the midterm twice, however you est and you cannot save your grade will be the average of the two if you do so! There are 16 multiple choice questions, 5 pts. each. Then you will have to answer two free response questions. type as many details as possible, so that I maybe able to give partial credit. Indicate your final answer as The ans is: for each section. Thank you. Good...

  • I need to change the following code so that it results in the sample output below...

    I need to change the following code so that it results in the sample output below but also imports and utilizes the code from the GradeCalculator, MaxMin, and Student classes in the com.csc123 package. If you need to change anything in the any of the classes that's fine but there needs to be all 4 classes. I've included the sample input and what I've done so far: package lab03; import java.util.ArrayList; import java.util.Scanner; import com.csc241.*; public class Lab03 { public...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT