Created
December 19, 2017 13:36
-
-
Save LuxXx/f83a751bdf97adb9cde0f15ba3a89d26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def abschreiber(n): | |
ab = [0] * n | |
for i in range(0, n): | |
b = random.choice([-1, 1]) | |
ab[(i+b) % n] += 1 | |
ab = list(filter(lambda x: x == 0, ab)) | |
return len(ab) / n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment