Approved

Wow nicee

• ###### monadiuscommented on "Probability #1 : The Infinite Spinning Wheel" kata

I added a note about rounding and floating-point arithmetic to the description.

• ###### monadiusresolved an issue on "Probability #1 : The Infinite Spinning Wheel" kata

Rounding down is a well-defined mathematical operation. The description does not mention floating-point arithmetic anywhere. It is possible to solve this kata without floating-point arithmetic. I approved this kata in its current form to teach users about these facts and I am not going to revert my decision.

"If it is required to calculate the exact result then it should be mentioned in the description (and tested)."
It is mentioned in the description (the problem is described in mathematical terms such that only one correct answer is possible) and it is tested. But I admit that tests are not perfect because it is impossible to generate very long input strings.

• ###### Voilecreated an issue for "Probability #1 : The Infinite Spinning Wheel" kata

As mentioned below: This kata is affected by floating point error.

"There is a method to compute the exact result without rounding errors" is not an excuse here since nothing in the kata mandates doing this, it's just a nasty death trap for people who choose a viable approach that you didn't want. If it is required to calculate the exact result then it should be mentioned in the description (and tested).

• ###### MikChancommented on "Probability #2 : The "not" Infinite Spinning Wheel" kata

iirc, it was the same the last time

• ###### dfhwzeresolved a suggestion on "Probability #2 : The "not" Infinite Spinning Wheel" kata

approved by someone

• ###### dolamrothcreated a question for "Probability #2 : The "not" Infinite Spinning Wheel" kata

Is there a reason, why probabilities (in percentages) are rounded down this time?

• ###### monadiuscommented on "Probability #1 : The Infinite Spinning Wheel" kata

Consider the following use case: represent the chance of winning visually with 1% corresponding to 1 pixel. Then it is natural to require to round down results. And it is desirable to compute all values as precisely as possible to avoid visual glitches.

Another example. Consider this kata about solving differential equations. It seems like it does not have any rounding requirements. But in fact, rounding requirements are there for the number of elements in the output. In general, rounding is unavoidable for many floating-point computations.

My position can be summarized as follows: If a problem is well-defined mathematically and if it is not very difficult to compute the final result precisely, then approximate equality should not be required.

• ###### monadiuscommented on "Probability #1 : The Infinite Spinning Wheel" kata

Sorry, I missed the second part of your message. You are absolutely right that more tests are necessary to eliminate approximate solutions. Unfortunately, it is not possible to test cases like `82.999999998859%` because they require very long input strings.

• ###### monadiusresolved a suggestion on "Probability #1 : The Infinite Spinning Wheel" kata

The problem is well-defined mathematically. Floating-point numbers are not mentioned anywhere in the description. And it is possible to solve this kata without them.

Moreover, in many real-life situations floating-point numbers cannot be used directly. Final results have to be rounded to some integer (or even boolean) values. That's the point which this kata tries to teach (at least that was my motivation when I approved this kata).

• ###### chustos96commented on "Probability #1 : The Infinite Spinning Wheel" kata

i don't think the value is 66 but it appeared that way, that's why i found it weird, in the attempt appeared 60 and I could pass