6 kyu
Calculating Expected Utility
45 of 63russelljjadams
Loading description...
Algorithms
View
Career Accelerator
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Besides the annoying rounding issues it's great having these sort of katas with all of these theoretical concepts.
Python: Random tests are vulnerable to input modification
The kata needs to be rewritten with
assertApproxEquals
instead of rounding 2 decimal places, because the tests keep hitting the rounding boundary with the random tests, which means floating point error is significant here.Ruby 3.0 should be enabled. KaTeX should be used.
Encountered rounding issues in the JS version. I had to try submitting several times before passing the tests (1 or 2 fails each time). For example :
It's the same in all language versions.
The description is awfully bad: please considere that every warrior didn't study such a field, so make it understandable.
First, you don't say which one of the players is in row/column. Secondly, neither do you say how we are supposed to read those tuples.
...there I was like... "WTF!?" => strictly speaking, you're telling that a list of lists of integers is the same as a list of lists of tuples of integers. That clearly needs to be explained, how you go from the first to the second (not that hard to figure out, but hell, that's your job to explain this, not the warroir).
Edit: btw -> "can be expressed
in pythonas..." -> make the description as much "language free" as possible.-> that, we can already guess. What would be more useful is that you split the description in "Context" and "Task"
Cool kata with some economy-flavor (I studied that), brilliant explanation and created by the most restless quoran I had the fortune to met? I'm game ;)
If you don't mind, I will translate this nice work of yours into both JS and Ruby soon :)
[I must admit I was almost certain that you would have gone for a list comprehension solution, must be my competitive glands firing all they have got :D]
And JS translation just submitted, if you wish to approve it.
I noticed that you didn't follow naming conventions in Python (using
camel_case
it should beexpected_utility
); I know I am nitpicky here, but kind users like bkaes-senpai made me understand the importance of commong guidelines, plus I can fix it for you if you wish; same goes for adding a bit of random tests, if you don't mind: creating them in JS was surely fun :)Edit: Ruby version delivered too :)
You know, I go through weird phases where
camel_case
feels right, and other times when it just looks ugly. But you're right, to be more Pythonic it should beexpected_utility
. And it would be helpful if you were to help add some tests. I wrote it rather late last night and I planned to go back through and add some more tests.I know, I know. My argument is that it was really late when I started writing this kata, idk what I was thinking!
Been there, done that too ;)
You were really quick in fixing the kata; I also fixed the description with the camel case, and will add the random tests tomorrow; meanwhile thanks for approving my work and trusting me with more tests :)
Edit: on a second thought, I preferred to finish the work now; if you wish, go for some test run and let me know if they are up to your standards; otherwise no problem in fixing them.