To make things even more clear, every sentence that you write, every figure that you draw, every notation that you use in your solutions (whether for a HW, Quiz or exam) must be something that you should be ready to fully explain and justify, if challenged. You can't say that "somebody told me this part, but subsequently everything else was written by me -- so I can't justify what the other person told me." If you have written something down as part of your solution and expect us to give marks for your solution, you must be able to justify and explain every bit written down as part of your solution.
Mutual discussion is strongly encouraged, and there is no contradiction with the above definition of copying. Discussion should not stop at just finding out something from others and then using it blindly (even if you change the sequence of words) without even understanding what you are writing. This doesn't qualify to be called "discussion" -- it is a variant of "copying". The purpose of mutual discussion is to understand concepts and go deeper into the subject of discussion, so that you learn something new and learn it thoroughly -- not simply get marks in an assignment or exam without understanding what you are writing or using.
It is perfectly fine for you to discuss problems and solution approaches, but everything that you finally write down must be in your own words, and must be something that you can justify and explain and elaborate, if challenged. No problem that you will be asked to solve in this course should require any higher understanding beyond what is taught in class, and what would have been taught to you already as part of pre-requisites of the course. This doesn't prevent you from using tools and techniques beyond what is taught in class or beyond what is covered in pre-requisites. But if you are using such things, you must fully understand what you are using, and be prepared to clearly explain questions related to the tool/technique that you are using. Otherwise, you will be deemed guilty of "copying".
The above refers to graded homeworks and take-home quizes or exams. For in-class graded classworks or quizes and for exams, "copying" and usage of unfair means includes (but is not limited to) the following: