R公平骰子的概率

R公平骰子的概率,r,R,考虑一个实验,其中包括投掷100个普通骰子并添加 把每个骰子的结果加起来。计算平均结果 我怎样才能在R工作室里做到这一点, 以及如何在Rstudio中绘制概率分布图欢迎来到堆栈溢出。通常这不是一个用于编程任务的平台。在解决你的问题时,你必须表现出一些努力。因此,您必须尝试自己解决问题,并在遇到问题时显示一些代码。此外,这不是R或其他编程语言的教程 请花些时间,看看一般情况,特别是关于R的问题 然而: #定义卷数 我只是举个例子 X代表正态分布pdf的自变量,将X视为Z分数也很有用。让我向你们展示

考虑一个实验,其中包括投掷100个普通骰子并添加 把每个骰子的结果加起来。计算平均结果

我怎样才能在R工作室里做到这一点,
以及如何在Rstudio中绘制概率分布图欢迎来到堆栈溢出。通常这不是一个用于编程任务的平台。在解决你的问题时,你必须表现出一些努力。因此,您必须尝试自己解决问题,并在遇到问题时显示一些代码。此外,这不是
R
或其他编程语言的教程

请花些时间,看看一般情况,特别是关于
R
的问题

然而:

#定义卷数

我只是举个例子

X代表正态分布pdf的自变量,将X视为Z分数也很有用。让我向你们展示我用dnorm绘制正态分布的pdf的意思

z_scores <- seq(-3, 3, by = .1) # First I'll make a vector of Z-scores

# Let's make a vector of the values the function takes given those Z-scores.
# Remember for dnorm the default value for mean is 0 and for sd is 1.

dvalues <- dnorm(z_scores) 

# Now we'll plot these values
plot(dvalues, # Plot where y = values and x = index of the value in the vector
     xaxt = "n", # Don't label the x-axis
     type = "l", # Make it a line plot
     main = "pdf of the Standard Normal",
     xlab= "Z-score") 

# These commands label the x-axis
axis(1, at=which(dvalues == dnorm(0)), labels=c(0))
axis(1, at=which(dvalues == dnorm(1)), labels=c(-1, 1))
axis(1, at=which(dvalues == dnorm(2)), labels=c(-2, 2))

z_分数欢迎来到SO。如果您包含您尝试过的代码,那么帮助您会更容易。退房