Hacker News new | ask | show | jobs
by ecyrb 4995 days ago
One of the hints for assignment 2 is:

"Most of the solutions for this assignment can be written as one-liners. If you have more, you probably need to rethink your solution. In other words, this assignment needs more thinking (whiteboard, pen and paper) than coding ;-)."

Is it not entirely possible that they're getting some false positives?

1 comments

Very unlikely, similar code? yes, exact duplicate? there are so many ways to solve it, that statistically it's not that likely, and if so, it will be on 1 answer, not all of them.
If you have, for example

    class Rational(x: Int, y: Int) {
      def numer = x
      def denom = Y
    }
and then homework is to implement

    def less(that: Rational) = ???
then you're gonna get 15 000 people answering with

    def less(that: Rational) = numer * that.denom < that.numer * denom
and another 15 000 with

    def less(that: Rational) =
      numer * that.denom < that.numer * denom
and maybe a couple thousand with something like

    def less(that: Rational) = numer*that.denom < that.numer*denom
(This example was taken from Scala course lectures, but some of the homework problems are as short as this.)
yes, but none of them are that trivial... and if they were, then cheating wouldn't make much sense. e.g. the coin change algorithm, I'm sure the distribution of answers was quite unique for anyone who tried solving it alone. same for even simple things like the pascal triangle.

But it's a moot argument as we need to do a real research (or ask coursera / Martin Odersky for the data, which I'm sure HN community will be happy to run some data mining on)

Actually I think some (many?) of the answers to the functional sets homework are that trivial in the sense that they're as short (or shorter) the the examples in the parent post. The only longer function was, I think, the one for which they provided a template implementation. So I think even that one would generate false positives somewhat easily.
The solution for the count change is already in the recommended literature (SICP). And this was mentioned in the forums.