Can I Strangle Them Now?

Pages: 12
Just more college venting. I've been suspected of cheating on several CS assignments. Apparently my code looks "suspiciously" close to another student's code, who I figured out is likely my friend who was also told the same.

We didn't cheat, but when I asked to see his code it was uncommonly identical. I almost suspected that he copied off my code too somehow, but I know he has no access to it. Apparently several of the assignments are like this.

I taught my friend the basics of coding and so I guess my style must have REALLY rubbed off on him. From variable names, comments, to how we implemented most things, just the same. Not too surprising given that the assignments are fairly straight forward, but now I'm this mess.

My only real argument is, "I'm not stupid enough to give someone the exact same code so we can get caught." We sit together in class, so there's no denying we're friends. Unless I tell him to pull up other students' code and they also look the same, there's nothing much I can do to prove my case.

I'll fight this, I've got a lot of logical points to make that will show this is stupid, but the evidence itself it pretty damning. Is this what wrongly convicted murderers feel like? Anyway, I'll update with what happens, I'll be meeting with the professor Monday to discuss this.
Are the assignments like basic programming exercises? If so, I don't really know what all the fuss is about. It would be understandable if was several weeks' worth of work, but for simple exercises there's usually only a handful of ways to do them (correctly), so there's bound to be duplicates.

That said, are you sure your friend couldn't have had access to your code?
There are only a handful of ways to do the assignments correctly as you said. The redundancy is expected, but we did things shocking similarly - to the point where a few of our comments are only letters different from each other. I'm hoping that perhaps the shocking similarity is in other student's code too. My friend isn't stupid, I think that even if he could have cheated off my code somehow he'd do a better job of hiding it. It just seems like a giant coincidence.

Now, there are still several subtle differences that I can point out which really only come from when different people are coding. The positioning of his enum, his use of "using namespace std" (which I never use), etc.. But at the same time, we've matched on many subtle things like that. We both called rand() to get rid of the first random letter, multiplied a random number between 0-1 by 100 to make it easier to work with, etc.. I suspect that none of these would be suspicious by themselves, but we did most of it the same with minimal minor differences.

My friend isn't the type to cheat I'd say, but I'm fairly certain he had no way to access my code. One assignment there there's definitely a way he could have seen my code, but not for the other 1-2 assignments he's given me 0s for on suspected cheating. One of which was the assignment that he found suspicious to begin with.

I'm not sure how it'll go. He wasn't very stern about it when he first emailed to meet him (when he saw one assignment looked very similar), but he's changed his tone and sounds more serious after seeing several similar assignments I suspect. I've only checked one assignment with my friend up until now, but it seems several of them may be very similar.
Last edited on
I take it you would say that you are more experienced in programming than your friend, since you said you taught him?

Are there any instances in the code where you made the algorithm more robust than your friend's implementation? If your friend is less experienced than you, are there any particular tendencies you can see in his code that points to him being unacquainted (e.g. in C++, doing std::string s = ""; as opposed to just std::string s; [Just an example])

And no, you can't strangle them now. But I would leave all possibilities open... perhaps you left your computer open, and he couldn't help but peer into it. Just saying.

Edit: And what about comments? Sure, there's only so many ways to write taking an average of an array, but are even extraneous things like comments this similar?

Edit 2: Just saw your previous post. You basically answered my questions... that is worrisome.

You said you're friends. Do you live in the same dorm or something? Despite being friends, do you avoid doing the actual homework together? If you're saying even the comments are almost identical... I can only assume he is looking at your code, sorry, and you're not aware of it. I hate to cast that distrustful attitude, but that's my suspicion just based on this thread.

As a counter to that... multiplying a random number by 100 to make it in a format that humans find pleasing is far from something suspicious.
Last edited on
Edit: And what about comments? Sure, there's only so many ways to write taking an average of an array, but are even extraneous things like comments this similar?

No, nothing so blatant like that. It really was just both of us practically saying the same thing at some point and used very similar wording.

And no, you can't strangle them now. But I would leave all possibilities open... perhaps you left your computer open, and he couldn't help but peer into it. Just saying.

Not possible. If he had actually copied, it would be quite a story to hear how he found my .cpp files to copy off of.

Are there any instances in the code where you made the algorithm more robust than your friend's implementation?

I was hoping for that too, but he says he searched up most of the code online, so he implemented it the exact same way, down the down for loop without a last statement - "for(rarities i; !inFile.eof(); )" . On one of the assignments he gave me a 0 on for suspected cheating I definitely did some extra stuff, but I haven't seen my friends code for that one yet.

