Skip to content

Instantly share code, notes, and snippets.

@Telltak
Created April 26, 2011 16:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Telltak/942555 to your computer and use it in GitHub Desktop.
Save Telltak/942555 to your computer and use it in GitHub Desktop.
Based on Rossmo's formula (http://en.wikipedia.org/wiki/Rossmo's_formula)
#!/usr/bin/env python3
import math
crimes=[(5,4), (6,3), (5,3), (7,3)]
phi=5
f, g= 2, 2
b=3
a=0
for j in range(10):
for i in range(10):
for crime in crimes:
equation= 0
distance= (i-crime[0])+(j-crime[1])
equation+= (phi/math.pow(distance, f))
numerator= (1-phi)*math.pow(b, 8-f)
denominator= math.pow(2*b-distance, g)
equation+= (numerator/denominator)
a+=equation
print(i,',', j,': ', a)
a=0
@yoursamlan
Copy link

Created a more elaborated analysis over here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment