CSCI 0190 · Fall 2026

LabAssign🔗

    1 What is This Assignment’s Purpose?

    2 Theme Song

    3 Problem Setup

    4 Assignment

    5 Testing

    6 Analysis

    7 AI

    8 Starter

1 What is This Assignment’s Purpose?🔗

One of the cornerstones of computer science is being able to use a computer to solve problems faster than pen and paper could. Whether assigning lab sections to over 60 students, or something else, we need something that not only solves the problem, but does so faster and/or more correctly and/or better than it’d normally be without technology. This assignment encourages you to think about computation applied to a real-life problem that should be very familiar to you.

2 Theme Song🔗

I Want It That Way by Backstreet Boys

3 Problem Setup🔗

Imagine you are running this course. Each student has to attend a weekly lab, and they all need to be assigned to labs that fit their schedules and preferences. They provide you their preferences; you assign them to labs. There are too many students to do it by hand correctly and painlessly and in a reasonable amount of time.

4 Assignment🔗

The course you are running has three labs, each with the same maximum capacity.

The student preferences are given as a table, PreferenceTable, in the following format:

student-id :: Number, lab-1-pref :: Preference, lab-2-pref :: Preference, lab-3-pref :: Preference

If, for instance, students had filled out their preferences in a Google Drive form, their information can be saved as a Google Sheet, which can then be imported directly into Pyret…Just sayin’. A Preference is defined as follows:

data Preference:

  | first

  | second

  | third

  | unavailable

end

Your task is to assign every student to a lab. They should be given a lab for which they are available, through whatever process you deem best. Return a lab assignment solution represented as an AssignmentTable, in the following format:

table: student-id :: Number, lab-assigned :: Number

You should implement this function:

assign :: Number, PreferenceTable -> AssignmentTable

where the first parameter is the capacity of each lab.

You can assume:
  1. Each student has exactly one (no more, no fewer) row in the table.

  2. For a given student, first, second, and third will appear at most once in their preferences.

  3. The total number of students is no more than the total lab capacity. (That is, the number of rows in the table is no more than three times the first parameter to the function.)

You cannot assume anything else.

If you feel you cannot work with the contract of assign as written, and you want to change the output type, you are welcome to do so (and document it, as noted below). We do not want you to change the input type, because that would break the autograder, which will result in outcomes that will make you sad.

5 Testing🔗

Think about all the essential scenarios that need to be considered for this problem. For each scenario, please construct a small example PreferenceTable (no more than 5–7 rows) that would serve as an input to exercise it.If large size is itself something you think important, you can give a verbal description of the nature of the table rather than the actual table itself.

While of course one table can illustrate more than one scenario, cramming too many different situations into one can make the table too hard to understand. Your goal here is communication, not showing your cleverness. Thus, try to have separate examples that are each simple to understand in their own right, and only reuse them if it doesn’t make things too complicated.

6 Analysis🔗

In addition to your code, also write an analysis of your work, answering the following questions:

  1. If you changed the output type, tell us what you changed it to and why that change is important. If you didn’t, you can just say you made no change.

  2. Please show us your example tables. For each one, explain what interesting scenario(s) it covers and, unless it is obvious, how.

  3. What properties might make one solution better than another? What would constitute a “good” solution? What would constitute a “fair” solution? Are these the same?

  4. Briefly, what approach did you take to assigning students to labs, and which of your properties does it satisfy and fail to satisfy?

  5. How easy would it be to change your solution if there was a variable number of labs, and each lab was of a different size?

Your analysis should be submitted as PDF. (If you use Word, Google Docs, etc., please export to PDF.) It should have a clear indication of where your answer begins and ends for each of the above parts.

7 AI🔗

You are welcome to use AI for this assignment. If you do, you should use our AI setup (Software). Keep in mind that you take responsibility for the work it does! You should understand its output and be able to answer questions about it. Treat it as an aid to your work, not as a substitute for your work.

Here is some advice on how to use AI well and poorly on this assignment:

You should not ask AI to design the types for this assignment. You should think hard about this for yourself.

You should not ask AI to implement the solution. You should do that for yourself.

It can be a good idea to ask AI to review your solution. First commit to your code. Wait until you’re done. Then ask it to look over your work and critique it. You will probably get a lot of pedantic critique (I find it useful to explicitly ask it to not be pedantic); but in there you may also find some nuggets of wisdom. If you didn’t first commit to a solution, you’re likely to say “Oh yeah, I already knew that”, and then you will not have learned from this experience. If instead you think you are done, and then find out you missed something, you’re more likely to learn and remember, which is our goal.

You should not ask it to generate all the situations to test for. You should think about that for yourself.

After you have thought about all the situations and written them down (again: commit!), it can be useful to have the AI review it and tell you what you missed. Again, it’s likely to give a bunch of pedantic feedback, but it may also catch situations you missed. Again, if you don’t commit, you won’t learn.

For each situation, it can be a good idea to have AI generate a corresponding example table. This is something AI tends to be fairly good at (for simple cases like ours). This is a place where the un-fatiguing nature of AI helps. If you had to do it by hand, you’d get bored and irritated after a while, make mistakes, cut corners, etc. You’d just skip whole cases that you shouldn’t. But having a machine translate the scenarios means you’re unlikely to skip important ones.

You should review each generated table to make sure it matches the situation. You may be surprised by some of them. Also, in the process of reading the tables, you may realize additional situations that ought to be checked. (Again, because the machine generates them, you are unlikely to pass on these new situations.) If in doubt, ask the AI to explain; actually read the explanations and make sure you agree. Ask for brief explanations, so that you aren’t impressed by the length and confuse it with substance. AI agents are very good at generating lots of vapid words.

By following this “tennis match” of interacting with AI, going back and forth and never delegating too much, you’ll actually take advantage of the technology without losing the cognitive development that’s essential for you.

8 Starter🔗

Starter (opens in a new tab)