Created
September 3, 2016 09:34
-
-
Save bartosz-witkowski/8c9879702aaed92042cf6bed8f657c67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def f(w: Int, b: Int): Double = 0.5 * (w / (w + b)) + 0.5 * ((50 - w)/(100 - w - b)) | |
val wbs = (for (w <- 0 to 50; b <- 0 to 50) yield (w, b)).tail | |
wbs.map { t => (t, f(t._1, t._2)) }.maxBy(_._2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment