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

same codes

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

Best Answer

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.