To clarify, our variable names were very similar in many places (places where you would or wouldn't expect them to be), but they were different completely for some parts.

I take it you would say that you are more experienced in programming than your friend, since you said you taught him?

Very much so, the professor knows this I'm sure.


EDIT:

You said you're friends. Do you live in the same dorm or something? Despite being friends, do you avoid doing the actual homework together? If you're saying even the comments are almost identical... I can only assume he is looking at your code, sorry. I hate to cast that distrustful attitude, but that's my suspicion just based on this thread.

No worries, I don't trust anyone. The issue is that I can't find any possible way he could have seen my code. We don't live in the same dorm or anything like that. With the first few assignments in the class, I sat with him and helped him with syntax and such, but never gave him code. After a few assignments, I let him off into the wild to code for himself. He always says that he ends up looking up a lot of the code.

As a counter to that... multiplying a random number by 100 to make it in a format that humans find pleasing is far from something suspicious.

I agree, just that we shared many subtle things like that. There are definitely differences in our code though, subtle differences that I think show that he and I coded our programs separately and were simply following a very similar logical progression and thought process. But, we'll see.
Last edited on
Yes, I see. And how is the code submitted for grading? Just submitting the .cpp files via email or something? Your latest post lowers my suspicion... but I'm at the same place where I don't know what else I could say to a professor.

I was hoping for that too, but he says he searched up most of the code online, so he implemented it the exact same way, down the down for loop without a last statement - "for(rarities i; !inFile.eof(); )"
I don't understand this part. You're saying that code snippet is copied from online, but both you and your friend had it in their code?

Anyway, to me the strongest argument so far sounds like finding and pointing out the different subtle things that would indicate different thought processes. Maybe asking for a second opinion of someone also experience in C++, but not biased for you or the professor.

Edit: Just wanted to say good luck on Monday. This is really unfortunate.... hope it works out.
Last edited on
I don't understand this part. You're saying that code snippet is copied from online, but both you and your friend had it in their code?

He looks up the code online, but he obviously has to change it for the particular program. I assume he searched up the issue he was trying to code and found snippets he could easily adjust.

Yes, I see. And how is the code submitted for grading? Just submitting the .cpp files via email or something?

Via an online WebCampus. The TA grades the assignments. The whole reason the professor ever saw the code to begin with is because me and my friend both emailed him at the same time about receiving a 0 for a particular assignment (the first assignment that he suspected us of cheating with eachother on). The issue was that we had to read in a word, but both my and my friend expected the word to have a capital first letter, which it didn't in his .txt file (which he didn't provide!) and our code segfaulted. The code was definitely not robust as you could see, but I don't try to go beyond what he asks. So receiving a 0 for the assignment was just plain stupid, he checked the code and saw that it was indeed just that, and said he'd give the points back. I assume after checking my friends code, he saw the similarities and all this happened.

Again, I hope other student's also have very similar code. If the discussion goes to it, I could ask him to see if other student's code look awfully similar as well.
Last edited on
Edit: Just wanted to say good luck! This is really unfortunate.... hope it works out.

Appreciated.
Well, things seem to have gotten worse somehow. I got my friend to email me his code so I can compare. For 2 of the 3 assignments, it can be dismissed that there's no other practical way of coding it and that we followed a logical and similar thought process.

For the last assignment, oh boy.. I did something extra that was also in my friend's code. My logic tells me he must have cheated off my code, but at the same time - how could he have gotten my code? He also isn't the type to cheat as I've said. Which isn't something I say out of friendship or feelings, but a quality I logically see in him, which is not to dismiss that possibility completely either.

There is a point in his code where he obviously copied and pasted an if statement from his own code (he forgot to change what he couted as an error). If he had truly copied my code, it would have been impossible to make that mistake, but practically grasping at straws here.

It's hard to believe that he didn't copy, but it's also seemingly not possible for him to have. It's a very unfortunate situation, hopefully I'm competent enough to deal with it. The fact that I even figured out it was my friend to begin with would likely seem just as suspicious, have to handle the situation with care. Perhaps Wal-Mart will have a sale on rope soon.

EDIT:
Are the assignments like basic programming exercises? If so, I don't really know what all the fuss is about. It would be understandable if was several weeks' worth of work, but for simple exercises there's usually only a handful of ways to do them (correctly), so there's bound to be duplicates.

To touch on this more, they are simple assignments that can be coded in < 3 hours if you know what you're doing. But to the rest of the class, it's probably a week's worth of work (he gives between 1-2 weeks for each assignment).
Last edited on
If'n it were me in the same or a similar situation I'd just ignore the plagiarism and write the best code I can given what I know of C++ at the time of each assignment.

If he's copying then eventually be found out and the only person hurt is him.

I'd also think about not having him as a friend any more.

Harsh, cruel, but you are only in control of what you do.
If'n it were me in the same or a similar situation I'd just ignore the plagiarism and write the best code I can given what I know of C++ at the time of each assignment.

If he's copying then eventually be found out and the only person hurt is him.

The professor is a graduate student, he might be more in a mindset to flex his newly found teacher powers rather than take the approach that you mentioned.

I'd also think about not having him as a friend any more.

