And that's fine, because inside of curly braces can you redeclare variables with the same name if you intend to quote unquote shadow the previous variable.
那是可以的,因为,在花括号里面,你可以重新定义一个,相同名字的变量,如果你想引用之前的变量。
in this global environment.
这里定义了一个全局变量。
For example, the experiment could be tossing a coin, I will call the outcome heads the number one, and I'll call the outcome tails the number zero, so I've just defined a random variable.
比方说,抛硬币的试验,我将正面向上的结果对应数字1,反面向上的结果对应数字0,这样我就定义了一个随机变量
Well, this block here on the left that I came counter counter=0 up with arbitrarily sets a variable called counter equal to 0 and then it forever says that counters value 1 and then it changes the counter by 1.
大家看一下左边的这一段代码,其中有一个随便定义的变量,它会一直显示counter的值,每显示一次,counter加。
You have discrete random variables, like the one I just defined, or there are also--which take on only a finite number of values-- and we have continuous random variables that can take on any number of values along a continuum.
就像刚定义的,是一个离散型随机变量,随机变量还可以有无限种取值,也就是连续型随机变量,随机变量可以取某一区间的一切值
So declare as we'll say a variable, a placeholder called counter.
首先要定义一个名为counter的,变量。
The basic definition-- the expected value of some random variable x--E--I guess I should have said that a random variable is a quantity that takes on value.
最基本的定义,某一个随机变量X的期望值E,我应该提到过,随机变量是一个可以取值的数
应用推荐