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.

12 lines
436 B

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 2.3 模拟一个醉汉在二维空间上的随机漫步
## (1). 解题思路
假设醉汉每一步的大小在`x`与`y`轴上的投影不超过1在每个时刻在`x`与`y`方向上都会生成一个[-1, 1]的数,然后与时刻的位置进行叠加,并把每个时刻的位置记录下来,最后就可以绘制出醉汉在二维空间上的随机漫步。
## (2). 运行结果
![](images/result.png)