Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ensure prize in lottery is never negative

  • Loading branch information...
commit d7139b815056fb2cad513cdb0c857e594e363eaa 1 parent c66b1c4
@petercollingridge petercollingridge authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 exercises/expected_value.html
View
6 exercises/expected_value.html
@@ -191,11 +191,11 @@
<div id="lottery" data-weight="2">
<div class="vars">
<var id="BUY">random() &lt; 0.4</var>
- <var id="COST">randRange(2,4)</var>
+ <var id="COST">randRange(2,5)</var>
<var id="ODDS">randRange(1,5)*100</var>
<var id="PRIZE">BUY ?
- COST*ODDS + randRange(1,3)*100 :
- COST*ODDS - randRange(1,3)*100
+ COST*ODDS + randRange(1, 6) * 50 :
+ COST*ODDS - randRange(1, COST * 2 - 1) * 50
</var>
<var id="ODD_F">fraction(1,ODDS,true,true)</var>
<var id="ANS">BUY ?
Please sign in to comment.
Something went wrong with that request. Please try again.