Can 2 students come up with the same codes for a homework assignment

5 views (last 30 days)
Could 2 students come up with the same codes for a homework assignment?

Accepted Answer

Walter Roberson
Walter Roberson on 12 Aug 2020
Yes. There are some semi-conventional variable names for some purposes, and some algorithms only have a small number of basic ways to be written.
For example recently there was a question about the shortest m file to build a particular array. Inexperienced people would have been likely to write a loop, but for more experienced people, the array could be calculated by adding two simple expressions together, and then since it asked for the shortest m file the only available variety was choice of single-letter variable name and choice of which expression was left or right of the +, for a total of only 2*26 letters times 2 positions = 104 possibilities but some names would be much more likely than others, really only 15 or so common answers.
  1 Comment
Christine White
Christine White on 12 Aug 2020
Thankyou my grandson has been accused of cheating 5 years ago someone turned in an assignment that was very much the same grandson is appealing this as he didn t cheat!

Sign in to comment.

More Answers (1)

Steven Lord
Steven Lord on 12 Aug 2020
Sometimes the constraints placed on the students as part of the assignment encourage or almost force the result of the assignment to be the same. Consider a simple assignment to "Write a function named addme that takes two inputs and returns their sum."
Assuming the students interpret "their sum" the straightforward way (+) rather than being 'creative', the only real choices they have in implementing their solutions are the names of the three variables (the two inputs and the output) and as Walter says some choices are much more likely than others (x, y, z and a, b, c are probably going to be the most common.)
But if you're asking something more nuanced, like "Does MathWorks have any tools to detect plagiarism in homework solutions?" you could potentially try analyzing the corpus of solutions from your students using Text Analytics Toolbox or maybe the clustering tools in Statistics and Machine Learning Toolbox. But generating a report (if you're using MATLAB Grader) and passing that report into your Learning Management System's plagiarism detection systems would probably be easier.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!