【Python 編程】1D 隨機(jī)游走 1D Random Walk
By: Tao Steven Zheng (鄭濤)
A random walk is a stochastic process that describes a path that consists of a succession of random steps on some mathematical space such as the integers. The following Python code generates three 1-dimensional random walks and plots them. Each plot starts at 0 and at each step moves up (+1) or down (?1) with equal probability.
隨機(jī)游動(random walk)是一種隨機(jī)過程(stochastic process),它描述了在某些數(shù)學(xué)空間(如整數(shù))上由一系列隨機(jī)步驟組成的隨機(jī)游動。以下的 Python 代碼生成三個一維隨機(jī)游動并繪制它們。每個繪圖從 0 開始,每一步以同樣的概率可以向上(+1)或向下 (?1)移動。
?Results
結(jié)果

Looks like the stock market!
看上去像股市!
標(biāo)簽: