開始使用免費開始

比較總贏款

糟糕,看起來你在賠錢。是時候重新思考並調整策略了!這需要更深入的分析……

在飯店的按摩浴缸裡稍微腦力激盪後,你意識到,一種可能的解釋是:你在輪盤的功力沒有撲克好。所以也許你在撲克的總獲利比輪盤更高(或 > )。

本練習屬於課程

R 入門

檢視課程

練習說明

  • 如同上一題,計算 total_pokertotal_roulette。請各自使用一次 sum() 函式。
  • 透過比較來檢查你在撲克的總獲利是否高於輪盤。直接印出這個比較的結果。你有什麼結論?該把重點放在輪盤還是撲克?

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Poker and roulette winnings from Monday to Friday:
poker_vector <- c(140, -50, 20, -120, 240)
roulette_vector <- c(-24, -50, 100, -350, 10)
days_vector <- c("Monday", "Tuesday", "Wednesday", "Thursday", "Friday")
names(poker_vector) <- days_vector
names(roulette_vector) <- days_vector

# Calculate total gains for poker and roulette
total_poker <-
total_roulette <-

# Check if you realized higher total gains in poker than in roulette
編輯並執行程式碼