• ###### hanefSamsudincommented on "The Prime Probability Mystery " kata

Hello guys. I still don't understand why the result case is like that. Let me explain my view. The probability a number except 1 (because 1 and n have GFD 1 and it's prohibited for the problem) toward n where that number is a factor of n is 3 / n. For example, 21 (comes from 3 * 7) only have 4 factor. They are 1, 3, 7, and 21. And 1 is prohibited. So the total is 3. So the probability 3/n. Let me know my mistake, so I know why test case is different of my view. Lo siento, bad English.

nice!

• ###### Blind4Basicscreated a suggestion for "Prisoner's Dilemma " kata

Hi,

Would be nice if you explained exactly how the history is formated in the description!

• ###### myjinxin2015commented on "Code Adventurer Guild: HongKong" kata

Happy Coding `^_^`

• ###### myjinxin2015commented on "Code Adventurer Guild: HongKong" kata

180 point was paid by the Code Adventurer Guild ;-)

• ###### tiago47commented on "Code Adventurer Guild: HongKong" kata

great kata. harder (more time-consuming) than a 5 kyu, though. deserves a 4 imo.

• ###### tiago47commented on "How many numbers III?" kata

This comment is hidden because it contains spoiler information about the solution

• ###### JohanWiltinkcommented on "The Prime Probability Mystery " kata

I have marked up the description a little. Hope you don't mind.

Got it

• ###### Voilecommented on "The Prime Probability Mystery " kata

Wait :P

What I meant was, you should mention that the answer are returned as a percentage, not a decimal (which is how probability are dealt with almost all the time). After that, rounding to the nearest percent is okay, no need for 2 decimal places and being a percent at the same time.

• ###### tiago47commented on "The Prime Probability Mystery " kata

Okay I changed it to rounded to 2 decimal places :)
Should hopefully be more clear now

• ###### Voilecommented on "The Prime Probability Mystery " kata

Well, but it's far from clear what is actually being returned (there's no mention of it being a percentage). Besides, `rounding to 2 decimal places` or something isn't really that much of a problem for people anyway, lots of katas do it all the time and we're pretty much used to it :P.

• ###### tiago47commented on "The Prime Probability Mystery " kata

@Voile Ah, good point on the Number.safeInteger. I missed that. I wanted to include some large prime test cases though so people couldn't just throw together a couple loops and call it good. But perhaps I can't do that.

With regards to your first point, I don't entirely understand what you mean by "Either returning the probability as an integer or...", is that not what I am asking to be done right now? I thought it would be simplest for people just to throw their answer into a Math.round() rather than have to deal with decimals that may differ slightly based on rigor of the solution method.

• ###### Voilecreated an issue for "The Prime Probability Mystery " kata

`Important note: express probability in a rounded integer form (i.e. 0.301 is equivalent to 30 and 0.247 is equivalent to 25).`

This is mysterious, why should probability be represented and rounded in the nearest percent? Either returning the probability as a integer or as a fraction over the original `p*q` would make much more sense.

Test cases: `1.355877461004671e+22 4.125636888562549e+33`

These numbers are already way beyond `Number.safeInteger` so they aren't even integers. It's impossible to know what the number actually is!

Need random tests