File:Random Walk example.svg
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Size of this PNG preview of this SVG file: 720 × 540 pixels. Other resolutions: 320 × 240 pixels | 640 × 480 pixels | 1,024 × 768 pixels | 1,280 × 960 pixels | 2,560 × 1,920 pixels.
Original file (SVG file, nominally 720 × 540 pixels, file size: 30 KB)
File information
Structured data
Captions
Summary
[edit]This file was copied from en.wikipedia by Toobaz, what follows is its original description:
DescriptionRandom Walk example.svg | Eight different random walks. |
Date | |
Source |
I created this work entirely by myself. This W3C-unspecified plot was created with Matplotlib. |
Author | Morn (talk) |
Other versions | File:Random_Walk_example.png |
Code
[edit]Made with the following Python script (needs Matplotlib):
from pylab import *
from random import choice
numwalk = 8
length = 100
data = zeros((numwalk, length), int)
for n in range(numwalk):
for x in range(1, length):
step = choice([-1, 1])
data[n,x] = data[n,x-1] + step
plot(range(length), data[n,:])
xlabel('t')
axis ((0,100, -20, 20))
savefig('Random_Walk_example.svg')
show()
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
Original upload log
[edit]The original description page was here. All following user names refer to en.wikipedia.
- 2008-10-14 18:20 Morn 720×540× (30897 bytes) {{Information |Description= |Source=I created this work entirely by myself. |Date=2008-10-14 |Author=~~~ |other_versions= }} Made with the following Python script: <code> from pylab import * from random import choice numwalk = 8 length = 100 data = z
The following is the similar code in MATLAB and Octave
function RandomWalk () hold off; x = 1:100; color = ['y' 'g' 'b' 'k' 'r', 'm' 'c']; y(1)= 0; for m = 1:7 for n = 2:100 y(n) = y(n-1) + 2*floor(rand()*2)-1; end plot(x, y, color(m), 'LineWidth',2); hold on axis([0 100, -20 20]) end end
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 07:28, 5 February 2010 | 720 × 540 (30 KB) | Toobaz (talk | contribs) | == Summary == This file was copied from en.wikipedia by Toobaz, what follows is its original description: {{Information |Description=Eight different random walks. |Source=I created this work entirely by myself. |Date=2008-10-14 |Au |
You cannot overwrite this file.
File usage on Commons
The following page uses this file:
File usage on other wikis
The following other wikis use this file:
- Usage on ar.wikipedia.org
- Usage on bg.wikipedia.org
- Usage on cs.wikipedia.org
- Usage on de.wikipedia.org
- Usage on en.wikipedia.org
- Usage on eu.wikipedia.org
- Usage on fa.wikipedia.org
- Usage on he.wikipedia.org
- Usage on id.wikipedia.org
- Usage on it.wikipedia.org
- Usage on ms.wikipedia.org
- Usage on ps.wikipedia.org
- Usage on pt.wikipedia.org
- Usage on simple.wikipedia.org
- Usage on sr.wikipedia.org
- Usage on tr.wikipedia.org
- Usage on zh-yue.wikipedia.org
- Usage on zh.wikipedia.org