Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. def correlation_h2(x, y, t):
  2.     q = len(x); c = 0
  3.     for j in xrange(q):
  4.         if x[j] == y[(j - t)%q]:
  5.             c += 1
  6.     return c
  7.  
  8. x = [1, 4, 5 ,5 ,2 ,7 ,3 ,5 ,8 ,3 ,2 ,4 ,2, 1, 7, 6 ,6 ,0 ,4, 8, 6, 3, 8, 0, 7, 0]
  9. q = len(x)
  10. print ([correlation_h2(x, x, i) for i in xrange(1,q-1)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement