text:
Does two lines of copied code constitute plagiarism?
I copied (and failed to cite) two lines of code from the OpenJDK source for an undergraduate Data Structures project. Yet, the code comparison shows an alarming amount (40%) of similarity. Here is the side-by-side comparison with my file.
Based on these grounds, my professor wants to give me a -100% on the assignment, which would bring down my overall grade by 15% total, probably causing me to not make the C-wall (depending on how well I do on the final exam). For this reason (and my conscious), I decided to appeal.
However, I believe that most of the similarity in the report comes from my copying of lines 142-152:
static int hash(int h) {
    h ^= (h >>> 20) ^ (h >>> 12);
    return h ^ (h >>> 7) ^ (h >>> 4);
}

I did not cite these two lines, but I did intend to delete them later.
In fact, this whole function can be removed without affecting the program at all, which results in this file comparison.
Then, only lines 114-126 are a problem:
MyEntry<K, V>[] newArr = new MyEntry[newSize];
// Copy
for (int i = 0; i < data.length; i++) {
    MyEntry<K, V> e = data[i];
    if (e != null) {
        data[i] = null;
        do {
            MyEntry<K, V> next = e.next;
            int j = e.hash % newSize;
            e.next = newArr[j];
            newArr[j] = e;
            e = next;
        } while (e != null);

However, this snippet is my own. I wrote these lines without referencing HashMap.java, and this is a common algorithm for chaining that I can explain thoroughly, and have known about for years.
Yes, I know the fact I copied the other two lines compromises my integrity and made the 20% into 40% to begin with, so how can I prove this?
I'm not sure how to defend this whole case before a Student Conduct Board who knows very little about programming. My board hearing is in a month. Does these two snippets of code constitute plagiarism of my entire project? Is -15% to my overall grade fair?
Sidenotes:

Our projects are pretty extensive since we aren't allowed to use java.util.* (like 1k+ lines for each project in 8 days), and I did not copy any other code. I'd say the actual data structure implementation is only meant to take about 1/5 our time spent per project.
Over 30% of the class has been reported for academic integrity violations on projects over the semester, and the newly graduated professor doesn't seem to think himself or his assignments are the problem. I should have caught onto the warning before this last project of the semester...

Comments are not for extended discussion; this conversation has been moved to chat.

This is the type of mess that made me leave academia.

I want to point out that this piece in dispute is verbatim here and here.

@Gryph There is a bigger dispute, see the chat referenced above.

Some of the newer comments suggest that you haven't picked up on the cultural norms regarding plagiarism in the West.  So I dunno if this might be completely off-base, but one reason someone might not know the norms here is if they're from Asia, e.g. an international student or an immigrant who's returned to school as an adult.  Someone who grew up in Asia could understandably have picked up some of their cultural norms about plagiarism during their early education, which are very different from Western norms.  This wouldn't get you off-the-hook, but it might be a mitigating factor.

VTC as too specific. We're not here to evaluate file diffs.

It appears strongly likely that you did plagiarise, and if this is the case you'd be better to proceed by recognising your mistake than continuing to argue.
Looking at your code, there is a great deal that appears to have been taken from the HashMap.java file. I strongly suspect that you began with this code and then modified it to produce your code, or closely followed it as a template when writing your own. The highlighted code sections have picked up some of this, but other sections closely resemble the other file too, although with slightly altered comments and ordering.
If this is the case, then the code you have shown us is not your own original work but actually a plagiarised version of HashMap.java. Leaving in the two lines which are unconnected is a smoking gun of the link that is likely to be conclusive to the panel. Your point that they are unnecessary will actually count against you because you will be unable to explain why they are there at all.  And whether this was your intent or not, it is likely that the panel (and your professor) will see your changed comments and ordering as an attempt to cover up your tracks and conceal your plagiarism from automated tools.
The panel is more likely to show leniency towards a student who appears to at least be contrite, and recognises that they've made a mistake, than a student who denies wrong-doing in the face of apparently very strong evidence.

Oh, I'm not denying using it as a reference, which is allowed in the syllabus. My claim is that I forgot to cite/didn't see the need to cite, because I am new to academia, the assignment lended itself to it, and I'm used to treating assignments like this in regards to hobbiest projects that can borrow freely from GPL code, not academia ones that forbid its use. The claims my professor brought against me only pointed to the MOSS, though, not the file as a whole, so that is why I only ask about the two lines.

I do actually have a good reason for writing those lines to begin with. We had to hash a lot of two character strings (i.e. "AB"). Without the auxiliary hash function, there were a lot of collisions, and I was afraid my code would time out in the automated grading, which would delay development a LOT based on how our automated Jenkins grader works. I included it because once I learned how it worked I thought it was cool, and my project could use it. Yes, I feel contrite now, realizing that academia has different standards, that really weren't made clear to me.

@TheSmartWon, I would recommend that in the future, even for hobbyist projects where you aren't intending to disseminate the code, you should still cite code you have borrowed from elsewhere. If you decide later to publish or sell your code, without these citations, you might forget what was borrowed and from where (and run the risk of violating the license).

@TheSmartWon 1) The MOSS identified a lot more than just two lines. 2) you should know that copying code you are meant to write yourself is cheating on an assignment, that's just common sense, 3) you did not write those lines, and 4) I don't believe you actually were afraid of it timing out. To me that statement smells like more attempted covering up.

@immibis 1) Look at the second MOSS in the OP. 2) I did write it myself -- using a source, and making some of my own modifications. 3) Agreed. 4) I have no reason to lie here. I think like an engineer (I thought the function was cool and I had good use for it!), so I used it, not an student trying to turn in "their own work."

@TheSmartWon 1) The same one that identifies 3 further sections? 2) "using a source and making some modifications" is not "writing it yourself". 4) Your reason to lie is to try to avoid punishment. it is a normal response to do everything you can to make it look like you should not be punished. An engineer also would not use a function just because s/he "thought it looked cool". You also already know that assignments need to be your own work; if you are unable to remember not to hand in other peoples' work then you have a problem.

Yes. Talk about them if you wish. 2) I agree. We are encouraged to use the Java API as a template, though. 4) If I was trying to avoid punishment, I wouldn't have made this post. I want what's fair in the eyes of academia. 4.2) You failed to recognize my second clause "...and I [understood the function] and had good use for it." Engineers include other people's optimizations all the time, especially in OSS!

Here is where intent is such a difficult issue to contend with when it comes to plagiarism. Did the defendant intend to plagiarize? Knowing that an idea, quote, code, belongs to another entity, and despite knowing the rules still decide to utilize without citation. If the class never stressed code citation, (and based on the question and comments from OP thus far) it would appear that such conventions were never taught but still enforced. If you set a rule without explaining it, how would it be fair if students don't understand/follow it?

@TheSmartWon I don't think serious OSS programmers are anywhere near as casual as you about intellectual property. I am both a member of the Apache Software Foundation, and a committer on a couple of ASF projects. To become a committer, I had to sign a legal agreement that says, among other things "You represent that each of Your Contributions is Your original creation", and "You represent that Your Contribution submissions include complete details of any third-party license or other restriction...of which you are personally aware and which are associated with any part of Your Contributions."

@FrankFYC “it would appear that such conventions were never taught but still enforced” the concept of “don't cheat by copying other people's work” is not a “convention” and it does not need to be taught. It is obvious (actually, it is found in pretty much any academic/university rule book).

@AndreaLazzarotto I don't disagree with the statement that plagiarism is wrong, unethical, and should be punished (in some cases, severely). But perhaps my words were more confusing than enlightening. If the claim here is plagiarism with the following parts: knowledge - did the defendant know what plagiarism is, intent - and still decided to plagiarize then the jury (student board) can find OP guilty as charged. The defense that OP can put forth is that the current definition of plagiarism doesn't work well when it comes to computer programming, as well as the fact that (continued)

A commonly used mechanism to allow students to cite their sources (a bibliography for example) was not demanded by the professor. Another argument would be that the professor had another faculty member present during the grade reviews, a possible violation of FERPA. Another argument is the rather high number of academic misconduct claims in the class - of which may signal that the professor has not put forth effort in educating his class on plagiarism specifically about programming citations.

@FrankFYC I do not agree on the defense, it is quite moot. I myself studied CS and we were never given specific direction not to plagiarize. We knew it was wrong and it applies just fine to code as well. Granted, I am in a different country and here plagiarism is a criminal offense so the situation might be a bit different than the US.

@AndreaLazzarotto Exactly my point. Plagiarism is a serious charge. Determining whether or not a person has committed a crime is not an easy matter to make. In this case, the professor only used a single test to determine whether or not student plagiarized. Would that be fair? In addition, the professor allegedly broke US privacy laws by allowing another faculty member to see the student's grade. The professor also has an absurdly high rate of academic integrity cases in the class. Wouldn't you wonder how the professor is teaching the class (continued)

may be affecting the student's decision-making? If you set impossible goals, no matter how well-intentioned, without a means to achieve it ethically, how many would decide to deviate and 'cheat'? Having just one person who has the unilateral power to determine who has cheated is potentially rife with abuse.  Lastly, and I wholeheartedly agree with you, plagiarism is a serious issue. But that doesn't mean someone is automatically at fault without evidence and a thorough investigation. Innocent until proven guilty - that's the american justice system (imperfect at times, but its all we've got).

@PersonX It's also really helpful to have those cites if you're looking back at your code a year from now. It's pretty easy to just copy-paste the link you're looking at into a comment. It also gives the added benefit if you want others to learn from your code to read from.

@FrankFYC: depending on the class size, that rate is not "absurdly high". I'm a grader for a class of usually a dozen people, and most years I've had 3 cases of obvious plagiarism (those where students copied each other's sentences and mistakes in basic arithmetic). If next year one extra student decides to split their efforts with a classmate, suddenly it'd be an extraordinary event? (We sit those students down, we don't throw the full book at them the first time around, and invariably their justification is that they have too many assignments from other classes that don't leave enough time.)

The title of your question "does two lines of copied code constitute plagiarism", isn't exactly accurate, in my opinion.
I think that you will have a very hard time arguing that this isn't/wasn't plagiarism. The similarities between your code and HashMap.java don't end at the two lines or at a single "common algorithm".
1) You picked the exact same default capacity and load factor:
 /** Has to be a power of 2 */
 private static final int DEFAULT_CAPACITY = 16;

 /** The load factor */
 private static final float DEFAULT_LOAD_FACTOR = 0.75f;

versus
 // The default initial capacity - MUST be a power of two.
 static final int DEFAULT_INITIAL_CAPACITY = 16;

 // The load factor used when none specified in constructor.
 static final float DEFAULT_LOAD_FACTOR = 0.75f;

In fact, the "Has to be a power of 2" comment already means you are caught red-handed, because, there is, in fact, no good reason to require that the capacity is a power of two in your code. The fact that the size is a power of two is only used for an optimization in the HashMap.java version of the code, and this optimization isn't used in your code. You are probably lucky the student conduct board doesn't know much about programming.
2) The two get methods are very similar:
public V get(K key) {
    if (key == null)
        return null;
    int hash = key.hashCode() % data.length;
    // System.out.printf("Getting %d %d %s\n", key.hashCode(), hash,
    // key.toString());
    for (MyEntry<K, V> e = data[hash]; e != null; e = e.next) {
        if (e.hash == hash && (e.getKey() == key || key.equals(e.getKey())))
            return e.getValue();
    }

    return null;
}

versus
public V get(Object key) {
    if (key == null)
        return getForNullKey();
    int hash = hash(key.hashCode());
    for (Entry<K,V> e = table[indexFor(hash, table.length)];
         e != null;
         e = e.next) {
        Object k;
        if (e.hash == hash && ((k = e.key) == key || key.equals(k)))
            return e.value;
    }
    return null;
}

It seems strange that you both picked the exact same, very specific way to do the key comparison (first comparing the hashes, then the pointers of the keys and then finally using key.equals).
3) ...as is the put-method:
public MyEntry<K, V> put(K key, V value) {
    int hash = key.hashCode();
    // System.out.printf("Adding %d %d %s\n", key.hashCode(), hash, key.toString());
    int i = hash % data.length;

    // Collisions
    for (MyEntry<K, V> e = data[i]; e != null; e = e.next) {
        if (e.hash == hash && (e.getKey() == key || key.equals(e.getKey()))) {
            MyEntry<K, V> old = e;
            e.setValue(value);
            return old;
        }
    }

    addEntry(hash, key, value, i);

    return null;
}

versus
public V put(K key, V value) {
    if (key == null)
        return putForNullKey(value);
    int hash = hash(key.hashCode());
    int i = indexFor(hash, table.length);
    for (Entry<K,V> e = table[i]; e != null; e = e.next) {
        Object k;
        if (e.hash == hash && ((k = e.key) == key || key.equals(k))) {
            V oldValue = e.value;
            e.value = value;
            e.recordAccess(this);
            return oldValue;
        }
    }

    modCount++;
    addEntry(hash, key, value, i);
    return null;
}

4) ...as are the add and grow-methods:
void addEntry(int hash, K key, V value, int bucketIndex) {
    MyEntry<K, V> e = data[bucketIndex];
    data[bucketIndex] = new MyEntry<>(hash, key, value, e);
    keyList.add(key);

    if (size++ >= threshold)
        grow();
}

/**
 * Grows the array 2x current size
 */
private void grow() {
    int newSize = 2 * data.length;

    @SuppressWarnings("unchecked")

    MyEntry<K, V>[] newArr = new MyEntry[newSize];
    // Copy
    for (int i = 0; i < data.length; i++) {
        MyEntry<K, V> e = data[i];
        if (e != null) {
            data[i] = null;
            do {
                MyEntry<K, V> next = e.next;
                int j = e.hash % newSize;

                e.next = newArr[j];
                newArr[j] = e;
                e = next;
            } while (e != null);
        }
    }

    data = newArr;
    threshold = (int) (newSize * DEFAULT_LOAD_FACTOR);
}

versus
void addEntry(int hash, K key, V value, int bucketIndex) {
    Entry<K,V> e = table[bucketIndex];
    table[bucketIndex] = new Entry<>(hash, key, value, e);
    if (size++ >= threshold)
        resize(2 * table.length);
}

void transfer(Entry[] newTable) {
    Entry[] src = table;

    int newCapacity = newTable.length;
    for (int j = 0; j < src.length; j++) {
        Entry<K,V> e = src[j];
        if (e != null) {
            src[j] = null;
            do {
                Entry<K,V> next = e.next;
                int i = indexFor(e.hash, newCapacity);

                e.next = newTable[i];
                newTable[i] = e;
                e = next;
            } while (e != null);
        }
    }
}

Of course, a HashTable is a fairly common data structure and there are only so many ways to implement a given algorithm. However, the two copied lines show that you did definitely use HashTable.java as a starting point for your own implementation, and the further similarities in the design, illogical comments and code structure would lead one to believe that you did take more than just a little "inspiration" from HashTable.java.
Note that both your and their put and get methods use a for-loop to iterate over a linked list, whereas the grow/transfer methods uses a while-loop to do the same. It seems strange that both pieces of code would make this same decision independently.

Our projects are pretty extensive since we aren't allowed to use java.util.* (like 1k+ lines for each project in 8 days), and I did not copy any other code. I'd say the actual data structure implementation is only meant to take about 1/5 our time spent per project.

It seems clear that you weren't allowed to use HashMap.java, and that, if you had wanted to use a hash table, you'd need to implement your own. By copying large parts of HashMap.java you've tried to circumvent this restriction. "It's only a small part of the project" doesn't take away the fact that you took code, that was not your own work, and tried to pass it off as your own (even though the expectation was that you'd write this part of the assignment yourself).
If the assignments were truly unrealistic given the time span allocated, it would have been better to turn in a failing solution. If many students turned in a failing solution, the professor might have considered the possibility that the assignment was too hard. If the plagiarism had gone unnoticed then the professor might have (incorrectly) concluded that the assignment was of appropriate difficulty, penalizing the students who (attempted) to complete the assignment fairly and according to the rules.
The penalties for plagiarism can vary greatly by institution. -100% on your assignment could be heavy handed, but at our institution the penalty could have been anywhere from 0% on the assignment, an automatic fail for the course in question to expulsion from your studies for 12 months. Plagiarism, at most institutions, is treated similarly to cheating on an exam and the punishments might be stringent. If the only punishment were getting 0% on the plagiarized assignment then there would be no harm in "trying" to plagiarize if you'd fail the assignment anyways without resorting to plagiarism.

I feel a bit uncomfortable putting large amounts of source code in an answer (doesn't seem on-topic for academia.SE), but this seems the only way to explain to the question-asker how severe the copying is (the statement about "only two lines" seems to downplay it).

Plus of course the inconsistency pointed out by others that the OP claimed the copied part was not even used. Partly this points to a problem because it then makes no sense why it is included in the first place, and as also pointed out, the claim is not even true, pointing to the OP not really understanding the code.

Yep. This student would be toast if they turned in this code in my class.

To put it more bluntly, in my opinion these code examples look like copy&paste with some minor refactoring. Whenever a simple for loop is used in the HashTable, the students code uses it too. Whenever a iterator-style for loop is used, the students code uses it too. (the loops with e.next(), I've never encountered this style outside of the jdk in modern code). Even the peculiar style of omitting curly braces after one line if statements and loops is copied.

The OP needs to be aware that a Student Conduct Board that does not have much programming expertise may be able to invite an experienced Java programmer to review the code. If I were the professor and the student maintained the code was not derived from HashMap I would push for expert review.

I don't deny my code is derived from HashMap.java. I do deny that "it seems clear that you weren't allowed to use HashMap.java," and I'd strongly argue that I didn't know how much of it I could use, that the necessity of citing was not made clear (I'm new to academia), and that I did not try to circumvent learning on the assignment, but instead, I decided to not reinvent the wheel. You hold that I do not understand the code, but I do.

@TheSmartWon 1) Ignorance of the rules regarding plagiarism probably won't make a very convincing argument to the conduct board. 2) You were told you couldn't use anything in java.util.*. To an outside observer, it strongly looks like you basically copied the relevant parts of the source of java.util.HashMap and slightly modified them, no work of your own. Even with a citation that will get you in trouble. 3) Am I correct you're taking a basic data structures course? In that case, you're basically taking "wheel building 101" and reinventing the wheel is exactly what you're meant to do.

@TomvanderZanden 1) I agree in general, but in computer science (where engineering and science bridge), I'd say there's some room to argue, especially given the unclear syllabus. 2) No denial here. If I had a citation, though, why would that get me in trouble? The prof said a citation "might have been enough" in our meeting. 3) Yes, I'm taking a basic data structures course. However, reinventing the wheel is NOT exactly what we are meant to do, but rather, we must reinvent the wheel and make a fully functional bicycle with a very exact paint-job and styling. In-class, we just talk about theory

In addition to @TomvanderZanden's points, if you thought deriving your code from java.util.HashMap without attribution was permitted, you may need to explain why you made each of the changes you did make. For example, why did you change the comment on size() from the precise "Returns the number of key-value mappings in this map." to the ambiguous "Returns the array's size"?

@TheSmartWon In education, you can always argue that "someone has already solved this problem, why should I solve it again?", starting with math exercises in primary school. And the teacher there also gets angry at you if you just copy the solution or use a calculator instead of calculating on your own.

@Kapep I totally agree with you, just one small thing... “Even the peculiar style of omitting curly braces after one line if statements and loops is copied.”: that style is not peculiar, it's pretty normal.

@AndreaLazzarotto Ok maybe peculiar is not the right word, but I associate this style with legacy code or maybe java code written by programmers with background in C. Sun's Java code conventions from 20 years ago said to avoid omitting braces for if statements and I don't know any modern java code style guidelines that encourage this. I think I've only seen a similar style though, where the whole statement has to go on a single line when braces are omitted.

But if I think about again, it might not be fair to the student to point out coding styles. Programming is already hard enough for many beginners and code styles are something where you have to get some experience before you understand benefits of one style over the other. Can't really blame students for sticking with (outdated) code conventions of standard libraries.

@Kapep yes, after all the only important thing is to teach students to put the opening curly brace on the same line as the if/for/class/whatever. Some people insist in putting it on a new line. Every time this is done, a puppy dies. :(

@TomvanderZanden I really, really like your institution's rules for dealing with plagiarism. At my undergrad university, the punishment was like "bad boy! don't do that!", so I got tired of trying to do the right thing while everybody was getting away with cheating, and I quit altogether.

Plagiarism is passing someone else's work as your own. From what I see, you have passed someone else's work as your own. In your defence, you provide a list of statements:

the plagiarised fragment of code is small
the plagiarised fragment of code is not necessary
the professor's assignments are hard
the professor is newly graduated
the Student Conduct Board knows little about programming

I can't see how any of them are relevant to the issue in question. The central question is: have you used someone else's work in your own without references. If you did, you plagiarised, and you're facing consequences. Learn the lesson and do not repeat the mistake again.

Not all plagiarism is equal, and should not be treated equally. One-size-fits-all punishments are usually a bad idea.

We don't know if -100% is a one-size-fits-all punishment, as we don't know details of other plagiarism cases in this class.

In this case, it is a one-size-fits all punishment. He did this to 3 other people I know of in the class. I understand I plagiarized, I just don't see it as a big deal, and it makes other questions arise.

@TheSmartWon You comment "I just don't see it as a big deal" is a very strong argument in favor of a sufficiently severe consequence that you will see it as a big deal in the future.

@PatriciaShanahan Well, let me rephrase. I don't see why it would be a big deal in the real world. I actually learned more by using those two lines of code (I learned how they work!) than I would have by omitting them. I just think the question is a matter of what does my (unintended) plagiarism deserve?

@TheSmartWon In the real world, understanding and conforming to licensing rules is a really big deal. Incorporating code with incompatible licensing rules in your employer's product could lead to serious legal trouble.

@PatriciaShanahan I agree, licensing is important, and there is OSS source code that I can and can't use while working for a certain company on a certain project. I readily respect and use licenses both at work and in my own work. In this case, I copied GPL2 code, which would be completely fine as long as I included a copy of the license with my project, and released the source. Coincidently, both of those are true with my project. The uni doesn't care, though.

@TheSmartWon The academic world is built on giving credit where it is due.  You do not take credit from the works of others.  This is why the university considers it a big deal...

@TheSmartWon There will always be rules for using other people's code. The rules depend on how you are using the code, as well as on the code's copyright and licenses. When turning in an exercise in college, the rule is to acknowledge all code you did not write.

In the strictest case, every code which contains a line with i++; would be plagiarism except for the very first historical use of this line. I hope it's obvious how ridiculous it would be if it was handled like this. There should be a clearly defined boundary, but I haven't heard of any...

@vsz, independent duplication is not plagiarism. Plagiarism is the intentional copying of another's work without proper annotation.

@vsz Using i++ is not a plagiarism, unless one actually plagiarised it. The central question is: "did the student write the work him/herself, or did they pass someone else's work as their own". The position "yes, I copied two lines, but it's not a big deal and how are you going to prove it?" is immature, imho.

If one of my students copied two lines of code which are not really important for his/her work, I would just ignore it. I can fully understand why the student considers this "not a big deal". Actually, I try to teach my students to cite less, e.g. not writing something like "Java is a programming language [13]". It is important that all main ideas (that are not your own) are properly cited and acknowledged, but all that tiny stuff that is either common knowledge or clear if you think about it for five minutes does not need a source.

@aeismail: The mild punishment applied in this case is certainly not to harsh. As in most cases, universities are far, far too generous in treating students who have plagiarised, or cheated in other ways. Merely applying a penalty based on the current assignment instead of giving a fail for the entire module is about as mild as a penalty for plagiarism should ever get.

@TheSmartWon: GPL2 requires citation (that is, when it says that you must release your derived work under the same license, it does not mean "a fresh copy of the GPL2 license from FSF", but "the license you received with the code you used, including its author identification")  The GPL has several rules dealing with editing the author list when releasing a derived work -- you can't leave it alone (which passes blame for your bugs onto the original authors) and you can't remove people from it (which robs the original authors of credit for their work). You really should read the license.

Questions you need to ask yourself:

Did you cite your sources?

Although the topic of plagiarism crosses different fields, not all fields are the same. Writing a program is not the same as writing an essay. Although both share similar components of thought, grammar = tabs/spaces, nouns = objects, prepositions = pointers, etc. Functionally they are different. As part of your assignment, did you cite that you got the sections of code from an open source library? Even if it wasn't a formal citation, then perhaps within the comments linking to the library?

How many ways can a person realistically complete a given goal?

If the task was to sum a list of integers. Would it be plagiarism if 10 programmers' code used sum(object)?

a common algorithm for chaining that I can explain thoroughly

This is where you need to argue that there is a point where a given piece of code has become common information, but you need to demonstrate that it is in fact, common. A non-expert would not have the background knowledge to presume that what you say is correct. You would need to provide examples. (Think of Hello World, who really 'owns' it?)

Patenting Software is complicated

IANAL, but it would appear that the actual law itself is complicated.

Over 30% of the class has been reported for academic integrity violations on projects over the semester, and the newly graduated professor doesn't seem to think himself or his assignments are the problem.

A professor of computer science is not a lawyer, but he or she certainly has the capability of understanding computer science questions and ask him or herself whether or not there is malicious intent involved. If the plagiarism claims can be addressed with a simple document where you cite your sources (libraries, open source projects, github repos), then the claims should go down.
Knowledge and learning doesn't happen in a vacuum.

Thanks for this. Like I said before, citing code is foreign to me (and I've been programming since age 8), and I did NOT (but SHOULD have) cited those lines. Forgetting to cite two lines and committing plagiarism on the whole project are two different things, though, especially on a project of this size. How would you address that?

You make the argument that the current tests to determine plagiarism (such as in english) does not work well when it comes to programming and scripting, citing and documenting your sources is functionally different. In an essay, citation is to demonstrate where you got the idea from. In an program, it is to document how the snippet of code will help you achieve your goals. The purpose shifts from 'giving credit where it is due' to 'how is this going to help and what does it do'.
With this in mind, look at "hello world". It is a universally known introduction to programming languages. But no experienced programmer needs to 'cite it' to understand it. It has become 'common' across all languages. However a specific compiler in C that will allow it to control a robot arm, is not common enough for a experienced (regardless of language) programmer to recognize it easily, hence the need for documentation. Within the world of Java however, it would be up to you to demonstrate that the code you would be 'common' enough to not be considered to require citation.
As far as the case itself, you can make the argument that your actions don't constitute the traditional definitions and test for plagiarism. But don't expect that your audience (fellow peers) would understand given the severity and the credentials of the plaintiff (your professor). Another avenue would be to argue how the severity of the punishment -100% is not consistent with the scope of the alleged plagiarism. It is alleged, not proven. Until a definitive judgement is made, it is open to debate.
To fail a student unilaterally based off of plagiarism would and should be appealed to a 'higher authority' or at the least, reviewed by a panel of knowledgeable individuals (versus laypeople). You stated that this class has an (in my opinion, enormous) percentage of plagiarism claims. While I don't have stats for back up my statement, 30% is ridiculously high. In my academic career, plagiarism was an RARE occurrence. So another point you can make is whether or not the professor is misapplying the concept traditional plagiarism to a field where it is fundamentally different.
Another argument you can make is that code citation was never taught/stressed/expected by the professor in the class. You were taught what plagiarism was before, most likely when it came to composing essays, but never taught how it applied to coding. Although this argument might be missing a leg or two (especially in the realm of, you should already know), but how would it be reasonable to hold you accountable for something you've never been taught to look out for?

Thanks, that's a good point to raise. He just uses MOSS from Stanford, like I linked in the OP. I don't know his cutoff of percentage similarity before he accuses people.

A plagiarism detector like that is a Tool to lend credence that X was plagiarized, a tool among many. It is by no means a end-all be-all test to determine plagiarism.
Take a breath-analyzer test for DUI's for example, if I ate Poppy Seeds and tested positive, would there be extenuating factors? If all your professor is using to determine plagiarism is a tool, ask whether or not tools can be flawed.
Although this is more rhetoric and logic than programming, I am sure no one can ever claim that a program is perfect. (Except COBOL, because it is 100% perfect) So if it is indeed the only metric that your professor is using, what's the possibility for false positives? Would it be just to unfairly punish students if a program determined that they cheated?
With this said, read your student handbook if you can have an academic adviser through the process. Also contact your ombudsmen services if your school has one. This office can arbitrate issues such as this if the institution allows for it.
In my opinion, a panel of fellow students (without legal or programming backgrounds) would not be best suited to determine if programming plagiarism occurred.

Clarify, is -100% actually 0%? Or is your professor not only giving you a 0% for the assignment, but also further penalizing you an additional amount? I.e. A+B+C=100 (A=20,B=20,C=60), a 0% on A would mean total 80%, a -100% on A would mean total of 40%. - Bluebird
He is further penalizing me an additional amount. I would not be receiving a zero on the project (which my grade could afford), but actually my overall grade is being hurt MORE than the 7% the project is worth. –TheSmartWon

Tricky thing here... (given the update) if the board finds in your favor, this does not mean that the professor would treat you as he/she would other students moving forward. You may find yourself under even closer scrutiny.

@user2264247 He looked at the MOSS with me for about 5 minutes today
(exactly the one I posted in the OP), and he only focused on that hash
function. He did not even know what the function did before we talked,
so I don't think he previously reviewed it. Him and his colleague (idk
why she was in the room) stated, that because I copied two lines, my
whole program is guilty of plagiarism and that they would accuse me.
They really didn't seem to think twice or care about it, probably due
to the large number of cases they go through. – TheSmartWon
@FrankFYC That colleague and him also publish papers together, and
teach companion courses. They are good friends. It's just his name
accusing me on the "integrity violation report", but I'll raise that
point for sure. I have no idea what she was doing in the room, all she
did was quickly dismiss all my arguments that my professor might
otherwise have listened to. It brought her joy to prove me wrong on
every point I raised, it was kind of sadistic. I was like another
insect trapped in their web! – TheSmartWon

If this was the United States. Read about FERPA. I am not an expert, but I would presume that if your professor allowed another faculty member to see your grades, it would be a violation. This might be the act that blows up in their face. If you are in the US, make sure to establish the fact that both professors were in the same room as you when you discussed the report.
Please see aeismail's answer to a question.
Given the number of other cases, would you presume that the other professor was in those cases as well? As in, the other professor was privy to other student's grade?
They can deny it all they want, but if more than one student claims that both professors were in the room, this would be in effect, a class action (ha, pardon the pun) issue.
Document everything, and set up an appointment with your university's FERPA Coordinator (like a dept. set up to receive FERPA complaints).

Thanks for this. Like I said before, citing code is foreign to me (and I've been programming since age 8), and I did NOT (but SHOULD have) cited those lines. Forgetting to cite two lines and committing plagiarism on the whole project are two different things, though, especially on a project of this size. How would you address that?

You make the argument that the current tests to determine plagiarism (such as in english) does not work well when it comes to programming and scripting. The degree of documentation is functionally different. In an essay, citation is to demonstrate where you got the idea from. In an program, it is to document how the snippet of code will help you achieve your goals. The purpose shifts from 'giving credit where it is due' to 'how is this going to help'.

With this in mind, look at "hello world". It is a universally known introduction to programming languages. But no experienced programmer needs to 'cite it' to understand it. It has become 'common' across all languages. However a specific compiler in C that will allow it to control a robot arm, is not common enough for a experienced (regardless of language) programmer to recognize it easily, hence the need for documentation.

As far as the case itself, you can make the argument that your actions don't constitute the traditional definitions and test for plagiarism. But don't expect that your audience (fellow peers) would understand given the severity and the credentials of the plaintiff (your professor). Another avenue would be to argue how the severity of the punishment -100% is not consistent with the scope of the alleged plagiarism. It is alleged, not proven.

To fail a student unilaterally based off of plagiarism would and should be appealed to a 'higher authority' or at the least, reviewed by a panel of knowledgeable individuals (versus laypeople). You stated that this class has an (in my opinion, enormous) percentage of plagiarism claims. While I don't have stats for back up my statement, 30% is ridiculously high. In my academic career, plagiarism was an RARE occurrence. So another point you can make is whether or not the professor is misapplying the concept traditional plagiarism to a field where it is fundamentally different.

Thanks, that's a good point to raise. He just uses MOSS from Stanford, like I linked in the OP. I don't know his cutoff of percentage similarity before he accuses people.

Has your professor given more specific reasons for why you were accused of plagiarism? From the link you provided: "In particular, it is a misuse of Moss to rely solely on the similarity scores. [...] But the scores are certainly not a proof of plagiarism. Someone must still look at the code."

The copied hash function seems like the only damning thing to me, but it's literally 2 lines of actual code doing a purely mathematical function. If your plagiarism is compared to an essay, this is like forgetting to cite one single quote in the entire essay.
In your actual defense, you may want to rely on innocent until proven guilty and not cite these counterpoints unless he actually points to them as reasons for your guilt. (ie hash might be unnoticed, so no reason to add fuel to the fire) He might also end up looking bad if he inadvertently admits considering MOSS as proof.

@user2264247 He looked at the MOSS with me for about 5 minutes today (exactly the one I posted in the OP), and he only focused on that hash function. He did not even know what the function did before we talked, so I don't think he previously reviewed it. Him and his colleague (idk why she was in the room) stated, that because I copied two lines, my whole program is guilty of plagiarism and that they would accuse me. They really didn't seem to think twice or care about it, probably due to the large number of cases they go through.

Yeah, a bibunal (two person tribunal) isn't really necessarily an impartial judge. Definitely something to point out.

@FrankFYC That colleague and him also publish papers together, and teach companion courses. They are good friends. It's just his name accusing me on the "integrity violation report", but I'll raise that point for sure. I have no idea what she was doing in the room, all she did was quickly dismiss all my arguments that my professor might otherwise have listened to. It brought her joy to prove me wrong on every point I raised, it was kind of sadistic. I was like another insect trapped in their web!

@FrankFYC to answer your last edit, the board does get to decide my punishment. They may penalize me up to failing the course, or completely waive the claims.

Does the professor have an appeal to the board's decision?

Also, what is your country?

@FrankFYC Goodness, thanks for all the help. I'm in the USA, and I'm not sure what the professor's role is moving forward. I'm reviewing that now. All I know is he has to present evidence (the first MOSS I linked) to the office of student conduct, and that they'll send me an email in two days detailing the process more.

@FrankFYC I just read the overview of the process he went through. Interestingly, during the meeting step, it says "It is not necessary to have another faculty or staff member with you as a witness." His part of the report seems to end after he submits the paperwork to the office, and the office handles it from there I assume.

Not necessary =/= you are not allowed. You can, and I would highly recommend it. Find a trusted faculty member who would be willing to vouch for you. As for the fact that you are in the US, congrats, you now have a possible FERPA violation by the Professor in question.

Let us continue this discussion in chat.

Let us continue this discussion in chat.

You might want to withdraw your appeal (if able)
At first glance, your argument looks entirely reasonable.  This is, if you copied two lines of code (assuming that such was allowed) but simply failed to include a citation or forgot to remove it (as you've claimed), then that could basically be chalked up to an honest mistake, on-par with a typo.  Such a mistake would be unfortunate, but hardly merit major punishment.
However, as others have noted, a closer look at the code makes it look like you completely copied the original code and then went out of your way to try to obfuscate that fact.  This causes all sympathy to go out-the-window; if anything, you may be getting off too lightly.
But, then there's your appeal.  The appeal itself appears to be based in a dishonest premise, much like this question does.  It looks like you're lying to the honor council!
Such a lie would seem to be grounds for further punishment.  This is, first there was the cheating - the severity of which you've now called attention to - and then also the apparently fraudulent defense.
I don't know what to tell you.  On the one hand, this is pretty gross and it might actually be better if you learned your lesson now.  But as an answer to this question, assuming that you're trying to minimize punishment, it'd seem like you might want to exit the appeal and leave things alone, rather than risk making them worse.
Reference:  Regarding the right to not self-incriminate
In the American legal system, it's sometimes thought that defendants can claim innocence without further penalty if that claim is later found to be false.  This follows from the Fifth Amendment to the US Constitution which grants protection against self-incrimination.
The funny part about this is that, if you watch a lot of Law-&-Order-type shows (as many Americans do), you may be used to the idea that defendants can lie about not being guilty without penalty, which one might be inclined to apply to other court-like settings, e.g. an honor council review.
The thing is that honor councils aren't courts of law; the right to not self-incriminate doesn't apply.  So if you lie in your defense to an honor council, you're still lying before the exact people who'll judge you for that exact misconduct.
Edit:  Went to fact-check myself on this point, and it appears that the Supreme Court ruled that lying in one's own defense can increase sentences:

The Supreme Court ruled unanimously today that criminal defendants who take the stand and testify falsely in their own defense may constitutionally be subjected to additional prison time for obstructing justice.
The decision overturned a ruling by a Federal appeals court in Richmond, which held in 1991 that the Constitution bars judges from imposing an additional sentence under Federal guidelines as punishment for "a disbelieved denial of guilt under oath."
-"Court Says False Testimony Can Bring Longer Sentence", NYTimes (1993).

So, apparently defendants can be penalized for lying in their own defense even in US courts.

There may be not many reasonable algorithms which implement chaining, but there are literally billions of possible 32-bit hash algorithms. There's no point in claiming that one of them in particular is "common knowledge", or that it's released under GPL, or that you were about to remove it. If you did remove it, your case would look completely different, and I would argue you should be claiming independent duplication. In your current position I don't think you can convince anyone that you have picked the same hash algorithm independently from OpenJDK.
So I believe your best option is to recognize the wrongdoing, then argue that the amount of actually plagiarized code is relatively small and the penalty your professor wants to put in place is disproportionate.

I have both experience in teaching (and handling plagiarism) and software patenting/litigation.
I've graded clusters of homework all showing the same error or the same imperfection. I've seen students not able to start their IDE coming up with concise and expert homework solutions, where all the variable had names like "theCounter", "variableA" and "myself", but other than that, their author looked like already having 10 years of experience in the field, and clearly not in need of an undergraduate degree.
A software patent case may be reduced to proving that a single line like "x=0" has been plagiarized. This includes proving motive, people (the fact that company A has attracted people from company B) and state of the art at the time of the alleged plagiarizing (and not now, when the proposed approach is obvious for everybody). Software patent trials are not sterile discussions on how the Smith–Waterman algorithm performed on plaintiff's and defendant's code.
In your case, it seems that you at least "looked" at OpenJDK code before starting yours. Irrefutable evidence is the hash function: the probability to replicate this by chance, according to Mr. Data and C-3PO, is one in 67 trillion-billions. It is further clear that you were not looking for a hash function, but for a hash map implementation. Searching "hash function for strings" or "hash function for strings java" does not yield a result from OpenJDK.
Once you have seen the OpenJDK implementation of hashMap, the problem was straight forward to you. From all the possible ways of approaching the hashMap,  conscious or not, you have chosen the one from OpenJDK, because you were terribly biased.
Your code comments are useless. Commenting "length" as "the length" proves that you didn't comprehend the problem, and commenting was intended here to merely fulfill a grading requirement. You waste grader's time. Correct would be: "hash = the Hash of the element to be searched",  "Length: the size of the hash table" "returns the position in the hash table of specified length for the element of hash h. It never exceeds the length minus one".  Further, you say "get returns the value at the index", which is blatantly wrong for a hash map. Get would return the value at the key. Mixing key and index is a "capital offense" if you do data structures.
My judgement here would be "guilty as charged". You didn't spent time thinking of the solution, but you took an existing solution and probably implemented independently.  It defeated the purpose of the homework, which was intended to make you think data structures. Citing OpenJDK source would only make your guilt more obvious (a classic case of self-incrimination during defense). It's like being given a Math problem and you end up citing the book and page showing a solution of the problem. You did a good search job, but the intent of the problem was to make you solve it.

This is a great answer.

Other answers have addressed the philosophical/moral questions such as "Is it plagiarism?" "Is it wrong?" etc. But - I would argue you should be focusing on the practical problem at hand, which is:

I'm not sure how to defend this whole case before a Student Conduct Board.

So you have a case to argue...

First, read up on the legally-relevant documents:

Student disciplinary regulations
Student council procedures
Lists of external laws that officially apply
Exact statement of the charges against you
Precedent - past student conduct board decisions on such matters.
Session protocols from past student conduct board sessions (if they're available, which may not be the case).

Then determine if you are allowed, and whether it's a good idea, to be represented by someone: A laywer; a law student; a member of faculty; a student council member etc. If that's available to you, you should at least consult one (even if you don't end up bringing them along) - they surely have more experience than you.
Now, determine if you really want to argue "this part of what I copied doesn't constitute plagiarism". Maybe you could make that argument, I don't know. Even to laymen - if you have enough time (which you may not), you may be able to explain how programs are compiled from source code and how some code is not really used. You could present examples of what seems like plagiarism but is in fact nearly-identical code written independently by different people.
Frankly, I doubt this would get you very far ahead considering the circumstances. Even if you are right theoretically (a question about which I'm not commenting), and even if you could explain this to the board - it might not want to hear such an argument.
On the other hand, I would guess (baselessly!) that a more convincing argument might be something like (brief summary):

I'm very sorry for what I've done and do not deny it was disallowed, inappropriate and immoral.
  I was tempted to plagiarize because of ABC, which, while not excusing my behavior, has also led 30% of the class to be tempted to plagiarize, suggesting an objective problem in addition to my personal failing.
  I've made amends in ways XYZ.
  In cases C1 and C2, which I argue are comparable, the penalty was much lower.
  Finally, I would like the board to take my personal circumstances DEF into account when considering this case.
  I will abide by any decision the board renders.

and leave it at that.

The question is the title asks "is it a plagiarism?" and not "how do I defend my case?" The problem, imho, is that student does not accept the fact was a plagiarism and tends to dismiss it as "not a big deal". This position, imho, is not worth defending.

@DmitrySavostyanov: OP asked several questions, and the one in the title is not the only one. I agree, he seems to be trying to dismiss what he did as "not a big deal", but he has a long time to contend with the moral dilemma, and just one month to prepare for his hearing. I claim that that should be a focus. Hopefully it will also help him stop dancing around what he did.

You should definitely protest the proposed punishment, because many institutions do not allow for such a punishment as the one your professor wants to assess. (In other words, your instructor can't give you a grade of -100%, or any grade less than zero for a given part of your grade.)
On the matter of copying code as plagiarism, that's a much thornier claim. Using somebody else's code is a problem, but if there really isn't another way to do something, then how do you claim plagiarism? Plagiarism doesn't extend to "obvious" statements. For instance, it's not plagiarism if two calculus textbooks solve an integral using a series of equations in the same way, because basically it's the only way you can do it. On the other hand, if you write a bunch of text around it that's the same, then you've committed plagiarism.

I don't think "[at most institutions] your instructor can't give you a grade of -100%, or any grade less than zero for a given part of your grade" is really true. I don't think it's uncommon for the penalty for plagiarizing to be more than the assignment is "worth".

The regulations of "most institutions" are irrelevant. Only the regulations of this institution matter in this case. Staff members are usually aware of the rules, but if this particular punishment goes beyond what's allowed, it can be appealed (but not the plagiarism case itself).

I've changed "most" to "many"—but it's certainly worth checking. I know I've had proposed penalties substantially reduced, and couldn't even assign a "0" on an exam because of cheating.

@DmitrySavostyanov: I'm aware that other institutions' policies are irrelevant, but I'm providing the OP with a reason why an appeal should be considered, even if he's admitted to plagiarism. (And he can argue that the plagiarism is certainly not as severe as alleged, which may make a difference).

@aeismail: It seems to me that your latest comment above would make a better answer than your answer. If the penalty assigned by the instructor exceeds what the institution's policy allows, then the OP should certainly object to it. If not (and they definitely should find out beforehand), all they can argue is that it's not in proportion to the severity of the offense, which in any case will be a subjective call in the end.

Plagiarism is a difficult topic in computer science, as there is only a limited number of code pieces that lead to the same result, and only one of them can be considered an optimal solution.
You in fact did copy the code from the Java libs, both the actual code and the naming of variables suggest that. Therefore it would have been your duty to cite this properly. In this strict point of view your professor is correct, and probably he is also correct in the other cases you mentioned. If many people make mistakes, it still is the problem of the one person making the mistake, not the one correcting it.
If it is ethical is however an entirely different topic.
When programming complex functions it is good practice to not re-invent the wheel, but instead use existing, well-tested code from others. However - as from the linked article - "reinventing the wheel is often necessary in order to work around software licensing incompatibilities"
If you had the specific order to not copy existing code and you failed to obey that order, the issue is on your side. Software patenting is a severe problem in the United States, several smaller companies went bankrupt because of it, larger companies own certain patents only to use them to counter-sue should the be sued (see Apple vs Samsung). Essentially software patents have transformed to a kind of weapon that can be used to erase unwanted competition from the market. Therefore it is important for any software developer (in your country) to be able to detect and work around such licensing issues.
I do not know the intentions of your professor, but it might be possible, that he added that clause specifically because he is aware of the consequences of 'code-stealing', and his harsh reaction is a way to teach you to avoid those issues in situations where it would really hurt.
In other, not so narrow-minded parts of the world, software patents or 'plagiarism' as in your case are much less of a problem. This means that in other countries your work could have been considered differently, some might have even reduced your points for not copying existing code (unnecessary reinvention of the wheel). But you are not living in "other countries" so also from an ethical point of view your professor might be harsh but he is still correct.


text:
Should I answer this question about diversity?
There is an optional prompt on my PhD application:

censoredSchoolName University regards the diversity of its graduate
  student body as an important factor in serving the educational mission
  of the university. We encourage you to share unique, personally
  important, and/or challenging factors in your background, such as work
  and life experiences, special interests, culture, socioeconomic
  status, the quality of your early educational environment, gender,
  sexual orientation, race or ethnicity. Please discuss how such factors
  would contribute to the diversity of the entering class, and hence to
  the experience of your censoredSchoolName classmates.

If I were to answer, what I would write is something about how I grew up in a large family with five siblings all attending college around the same time, so though I come from a middle-class family, I have had to handle much of the financial responsibility of my education. In addition to this, neither of my parents have attained higher than a non-scientific Bachelor's degree, and I have mostly blazed this path under my own independence and ambition.
But I feel that this might not be what the question is really looking for? What I've written above does not make me diverse in the way that I think the University probably wants. I'm a middle-class white male, I will say, which my application has of course already reflected. I'm wondering if I might be better off leaving it blank rather than coming off as forcing a hollow answer, or even pitying myself when there are certainly other applicants with serious disadvantages.

The question in its current form is about how a particular answer (or non-answer) on an application will be perceived, it is not an invitation to debate the wisdom of diversity initiatives in the comments. This conversation has been moved to chat, further discussion is subject to deletion.

Thank you Anonymous for appreciating my comment.
I suppose that makes it good enough to be a succinct answer.
The admissions committee is made up of people. I would suggest showing them your humanity and social intelligence in the best way that paints the most professional picture of yourself.
Did we apply to the same school? That looks like the prompt I received. Hopefully you're not applying to the same program as me. Anyway, you don't have to say that your race is what makes you special. You could talk about what makes you intellectually diverse. How do you handle when you get an unexpected result in your experiments? How do you work with others? What have you learned from collaborating with others and what have they learned from you? What are your views on mental health? I knew an intelligent student who committed suicide last month. Some professors talked fondly of him at his memorial.
Some people might be applying to a program because they like how collaborative it is, and that you are allowed to be a TA in another department or something. The point is mental health and a good work environment is important to a university's reputation and production. Of course you can leave it blank, but you don't have to emphasize that you are a white middle class person. The admissions committee is made up of people. I would suggest showing them your humanity and social intelligence in the best way that paints the most professional picture of yourself.

I am selecting this as the answer because the boldened text above was what I thought to be the most satisfying piece of advice here, though xyz123 does reflect very similar sentiments to ElizabethHenning and @AnnaSdTC, whom I also thank. And thanks to all for the discussion over the past day or so.

@NicoleHamilton first of all, especially after this thread, I don't think there is any "correct" kind of answer. Secondly, I didn't really talk anything about what this answer says in its third paragraph. I just chose it as an answer because the bold text alone made up my mind to put a nail in this and answer it (after all, the question was should I answer this, not what should I say). For the actual context of my answer, I said more of a combination of what ElizabethHenning and AnnaSdTC answered.

Comments are not for extended discussion; this conversation has been moved to chat.

Leave it blank
You don't have to play along with the diversity people, but that doesn't mean there won't be any consequences.
Throughout my time in undergrad, the US military, and now grad school, I have steadfastly refused to answer questions about my race. And why should I? My father is from Mexico and is still a dual citizen. As far as I can tell, that gives me a pretty good claim to be Hispanic. I am born in Boston, I don't speak Spanish, and I don't particularly like anything Mexican. Am I hispanic? What is my hispanic blood quantum? Am I white? Who cares?
What ought to matter is the content of your character, or so I've heard.
Just don't be surprised when people don't want to let you go. I have been called into a senior officer's office (in the military) and forced to answer a question about my race. When I told him it was 'American', he filled out the forms in question for me as white. I haven't always got off easy, but I've done alright in life, and without participating in such racist activities as classifying people based on their skin color.
PS: The original form of your question was just fine. If you have sneering contempt for this kind of diversity question, then you do. Don't let people bully you into thinking your opinion isn't valid.

Comments are not for extended discussion; this conversation has been moved to chat.

First of all, nobody is discriminating against middle-class white men. This prompt is an opportunity for applicants who feel they are stronger than the standard academic metrics might suggest to make a case for that by highlighting other unique contributions that they would make to a program. Not coincidentally, people from underrepresented groups or who have had to overcome other difficulties generally fall into this category. If you feel you fall into this category, then by all means answer this question with your story. If you don't feel you fall into this category, then one possibility is to try explaining your own personal commitment to enhancing diversity and giving opportunities to others who might not have had them earlier on.

That's the thing- I do not honestly feel that I fall into the category. While the possible answer to the question I gave is true, I don't feel honest in using it as a response to a question about overcoming difficulties. Your last sentence is the best advice I could have hoped for, though. Thank you

Comments are not for extended discussion; this is certainly not the place to debate the wisdom of diversity initiatives. This conversation has been moved to chat, further discussion in comments is subject to deletion.

This is a prompt that allows you to defend your weaknesses or bolster your strengths.
These types of questions are designed to bring the person, not the paper, into view. People who are 4.0/40/800/99%ile all appear the same on paper grades-wise, it's the writing prompts that put us past the numbers. If you disingenuously mention that you are an average applicant, of course no one will put that in your favor. If you want to sell yourself, you sell that parts of you that are unique.
I would use this question to justify why my past educational history of getting a 1.5 GPA in one graduate school is not indicative of my current performance, and explain how this setback influenced me and my educational and professional prospects, and how I ostensibly recovered from it and received a Master's degree in a completely different subject with a more acceptable 3.6 GPA, covering my work history and renewed focus on other extra-curricular activities and maybe point out my renewed interest in painting.
You'll notice that not once did I mention, or even need to mention, my ethnic background, because I didn't feel it was relevant for making me unique.

I would say that growing up with many siblings and the financial responsibility that comes with it is, indeed, the kind of diversity that many universities want to have. At the end it's not about gender/race by itself, but about possible difficulties you've had on your path to academia, and race/gender are very obvious sources of such difficulties, but not the only ones. Plus, it signals a degree of early adultness that many people don't have even when they go to grad school, even less so at age 18, both in the financial side (you were self-sufficient, or almost, quite earlier than most people), but also, if you think it is true, you can elaborate on how living with so many siblings turned you into a person who knows how to work in team, etc.
In my PhD application, in my statement of diversity, I briefly mentioned about being a woman in a STEM field and all this, but I mostly talked about studying and performing music quite seriously at the same time I was doing math in college. Moreover, my main letter writer also emphasized that I had quite a few shitty jobs during that time. With these two things I (and him) were trying to explain my low GPA (high GRE though) and my extra years to get my bachelor's, but that I actually had quite a bit of self discipline. I don't know if that helped, but I got into some of the top programs I applied to. The same professor wrote, a year after, a letter of recommendation to my friend and colleague P, who was working for him at the same time as me, saying that P worked in a supermarket on evenings and weekends all his college years to pay for it. P also got offers from good PhDs.
A statement of diversity, as I understand, is not necessarily "what color is your skin" but "what makes you unique and different from others, or what added value other than academic performance are you bringing to our department".

Thanks. I am the opposite - high GPA but totally bombed my Biology GRE. So I'd like to take any opportunity - like this one - to boost my application. I just felt that this question really wasn't intended for me. But I guess you're right. Congrats on your success

Comments are not for extended discussion; this conversation has been moved to chat.

To agree with @kingledion's answer:
Leave it blank
In principle, there're ways that you could use that field to your advantage by crafting a sufficiently clever response.  For example, as @ElizabethHenning suggested, it could be an opportunity to talk about the value of diversity, signalling a political alignment that'd be statistically likely to work in your favor.  Objectively speaking, doing so would probablymight increase the odds of your application getting accepted.
The problem's that, if one buys into that premise, it'll come to influence their character a bit, however slightly that might be.  Every time a person thinks of themself as having been disadvantaged, they lose a bit more personal power.  Cumulatively, it becomes a self-reinforcing phenomenon.

Comments are not for extended discussion; this is certainly not the place to debate the wisdom of diversity initiatives. This conversation has been moved to chat, further discussion in comments is subject to deletion

I hate to discourage you, but I highly detest institutions that ask for your very private, personal details but themselves provide boilerplate, elusive texts which are (up to the school name and address) not school-specific or even country-specific. Essentially, their approach is "do as I tell you to do, not as I do myself". As an answer, you could provide a top-level boilerplate, equally elusive text on diversity which seems specific but, in fact, is not specific and not revealing any personal details beyond your CV. Feel free to take a look at the diversity statements of different schools (they are mostly completely interchangeable up to the school name), mix them, adapt them to your name, and pepper with "personally", "subjectively", "in my experience", etc., at appropriate places.
This is a good exercise: you'll demonstrate your language proficiency in selling fog. This is what the diversity statements often boil down to in reality. In your life, you might have to do it every once in a while, and writing a diversity statement is an excellent opportunity to start.

As with all things, this has nothing to do with you. It has to do with money. Your university doesn’t actually care beyond what is required to comply with laws and state and federal regulations regarding “race”.
You are not required to answer it. So if you don’t want to, or have a problem with these kinds of questions, then don’t answer it. Since you are white middle-class it should neither help nor hinder you very much.
If you were non-white, it could very well help you and would be worth your time to answer.

Your final paragraph directly contradicts your first paragraph.

(In the first paragraph) I think you're confusing this question on an application with the kind of question you get on a employment form when you've been hired.

@DrMcCleod Where exactly is the contradiction?

@DmitryGrigoryev: The first paragraph suggests that the university considers this to be nothing more than a form-filling exercise, but the third suggests that it will be used to give race-based, preferential treatment. One or the other, but not both.

Comments are not for extended discussion; this conversation has been moved to chat.

There is an optional prompt on my PhD application:

Whoa! There's the problem. IMHO anyway.
If you really want to go do research someplace, talk to the faculty in the group you're interested in. Go for a visit. Discuss potential research avenues. Perhaps even read something at their behest to see how you like it. Then, if they unofficially express interest in you coming to work there (and yes, I did say work) - then either they can take care of the formal application, or you can go through the demeaning motions of applying to a web form - but then you wouldn't need to fill these kinds of boxes since, supposedly, it should be in the bag.

At my university all applicants must go through the online application process in order to be considered for acceptance by the university. I can't do that process for them (how would I have access to grades and such?).

@kmm: 1. If you're a permanent member of faculty, act to change this (not for you to do it for people, but to be able to circumvent this completely with people you/your research group/your department have decided they want to recruit. 2. If you want to hire someone, then you've already seen any grades which might be relevant. 3. Even if you're stuck with the current predicament, be in a situation where you can tell your new recruit "Just skip all of the unnecessary fields and copy-paste a message saying to contact Professor KMM".

You should answer the question, because each personnal story is valuable and unique.
You don't have to find your background original.
Most people would describe themselves 'normal', so it would be a good idea to ask a friend about what they find special about you, about the interests or experience you have for example.
No friend would answer 'You're my friend because you're from -this minority race/gender/religion group-'. Friends don't care about a lot of the aspects mentionned in the question, so focus on the ones that matters.
There are original personnal traits that are perceived as 'diverse', but in fact a lot of them don't contribute to others at all.
Sharing about your experience demonstrates effort and authenticity, and that will certainly contribute to the experience of your classmates.

Comments are not for extended discussion; this conversation has been moved to chat.

"Personal stories" can also help interviewers differentiate between two equally qualified candidates: your personal story may hint that you'll be a harder worker, or you'll bring something unique to a graduate program, or that you may be temperamentally suited for graduate school or the type of work you're applying to.

The question does not seem like the typical generic "optionally check here to identify your race/ethnicity", but more likely a question to provide some insight into your though processes.  If you are applying to a social sciences grad degree, I'd give serious thought to answering the question.  If you are applying to a chemistry or some program like that you might be able to get away with not answering the question.  Also, some institutions ask these kinds of questions not because they want to, but because they have to.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
My mental health has been damaged. I don't want to quit my PhD but I don't know how to continue?
I have been in the lab for more than a year and my mental health has been damaged seriously due to the harassment of my PI, and I believe my PI has breached my confidentiality by sharing information I told in confidence with other group members and the administration.
I have thought about going elsewhere to continue my PhD. However, I realized my academic progress has been delayed due to the mental health problem and I would need time to recover. I am afraid of jumping into another lab. Also, I do not find any other professors in my department whose research interests me, perhaps because  my mind is currently occupied with all the negative experience with my PI and that clouds my thinking?
I want to change university and start totally fresh but obviously I would not get a good LOR from my PI.
I want a career in academia but I really need sometimes to recover. How should I proceed?

(Edit: adding update posted as answer) Thank you very much for all the suggestions. I avoid talking all the problems with my family since they are not in academia and I do not want them to worry about me. Writing all my thoughts here helps me to release everything I've tried to keep inside myself. I think my mental health seems to not as serious as I thought because after reading all the comment, I feel more positively now.

can you change department? @superStar? DO YOU  have that kind of option

I see a guy who changed department but he has to self-funded his study in the new department. I cannot self-funded my PhD :(

of course I understand that, but please dont discredit your option, go and talk to professors from that departments! I did it and I found out better funding possiblities. I went from biomedical to technology department, and it is ok. give it a try. you will love it I think since they understand you come from other field

or try to find new one?

I think my mental health seems to not as serious as I thought — Talk to a mental-health professional anyway. Seriously.

my mental health has been damaged seriously due to the harassment of my PI — Don't walk. Run. — I want to change university and start totally fresh — Good.  Do that.

To back up the comment by @JeffE, mental health issues are sneaky, and may come crashing down on you in full force even after weeks, or even months, of feeling perfectly fine. Don't make the mistake of telling yourself that everything is fine after reading sympathetic comments on the Internet - it isn't!

do you really think this is mental health problem @valderman ? or it is problem of bad advisor?

@SSimon The two are not mutually exclusive. Mental health issues do not magically go away just because you removed the situation that caused them, just like a cut doesn't heal in an instant just because you remove the glass splinters that caused it.

@valderman I dont think he or she has them. insecurity and feeling down is not always mental health issue.

If your mental health is suffering, then the first thing you need is to seek professional counseling for that.
Once you feel you are in a space where you can make decisions clearly, you need to get out of your current situation in the least harmful manner possible—whatever you perceive that to be. If it means leaving with a master's, great. If you have to walk away, then you need to do that instead. No outcome is worth risking your long-term mental health.
Moreover, the fact that your advisor aired the dirty laundry in public is a serious violation of trust, and a clear sign that you can't really repair this relationship. You may be able to make something happen with the help of the human resources department or university ombudsman (or similar resources).

I did seek the help of professional counseling one time. I visited my family during winter break and visit my friends during summer. All that helped actually, I felt more energetic. But whenever I am back at work, all my energy is quickly lost.

I know a number of PhDs that required regular counselling, once a week, during their time as "students". They found this useful not just for addressing their mental health issues but also understanding how to interact with the people causing problems. Regular mental health support can help, looking at those I've known, as someone who will continue but also as someone who wants to leave whilst doing as little damage as possible. It is hard taking action rationally whilst there are mental health issues.

@superStar A single counseling session is usually not nearly enough. Regular counseling for several months, if not years, is not uncommon when it comes to addressing mental health issues. That getting back to work causes your energy to disappear, even though you felt well enough during the summer, is cause for major concern - I've seen this happen multiple times, and it's generally been an excellent predictor for imminent complete burnout.

@ThomasKing I'm not in Academia (yet), but if I'm not mistaken, even at levels such as a getting a PhD, the point is to be teaching students (as well as giving them other responsibilities). If there's so many people who are doing PhDs who need mental counseling, maybe there's something wrong.

@Byte11: There is the problem of too many academics believing in what I call the "academic Golden Rule": "do unto others as you had done unto you," not realizing there's a problem with it.

I am against counseling because it doesn't resolve the situation of OP, she has a problem on the department, the counselor is not allowed to disclose information obtained from OP. I agree with @Byte11 that it is only problem with bad academic advisor

I would like to add here, that not only is no job/career worth risking your mental health, but if whatever you are doing eats away your energy and sanity, then leave that place. As fast as possible! A PI should make you feel welcome and encourage you, not make you feel down. The relationship between a PhD student and his/her adviser is very important for a successful PhD. If it does not work, there is no shame in looking for a different position. And do not worry about what a new, prospective adviser would think. Students switching advisers/positions due to interpersonal problems is common.

@SSimon "I am against counseling because it doesn't resolve the situation of OP" - it's not sufficient to solve the OP's situation, but I do think it is necessary. The OP will likely have to negotiate the best outcome with themselves and others, I think that's difficult without support given the circumstances.

@ThomasKing yes I understand, but I think you dont understand how useless that process is. taking away time, that he or she can spend finding new adivosr or department

@SSimon if you consider therapy useless, then that is your opinion. I think that is harmful advice and a false dichotomy. Yes, doing anything takes time away from something else. However, if the OP's state of mind is making it hard to take those next steps then I think one or two hours a week of therapy is a necessary, but not sufficient, condition for improving their current and future prospects. Bear in mind, as others have noted, it sounds like the OP is going to burn out and that can take years to recover from.

I hate to point this out, but didn't your PI violate a bunch of privacy laws by airing your health issues to your group?  If so, would you consider approaching your university's HR department for help now?  I hope you feel better.

@SSimon Hello, I would like to re-iterate that the very best answer is to seek treatment first and try not to make any life-altering decisions while you are ill. I also wanted to assure you that you are right in a sense that therapy alone is usually not effective, but rather, the entire process as a regimen, say, medication, exercise, and therapy, are extremely effective. Think of it this way: the worst that can happen is you get an alternate perspective out of this experience. So start the process ASAP as there can be some delays in getting started on their end (eg, wait list)

@rlb.usa OP is not seak or have any problem

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Professor refusing to write recommendation letter to make student work longer
My friend is on his way to graduate with PharmD (outside US). He wants to apply for PhD program in US, and have asked his professors that he has worked with in the lab for recommendation letters. However, his professors refused to write him a recommendation letter unless he stays in the lab for 1 more year after graduation to work with the current on-going project (2 of them refused, another one has written him a recommendation letter).
The professor also belittled him when he asked for the recommendation letter, saying things along the line of

Am I, or this university not good enough for you? You must be pompous
  for wanting to go to another university.

That particular professor has also shared the rumor in the department that he thinks he is too good to be part of this university. In the past, they have offered him PhD program with scholarship, but have later retracted the scholarship so he rejected the offer to stay with them. He needs the recommendation letter to apply for PhD program.
What can he do when professors refuse to write recommendation letter for him unless he works with them longer? He definitely do not want to stay in that toxic environment anymore.
EDIT (12/19): All professors have agreed to write the recommendation letter, as long as my friend writes the draft of the letter himself. He has decided to go with this proposal and wrote three recommendation letters for himself, and gave it to his professors.

These are some pretty serious charges of unprofessional behavior and it's unclear what evidence you or your friend have to support them.  If the charges are true, not exaggerated, you might discuss them with your department chairman or your university ombudsman, if your institution has one.  They will almost certainly want to know and they will want to take corrective action.  But if you raise claims that aren't true, prepare for a big boomerang response.

Why does he want one? It is often a trap to pass him on to higherups anyways. Smaller office space, worse & tougher working conditions, less freedom et.c.

the kind of quid pro quo suggested in this answer is unacceptable.

Your professor is not obligated to write you a recommendation letter.
You should think about getting a letter from someone who will write a good recommendation for you.
Your professors' attitude is highly unprofessional and needs to be exposed to their academic community. When you're clear, file a complaint through proper channels to the dean/HOD. If possible, keep any record of your conversations/emails with the faculty members. Given the fact that such unprofessional behavior exists in your university (that they will ask you to work for them for 1-2 years after graduation as a condition for a recommendation letter), may be the human resource, dean office etc. themselves are unprofessional. So, tread carefully if you plan to expose their behavior. Maybe do it after you have received your degree etc. However, such behavior needs to be exposed in any academic institution for the sake of future generations.
If your foreign university asks (e.g., in future) why your own advisors didn't write you a recommendation then there is no harm in telling the truth. However, tell only the truth not your version of the truth. It's common for students at a certain phase in their career to panic, act hysterically, and believe that everyone is out to get them.

On #4: do not, in particular, ascribe a motive to the unwillingness (i.e. 'to get more work out of the student'). Even if the professor told you in so many words. You have nothing to gain and lots to lose if the interviewer reads that as a hysterical over-reaction.

If someone declines to write an LOR for you, you should ask someone else.  No one is under any obligation to write an LOR for you.  Usually, when someone declines, it's because they don't feel they can truthfully write one that would be helpful.  That could be because they don't know you or your work well enough or because they know you pretty well and don't think you were that good.  Either way, there's no point in pressuring them to write a letter they don't want to write.

Comments are not for extended discussion; this conversation has been moved to chat.

Or, they could be not writing for petty reasons, as in the question that needs to be addressed, and it could hurt the OP's application for not having a supervisor's letter of recommendation.

@MartinArgerami There could be another side to the story.  There's more discussion in chat.

I would seek a reference elsewhere. Who is suitable will depend on the precise requirements of the program your friend is applying to, but as one of the current professors is willing to give a reference this should be sufficient to speak for their current studies - you can ask a previous employer or even your old school to provide references. My successful PhD application had references from my current employer (outside academia), a professor from my undergraduate degree and a professor I did a summer project with.
I would not pressure someone to write a reference letter that they do not wish to provide - you're relying on them to reply in a timely fashion, and to say something helpful on your behalf whilst being truthful. That isn't likely to work well if they don't actually want to do it.


text:
Transition from Electrical Engineering to Physics
My name is Luka and I am currently third year of electrical engineering, specifically Power and Control Systems. I have very high GPA, and I am certain I will be applying for MSc in two years (I have to finish this year, and specialize next year in order to get Bachelor). I am 100% sure that I will pursue PhD after MSc and hope to continue working in academia. But there is one problem in this. During these years I have confirmed that my passion for physics(especially high energy physics)is much greater than one for engineering. In fact, I do not think I would be able to do any research in engineering. Because of this, I want to switch fields and to get into MSc program for High Energy Physics. My question is: Is there anyone with similar experience that has made a successful transition? And if it is possible, is it possible to follow the material? Any advice or information would be very helpful. Thank you

EE's pretty close to Physics, and if you have an interest in it, presumably you've taken a few extra Physics electives, right?  Have you looked into what else you'd need to do to get a double in Physics?

If you want a PhD, why would you bother with the master's? You'll have to pay your own way for the master's but almost certainly not for the PhD.  Most people who want a PhD go straight for the PhD and the cost is a really good reason.

Hey Nat, I am from Montenegro, and while electrical engineering faculty here is very strong (world class in signal processing), we do not have major/minor system nor possibility to choose elective classes, which I know is bad. I am currently in Electromagnetics class, and it only confirms my passion.

Hello Nicole, as you can see from my post, that would be an ideal scenario. But consider this: If I was applying to some PhD in semiconductor physics (we learn a lot about that in EE) that would be possible. But I want to apply to High Energy Physics, while my passion drove me to do some personal research, because we do not have any similar class to this in EE, I am almost certain that I would not be competent enough to pursue MSc in this field, and certainly not PhD directly. But I would need to do some catching up

As a meta-note, if you type an "at" sign in-front of someone's name, it'll inform them that you've responded to their message.  For example, to let Nicole know that she's received a response here, I'll type @NicoleHamilton .

As a warning, you'll want some education in Physics before you start a Master's program.  Since you're in EE, you'll probably be pretty comfortable with E&M, and other staples like Classical Mechanics and Optics shouldn't be too bad.  But grad Quantum Mechanics can be rough if you haven't first done the undergrad ones.

I have seen some people do this and I myself am have done something similar; it is certainly possible.
My university didn't have much flexibility for taking electives or minors either. Your best bet would be to convince your current university (or any local university) to take you on maybe as a non-degree seeking student after graduation (maybe even audit) to fill in the gaps in your general physics knowledge, with a view to eventually transition into the MS program. Doing so would help convince the professors at the institution to admit you into the program by subduing their doubts regarding your background in addition to forming some connections (I volunteered as an RA at a lab in the physics dept. in an area overlapping with my previous engineering background, which helped my get into the physics program at my current institution). Depending on the university, they may even let you into the MS program directly, with the caveat that you have to take some remedial undergraduate courses.
While you probably won't be doing high energy physics right off the bat, you will probably have the opportunity to do graduate level coursework in physics and that will set you up well for a future PhD in HEP or further graduate research in your field of interest.
You might find this link interesting
https://physicsafterengineering.blogspot.com/2018/06/my-journey-into-physics-after.html


text:
Supplement and letters
What does it mean for journal to be "letters journal" and "supplement journal"? For example, Nuovo Cimento (https://en.m.wikipedia.org/wiki/Nuovo_Cimento) journal has this distinction.
Is "letter" a synonymum for "note"?

Related: What is the difference between letter, communication and journal paper?

Letters are supposed to be short articles with innovative content, easy to communicate for the general scientific community.
From the Physical Review Letters website:

It publishes short, high quality reports of significant and notable
  results in the full arc of fundamental and interdisciplinary physics
  research.

I've never heard about that another definition, seems like it is specific from the Nuovo Cimento journal. I would think that it publishes long articles with exhaustive detailed technical/theoretical reports.