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

Aus VoWi
Zur Navigation springen Zur Suche springen

Boxplot[Bearbeiten | Quelltext bearbeiten]

Two novel randomized algorithms (A and B) are to be compared regarding their running time. Both algorithms were executed n times. The running times (in seconds) are stored in the file algorithms.Rdata

  • (a)  Set the working directory and load the data using load(). Create a boxplot to compare the running times. Color the boxes and add proper notations (axes notations, title etc.). More info via ?boxplot
  • (b)  Comment on the following statements / questions only using the graphic
    • (a)  The third quartile of the times in A was about?
    • (b)  the interquartile range of the times in B is about trice the interquartile range of A
    • (c)  Is n = 100?
    • (d)  More than half of the running times in B were faster than 3/4 of the running times in A
    • (e)  At least 50% in A were faster than the 25% slowest in B
    • (f)  At least 60% in A were faster than the 25% slowest in B

Lösungsvorschlag von Friday[Bearbeiten | Quelltext bearbeiten]

--Friday Sa 30 Jan 2021 17:08:13 CET

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

# Problem 2 - Boxplot
# Two novel randomized algorithms (A and B) are to be compared regarding their 
# running time. Both algorithms were executed n times. The running times 
# (in seconds) are stored in the file algorithms.Rdata

# Problem 2a)
# Set the working directory and load the data using load(). Create a boxplot to 
# compare the running times. Color the boxes and add proper notations 
# (axes notations, title etc.). More info via ?boxplot
setwd(getwd())
load("algorithms.Rdata")
boxplot(runningtimes, 
        horizontal = TRUE, 
        range = 0,
        col = c("lightpink", "lightgreen"),
        main="Running times",
        xlab="time [seconds]",
        ylab="Algorithms",
        names = c("A", "B")
        )

# Problem 2b)
# Comment on the following statements / questions only using the graphic:

# Problem 2ba)
# The third quartile of the times in A was about?
# Solution: About 29.

# Problem 2bb)
# The interquartile range of the times in B is about trice the interquartile 
# range of A?
# Solution: No, more like double.

# Problem 2bc)
# Is n = 100?
# Solution: No.

# Problem 2bd)
# More than half of the running times in B were faster than 3/4 of the running 
# times in A
# Solution: No.

# Problem 2be)
# At least 50% in A were faster than the 25% slowest in B
# Solution: Yes.

# Problem 2bf)
# At least 60% in A were faster than the 25% slowest in B
# Solution: Yes.