You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.3 模拟一个醉汉在二维空间上的随机漫步
(1). 解题思路
假设醉汉每一步的大小在x
与y
轴上的投影不超过1,在每个时刻,在x
与y
方向上都会生成一个[-1, 1]的数,然后与时刻的位置进行叠加,并把每个时刻的位置记录下来,最后就可以绘制出醉汉在二维空间上的随机漫步。
(2). 运行结果
