3
STAT 40001/ MA 59800 Statistical Computing 2015 Lab-1 Calculate the following a)47+8-13×56+78 > 47+8-13*56+78 [1] -595 b)46-87+98-57 > 46-87+98-57 [1] 0 > c)45÷5+49×67-98 > 45%%5+49*67-98 [1] 3185 > d)4+(35mod7)-9 > 4+35##%%7-9 [1] 39 > e)67÷5+9×37 > 67%%5+9*37 [1] 335 > f)|-7|+|5|+log(10) > abs(-7)+abs(5)+log(10) [1] 14.30259 >

Lab 1 Naveen Stat Comp

Embed Size (px)

Citation preview

Page 1: Lab 1 Naveen Stat Comp

STAT 40001/ MA 59800 Statistical Computing 2015

Lab-1

Calculate the following

a) 47+8-13×56+78> 47+8-13*56+78[1] -595

b) 46-87+98-57> 46-87+98-57[1] 0>

c) 45÷5+49×67-98> 45%%5+49*67-98[1] 3185>

d) 4+(35mod7)-9> 4+35##%%7-9[1] 39>

e) 67÷5+9×37> 67%%5+9*37[1] 335>

f) |-7|+|5|+log(10)> abs(-7)+abs(5)+log(10)[1] 14.30259>

g) 7+log(5)+75+45> 7+log(5)+7^5+45[1] 16860.61>

Page 2: Lab 1 Naveen Stat Comp

h) √49+67+√873

> sqrt(49)+67+sqrt(873)[1] 103.5466>

i) 78+ ln (45 )+e7

> 78+log10(45)+2.72^7(I had considered e=2.72 as an exponential value)[1] 1181.148>

j) Sort the data in decreasing order: 3, 5, 7, 2, 9, 12, 45, 23, 31, 45, 7, 82, 90, 5> x<-c(3,5,7,2,9,12,45,23,31,45,7,82,90,5)> x [1] 3 5 7 2 9 12 45 23 31 45 7 82 90 5> sort(x) [1] 2 3 5 5 7 7 9 12 23 31 45 45 82 90> sort(x,decreasing=T) [1] 90 82 45 45 31 23 12 9 7 7 5 5 3 2>

k) Sort the data in increasing order4,6,7,8,2,3,6,8,4,9,15,34,23,81,-5,-9> y<-c(4,6,7,8,2,3,6,8,4,9,15,34,23,81,-5,-9)> y [1] 4 6 7 8 2 3 6 8 4 9 15 34 23 81 -5 -9> sort(y) [1] -9 -5 2 3 4 4 6 6 7 8 8 9 15 23 34 81> sort(y,decreasing=F) [1] -9 -5 2 3 4 4 6 6 7 8 8 9 15 23 34 81>