Ad
  • Default User Avatar

    The idea of the kata was to illustrate using a dictionary to improve efficiency of search. Without that, I'm not sure it's very interesting.

    I have no control over the rating. It was set by the reviewers in the beta phase. My understanding is that it cannot be changed now.

  • Default User Avatar

    much more torough tests have been added to C#. tons of solutions did not make it ;-)

  • Custom User Avatar
  • Custom User Avatar

    status_group: This column categorizes the applications into two groups: 'Rejected' and 'Approved'. We display 'Rejected' at first.

    But it is mentioned.

  • Custom User Avatar

    I bet a big part of the low satisfaction rating comes from the formula not being in the kata's description.

  • Custom User Avatar

    It provides approximate inputs

    It doesn't! It provides assumed values. Again the point is to test the functions logic precisely using a specified value, not to approximate results.

    Edit: for this particular kata, the best option is probably honestly just to change the provided value (and therefore invalidate all solutions). OR just retire it, looking at the satisfaction rate.

  • Custom User Avatar

    Because by allowing both, we are now allowing math or logic errors that cause ±0.002 difference in the result, whereas currently if you did have some math or logic error, it would have to be so minor to only have a ±0.0000000005 difference. Now I don't have a direct example on me, but it seems a lot more likely for an errant +1 somewhere to end up going unnoticed with the first value range.

    But this is already implied by the statement itself, isn't it? It provides approximate inputs, so it cannot reasonably expect exact results, because exact results built on approximate inputs will be off by a far margin anyway!

  • Custom User Avatar

    what room does it leave for "additional logical problems"

    Because by allowing both, we are now allowing math or logic errors that cause ±0.002 difference in the result, whereas currently if you did have some math or logic error, it would have to be so minor to only have a ±0.0000000005 difference. Now I don't have a direct example on me, but it seems a lot more likely for an errant +1 somewhere to end up going unnoticed with the first value range.

    Not to mention, that this approach is also very strange, because now solvers taking the stated value will have significant amount of leniancy in one direction, but the results will be quite strict in the other direction. I don't think it is right to be telling solvers to use a value which puts them right at the edge of the acceptable range.

    But I also do not think that when Alice uses pi=3.14, and Bob uses pi=3.1415, Alice should be able to tell Bob that his calculations are wrong.

    If the instructions explicitely say to use 3.14, and then the test graders see that Bobs answer was off from the expected answer by a significant margin, they could definitely tell him he was wrong. In a real test they might notice that he did all the right operations but just started with a different constant and still give him the marks, but that is not possible (or at least, not worthwhile) in this context

  • Custom User Avatar

    b) immensely lower the precision of testing such that people using values approaching the real G, and people using the stated value are both correct. However this is so unprecise that people could quite easily have logical flaws that are allowed to pass.

    This does not sound right. You propose to use the approximated G, to make things easier to solvers, but test agains results accounting for a precise (as much as possible) value of G - how would this allow for logical flaws allowing to pass? Make the precise value in the middle (or at one end) of the range of accepted results, and span the range of accepted answers to the value resulting from the approximate value - what room does it leave for "additional logical problems"?

    [...] you don't use all digits of PI [...]

    Well, of course not, and I understand this! But I also do not think that when Alice uses pi=3.14, and Bob uses pi=3.1415, Alice should be able to tell Bob that his calculations are wrong.

  • Custom User Avatar

    The task forces you to use a value of low precision, and asks you about results of a high precision.

    I see it differently, I see it as the task forcing you to use high precision of a number which has been provided by the task in order to make things simpler. It then also tests your calculations with that number to high precision. Were the objective here to find an accurate result for the gravity between two objects, then I would agree with you, however that isn't the objective, the objective is to write a function which can calculate that result to high precision. In other words, your function logic should be realistic and accurate, not necessarily the actual produced values. To this end, the actual value of the constant is irrelevant, because the logic of the function stays the same. Therefore, a single simple value is chosen and well defined in the description, so that all solvers can use it and still be tested that their function logic is correct to high precision.

    As far as I know this is quite common practice when testing things: "For this problem assume Pi = 3.14" etc. Because the alternatives are either:

    • a) provide a stated value with higher precision, but then someone might come along with yet more digits and have the exact same problems. So we have all the same issues, but also a more annoying constant to deal with
    • b) immensely lower the precision of testing such that people using values approaching the real G, and people using the stated value are both correct. However this is so unprecise that people could quite easily have logical flaws that are allowed to pass.
  • Custom User Avatar

    You're confusing the math part with the physics part, the math part is well defined (well, if you find the formula outside the kata, that's not good), you're given some values and expected to use them. Did you studied Physics? Because I did, and you don't use all digits of PI or some other values for a first order approximation. Read this: https://en.wikipedia.org/wiki/Gravitational_constant#History_of_measurement so you see the value of G was changing with time, as many other measures. And also, you can edit the kata and the tests if you're not entirely satisfied with it. OP could make a fork and write a suggestion, instead of complaining about the value of G used here is not as precise as he wanted. That's not a kata issue.

  • Default User Avatar

    @Kacarott But this is actually a not-contrived Kata. It's calculating a real life thing. Yes, technically this isn't a Kata issue, but OP is very valid to think that the tests should be slightly revised to not reject the constant a lot of people grew up studying.

  • Custom User Avatar

    I am still with the OP here and I think the task is defined in a clunky, and arguably wrong, way. The task forces you to use a value of low precision, and asks you about results of a high precision. It's logically off. I see no reason why calculations based on data of better quality than suggested should result in rejection of the result. Such result is better than the one assumed correct. It's not worse to the point of deserving rejection. I can imagine why this would happen on an exam written on paper (to make grading easier), but I think it is not reasonable in a computing problem. I would consider the wording of "assume that G is equal blah" also flawed: why should anyone even assume that the G is equal anything else than, duh, G? G is G, pi is pi, all are well known, perfectly defined values, and even if a task tells you you can assume some other value, I think it sohuld still accept answers based on the value.

    IMO the core problem is that the tests expect you to provide high precision result out of a low precision input. If tests insist on using a very roughly approximated input value, they should also accept an equally roughly approximated answer.

    The motto of Codewars is more like "here is an unrealistic and completely contrived task, which is hopefully fun. Use your imagination and try to create a solution to this made up problem".

    As much as this totally fits a general description of a CW task, the problem here is that the G is not an unrealistic, totally made up value. Many kata require, or can be greatly helped with, some external research and collecting some knowledge in the wild. This kata in its current form does the opposite, it makes the real knowledge which is a base of this task unsuitable, and I would consider this wrong. The description of this kata should not serve as the only reliable source for a value of G.

  • Custom User Avatar

    Didn't know that the moto of CW is "Shut up and follow the instruction"

    The motto of Codewars is more like "here is an unrealistic and completely contrived task, which is hopefully fun. Use your imagination and try to create a solution to this made up problem".

    If it bothers you that the task is not 100% accurate, then you can just pretend that the task is to find the force of gravity in an alternate reality where G is exactly what is stated in the description :)

    The only suggestion I have to potentially help this situation would be to change the wording from "value of G = ..." to something like "This kata assumes G = ...".

  • Custom User Avatar

    In this case, it is, I don't know why are you arguing about using a different value not working, do you understand you were given a value so your calculation reaches the same result as the expected one, right? If you can't see that, then there is nothing we can do. Not following the instructions is an error on your part, from there, no wonder your code won't work. And no, we shouldn't bend the tests so not following the instructions will work to make you happy.

  • Loading more items...