Skip to content

Instantly share code, notes, and snippets.

@LuxXx
Created December 19, 2017 13:36
Show Gist options
  • Save LuxXx/f83a751bdf97adb9cde0f15ba3a89d26 to your computer and use it in GitHub Desktop.
Save LuxXx/f83a751bdf97adb9cde0f15ba3a89d26 to your computer and use it in GitHub Desktop.
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