MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply TodaySearch Solutions

1 – 20 of 20 previous next

221Size

0 Comments

627Size

2 Comments

2 Comments

Richard Zapor
on 24 Feb 2013

James, your speed is impacted by recalculating previously evaluated cases. A case of 100 v 100 finished in ??

James
on 26 Feb 2013

You're correct. It is inefficient with super-large armies. I was going for an exact solution (which was an offshoot of the original problems I had with the test suite), and recursion seemed to be the best way to do it.
As our resident "Get this problem to run faster" expert, do you think setting up a global m-by-n matrix with previously calculated probabilities would help things?

112Size

0 Comments

125Size

0 Comments

142Size

0 Comments

240Size

0 Comments

256Size

0 Comments

267Size

0 Comments

298Size

0 Comments

343Size

0 Comments

143Size

0 Comments

147Size

0 Comments

147Size

0 Comments

147Size

0 Comments

147Size

0 Comments

143Size

0 Comments

143Size

0 Comments

143Size

0 Comments

143Size

0 Comments

143Size

0 Comments

1 – 20 of 20 previous next