Assignment Tips (from the TAs)

Welcome to 204!

It is no big surprise that this course will include assignments. What this paper should do is give you a basic understanding of the type of work the TAs are expecting. It is always easier to complete an assignment when you know what they are looking for, and it is much easier to mark an assignment when it is in the format you expect.

Remember: the easier it is for the TAs to mark, the better chances you have getting a good mark! Try not to make their job difficult or your assignments more difficult than they are intended. The following are some hints to keep in mind ... Good Luck!


Starting and Legibility

  1. Start the assignments early! read them over, don't wait! (Please take this seriously!)
  2. If you feel the question is vague, please ask one of the TAs or your professor AS SOON AS POSSIBLE. We may need to discuss ambiguities to make sure the class all does it one way, so don't wait until the last minute.
    Your are responsible for clearing up any problems before you run out of time You snooze, you lose.
  3. All solutions must be easy to read. It does not have to be typed, but messy handwriting will be rewarded with plenty of zeros.
  4. Please answer exactly what is asked. Some terms people sometimes misunderstand:
    • "Prove" or "Show" means formally (e.g., induction), NOT just vague hand waving.
    • "Proof by example" is NOT a valid proof.
    • "Describe" does not require a formal proof.
    • "Disprove" must be formal, but usually requires a single counterexample.

Algorithm Specification

This is the most important tip of this page! Essentially, the best approach is to make it as clear as possible to understand. Don't add extra pages to your solution if they just confuse the issue. B.S. is worse than nothing (and will be marked that way) as it just wastes our marking time. Keep you answers short and sweet! (But long enough to answer the question.)

In many cases you will be asked to provide an "algorithm" for some task. What does this include? In most cases this will mean you should give us some clear pseudocode AS WELL AS a description of what it does. You shouldn't include actual code.

The description should clearly explain how to follow the pseudocode, helping us understand it as we mark it. If you just include pseudocode, the markers will not be in good moods as they try to figure it out! Also, the description should match what the pseudocode does, or it will be wrong. (i.e., don't give us pseudocode that does one thing and a description of another!)

Here is a good example:

  • Description:
    This algorithm can be used as a coder/decoder for files. If you give a file to the algorithm, it will be encoded, and if you run that file through again, it will output the original file. It is simply a loop that reads in characters. It prints out the characters unchanged if they are not letters of the alphabet. if they are, it prints out the letter 13 ahead of it in the alphabet, wrapping around back to A after going past Z. Notice that if you go ahead 13 characters TWICE, you end up with the same letter you started with.
  • Pseudocode:
    1. while (not end of file) {
    2. 	read in a character;
    3.	if the character is not a letter of the alphabet, then
    	print it out;
    4.	otherwise (the character is a letter of the alphabet)
    	let V be the value of the letter (A=0, B=1, ...,Z=25);
    5.	print out the letter whose value is: (V+13) mod 26;
    6. } 
    		

Here is a bad example:

  • Description: Here is a program that encodes/decodes a file.
  • Pseudocode:
    main(a){while (a=getchar()) putchar(a-1/((a|32)/13*2-11)*13);}
    		

Code Style and Documentation

This part will be completed soon. Please check this page again.
In general, a reasonable amount of in-code documentation is required.

Assumptions

Some questions may require you to make some assumptions, as there may be some freedom in the description. Please explicitly state all assumptions you make at the beginning of your answer.

Make reasonable assumptions only. As an example, if you are asked to write an algorithm for sorting numbers:

  • Valid Assumptions: There are (are not) duplicate numbers, the numbers are already loaded into memory, there are no negative numbers, etc.
  • Silly Assumptions: The numbers are already sorted, all numbers are the same number, etc.

Cheating

Don't be doin' it. There are painful consequences. Ever wondered who owns that cemetery just off campus? It is run by the UofA and is reserved specially for those poor souls caught cheating. Penalties range from a failing a course to having your degree rescinded.

Here is the guideline for CMPUT 204: (for details, see the Professor or TAs)
Collaborative Work: Students may discuss problems and share ideas, but must not share any written work. All assignments must be written completely individually.


Remember: TAs love assignments that are easy to mark. Good Luck! Enjoy the Course!