Even if I did, it wouldn't stop him from copying my code if he's doing it in some godly way! We don't hang out or discuss our code or anything like that. We simply have the same class, sit together, and for a few days spread over a month I taught him basic coding. How he'd get my code to copy off of is a mystery. Even the "extra" thing I did that he also had in his code was a pretty logical step. He also seems to understand his code when I've questioned him about it.

The similarities are mind boggling, but I don't find the logical path of where he'd get my code from. What I'm counting on is that perhaps a lot of other students have done the same thing and it was only natural to.
Last edited on
Sent you a PM.

I am very sorry you are learning this lesson about people this way. Honest people are always at a disadvantage when faced with people who are willing to be dishonest. Honest people say and do what we mean, whereas dishonest people easily choose to advantage themselves of others, even if they otherwise seem nice, they are willing to take what advantage you have given them and ungraciously turn it against you, caring only for their own benefit and not yours.

You might find some interesting reading in the “Prisoner’s Dilemma” (https://en.wikipedia.org/wiki/Prisoner%27s_dilemma) — in spite of the great advantage he received for studying with you, he chose to abuse you for a perceived greater advantage. (And unfortunately is proven too stupid to pull it off.)

Alas.
Somewhat related in the exactly opposite way, I once gave someone a hand in a test by writing some code for them. First I wrote something I thought was self-explanatory and he'd be able to fill the blanks, but then he handed me the paper back asking for more detail (I didn't know him that well, so I guessed he was just really clueless. Suffice it to say I didn't see him in the course the following year), so I wrote a bit more.
The teacher accused him of cheating because it looked like at least two people had written the code, even though I pretty much wrote all his answers. Maybe I had coding schizophrenia back then.
Last edited on
Thanks Duthomhas . Yes, the prisoner's dilemma might be what's happening in this situation. I do appreciate it by the way.

Maybe I had coding schizophrenia back then.

Lol, well I'm glad you weren't caught in it. Thanks for the chuckle, I shouldn't lose my charisma now when I need it most.

I'll be sure to update the situation when I see what happens Monday.
JSYK, professors (experienced ones, at least) can usually see who is the cheat almost immediately. The problem they have is how to prove it so that they can give the cheater a zero and give the non-cheater a passing grade without having to defend themselves for the decision.
A couple of thoughts.

1. Tell your professor in advance that you will be submitting a sub-standard (for you) assignment. Agree what that mistake will be, say just using an array where a std::vector would be the most obvious choice.

> To touch on this more, they are simple assignments that can be coded in < 3 hours if you know what you're doing.
> But to the rest of the class, it's probably a week's worth of work (he gives between 1-2 weeks for each assignment).
2. Leave the assignment to the last possible moment. If you can reasonably judge how long it would take you to finish, then doing nothing until very late will make your 'friend' sweat. It will be especially telling if your 'friend' ever tries to bring the assignment up in a conversation.

3. Write two versions of the assignment (if your system allows multiple submissions up to the deadline). Submit one early (in case the submission system is the source of the leak), and then another right before the deadline.

If you're as good as you say you are, then there are multiple ways to write a program.
@salem c - Those are all very good suggestions, thanks. They'd of been useful if I had the time or was personally curious to really see if he was cheating or not. At this point, I doubt the professor would want to do the same, plus this week is the last week in the semester.

Whether or not he was actually cheating off me or not is a side issue really. I need the professor to believe that I was not intentionally giving him my code to help him pass the class. And if there's no way to show that my friend was actually cheating off me without my knowledge (which I see as impossible), then he's going to also have to believe that it was all a huge coincidence or my friend has some hidden cheating technique passed down his family for generations.

Thanks again for the suggestions.
Last edited on
People, in general, are very capable of applying their mind to things they want.

People who are seeking to cheat and steal spend a lot of time thinking about how to do it. A lot.

People who don’t are often surprised that their observation or efforts contrary were insufficient.

This is why I am not in security. I have no interest in spending time regularly thinking about how to break into things, or steal stuff, or the like. Security experts, however, do. They think about it all the time.

The reality is that your friend could very easily have cheated off of you without your knowledge. If he were willing to be honest with you he could explain exactly how he fooled you.

BTW. There is no shame in having been duped by a liar.
The reality is that your friend could very easily have cheated off of you without your knowledge. If he were willing to be honest with you he could explain exactly how he fooled you.

Thanks for the info, and I do understand the concept. He's close to me, and where there's a will there's a way and all that. But I can't find any plausible way he could have.

BTW. There is no shame in having been duped by a liar.

I'd accept the loss, but it almost feels like a video game where someone might be using cheat codes. If there was some brilliant plan he used to copy my code, then I'd take that, I might even be impressed. But with no way that I know of that he could have seen my code, it not only leaves me confused, but without anything to present in my defense.

EDIT: It's so confusing it's almost funny. The thought, "Did I actually give him my code?" crossed my mind because I had exhausted so many other possibilities.

The time of reckoning is nigh. The sun parts and clouds drift in, to cry their tears of sorrow upon the damned and dismayed.
Last edited on
Good luck!
Pages: 12