Go Back   Flash Flash Revolution > General Discussion > Critical Thinking > Homework & Help
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
Old 11-3-2013, 01:13 PM   #21
Reincarnate
x'); DROP TABLE FFR;--
Retired StaffFFR Veteran
 
Reincarnate's Avatar
 
Join Date: Nov 2010
Posts: 6,332
Default Re: [Probability] Expected hits to kill

Code:
E=[0]*(X+1)
s=0
for x in xrange(1,X+1):
    s += E[max(0,x-A)]-E[max(0,x-B-1)]
    E[x] = 1.0 + s/(B-A+1)        
print E[X]
Reincarnate is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 02:07 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution