There are two schools of thought on this:

X = Things that can go wrong
Y = Things that go wrong

IF X>0, THEN Y= >1

Personally, I prefer:

((U+C+I) x (10-S))/20 x A x 1/(1-sin(F/10))

U = Urgency
C = Complexitty
I = Importance
S = Skill
A = Aggrevation (set at 0.7)
F = Frequency
(Each between 0 and 9)

This gives you an answer between 0 and 8.6 – the higher, the more likely bad luck is!