TU Wien:Statistik und Wahrscheinlichkeitstheorie UE (Bura)/Übungen 2020W/HW06.1

Aus VoWi
Zur Navigation springen Zur Suche springen

CPU workload[Bearbeiten | Quelltext bearbeiten]

The CPU workloads (in %) of a processor were observed eight times and gave

25,13,7,9,44,3,2,33

Find all empirical (a) medians, (b) third quartiles and (c) 1/3-quantiles.

Lösungsvorschlag von Friday[Bearbeiten | Quelltext bearbeiten]

--Friday Sa 30 Jan 2021 17:06:04 CET

# Statistics and Probability HW #6
# Friday 
# Duedate: 16.11.2020

# Problem 1 - CPU workload
# The CPU workloads (in %) of a processor were observed eight times and gave:
# 25,13,7,9,44,3,2,33
workloads <- c(25, 13, 7, 9, 44, 3, 2, 33)
boxplot(workloads, horizontal = TRUE, range = 0)

neares_values = function(list, target) {
  c(max(workloads[workloads<=target]), min(workloads[workloads>=target]))
}

# Problem 1a)
# Find all empirical medians.
result_1a <- neares_values(workloads, median(workloads))
result_1a

# Problem 1b)
# Find all third quartiles.
result_1b <- neares_values(workloads, quantile(workloads, 3/4))
result_1b

# Problem 1c)
# Find all 1/3 quantiles.
result_1c <- neares_values(workloads, quantile(workloads, 1/3))
result_1c