Given the following set of numbers x 1 4 6 8 7 12 20 0 Writ

Given the following set of numbers x = (1 4 6 -8 7 12 -20 0] Write one statement for each using logical operators and built in functions to find: a) number of elements in x greater than zero b) number of elements in x less than the mean of x c) number of elements in x equal to or greater than the mean d) number of elements in x less than zero

Solution

a) number of elements in x greater than zero= 5 (1,4,6,7,12)

b)the mean value is = (1+4+6-8+7+12-20+0)/8=2/8=0.25

therefore number of elements in x less than the mean=3 (-8,-20,0)

c) number of elements greater than mean= 5 (1,4,6,7,12)

d) number of elements in x less than zero= 2 (-8,-20)

 Given the following set of numbers x = (1 4 6 -8 7 12 -20 0] Write one statement for each using logical operators and built in functions to find: a) number of

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site