5,588 reputation
52040
bio website
location California
age
visits member for 3 years, 5 months
seen Jul 19 at 20:55

A mediocre professor at a top-notch university making mediocre contributions to this top-notch community


Apr
30
comment Interesting approximations? ($\pi$, $e$, etc.?)
Is there a question here?
Apr
28
answered Simple or maybe not so simple probabilistic question
Apr
28
comment Calculating the highest possible damage achievable using 6 items from a pool of ~25
@Shawn: Yuval used the standard method to count combinations with repetitions. See en.wikipedia.org/wiki/…
Apr
26
revised Calculating the highest possible damage achievable using 6 items from a pool of ~25
added 130 characters in body
Apr
26
comment Calculating the highest possible damage achievable using 6 items from a pool of ~25
@Shawn: Just test the cost in the inner loop and include the item-set only if the cost is under the budget. By the way, the folks around here are very helpful and friendly, but to be honest I think your question would find a better home on stackoverflow or programmers.SE. Cheers!
Apr
26
revised Calculating the highest possible damage achievable using 6 items from a pool of ~25
Allow duplicate combos in the code example
Apr
26
comment Calculating the highest possible damage achievable using 6 items from a pool of ~25
@Shawn: if you want to allow a,a,a,a,a,a then start each for loop at the value before it (rather than the value + 1). I edited my code above to do this. It increases the number of total loops to 593,775 from 177,100.
Apr
26
comment Calculating the highest possible damage achievable using 6 items from a pool of ~25
I was assuming that you have a set of helm, shoulder, bracer, glove, chest, and leg items and that you couldn't equip a given item other than in its proper slot. If you want to avoid repetitions, use the code above which will give you the 177,100 unique sets of 6 items taken from 25.
Apr
26
revised Calculating the highest possible damage achievable using 6 items from a pool of ~25
add some code
Apr
26
answered Calculating the highest possible damage achievable using 6 items from a pool of ~25
Apr
26
comment Computing the integral of $e^{-x^2}$ over the entire line
@Arturo & Ross: both links give the same proof... which is indeed quite slick. Cheers. (I would delete my question now, but it already has an answer, so this is disallowed.)
Apr
26
asked Computing the integral of $e^{-x^2}$ over the entire line
Apr
24
comment Run of $N$ successes before run of $k$ failures
Google found a math.SE question that was 45mins old when you searched? Wow.
Apr
21
comment How to rotate n individuals at a dinner party so that every guest meets every other guests
You might want to check out en.wikipedia.org/wiki/Combinatorial_design
Apr
21
awarded  Quorum
Apr
20
comment Calculate which day of the week a date falls in using modular arithmetic
I actually teach this algorithm in my algorithms class; it's useful in real life to be able to do this!
Apr
18
comment Motivation for the Math Required for Computer Science
@Taylor: Your question would resonate more with people here (and you would likely get a better answer) if you were more specific. Try changing the Title and some of the text to a more specific question like "what is a real-world application of Bayes' Theorem" for example.
Apr
18
revised Motivation for the Math Required for Computer Science
edited tags
Apr
16
awarded  Good Question
Apr
16
comment Deleting any digit yields a prime… is there a name for this?
@Martijn I intended that the original number be prime as well; edited to clarify this.