BaşlayınÜcretsiz Başlayın

Graphing the probability that a machine still works

If you were a supervisor at the factory with the unreliable machine, you might want to understand how likely the machine is to keep working over time. In this exercise, you'll plot the probability that the machine is still working across the first 30 days.

Bu egzersiz

Foundations of Probability in R

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Calculate a vector of probabilities of whether the machine is still working on each day from day 1 to 30, and save it as still_working. You can do this with a single call to pgeom() by passing in a vector of numbers as the first argument. The machine has a 10% chance of breaking each day.
  • Run the command qplot(still_working) to graph the probability of the machine still working on each of the first 30 days, with the day on the x-axis and the probability on the y-axis.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Calculate the probability of machine working on day 1-30
still_working <-

# Plot the probability for days 1 to 30
qplot(1:30, still_working)
Kodu Düzenle ve Çalıştır