1. Please put a section number and a (book) problem number on each solution, so we can find it easier in your homework (don't just use 1, 2, 3, ...)
2. Write on the first page a list of all the problems that you *did not* solve, so the grader does not have to search through all of the pages trying to find solutions that are not there.
3. Please write legibly, or better yet, use a text editor to write the solutions - this makes it easier to grade (and also easier for you to edit, catch mistakes, and correct glitches).
4. Staple or clip the homework pages (no loose pages please).
5. Please solve the problems correctly, as correct solutions are easier to grade. :)
6. The Mon & Wed TA office hours will be 2:30-3:30 (several students said they would prefer that time, as it conflicts less with their schedules).
A: You are right - I changed it to Tues Feb 3 (and you get an extra credit point for catching this error! :) )
A: Yes, problem sets will be turned in and graded (although not all the individual problems on each set will necessarily all be graded - I'll pick a random half of the the problems on each assignment, and we'll grade those only; I'll discuss this grading strategy in more detail in class). I anticipate that there will be about 4 or 5 assigned problem sets total in this class.
A: The project is due on the (first) day of the final exam. One extra credit point will be given per each day that the project is turned in early.
A: The algorithm to get your questions answered is pretty simple:
Of course if you have a special reason to skip one of these levels of help, that's fine also, but lets try to stick to the above protocol.
Note that rule (2) is designed to encourage brainstorming among you, which is highly encouraged.
A: Just contact anyone in the class, and photocopy it from them. The names/Emails/phones of everyone in the class are available from the class Web page. The overhead slides and class handouts are available on the CS202 class Web site.
A: I use MS Word, which does a reasonable job (all my handouts/slides are done in MS Word). Another option is LaTex, which is a very powerful typesetting system, but this is overkill for many things; I use this for technical papers and camera-ready publications. LaTex is based on TeX, Don Knuth's famous typesetting system.
A: Well, I will first compute the course grades without *any* extra-credit (according to the breakdown discussed in the syllabus). Then, I will factor in the extra-credit, which will raise up the course grades of some people. So, two things are therefore true here:
a) this scheme is fair, in the sense that extra-credit could help you, but *not* having extra-credit will *not* hurt you (since the class grades are first computed *without* the extra-credit, and don't drop afterwards)
b) the more extra-credit you have, the higher your course grade will be.
The reason I use this extra-credit scheme is to encourage people to be more pro-active and participate more; this makes the learning process much more interesting, effective, and exciting.
Also, extra-credit problems encourages many people to think more, be resourceful, come prepared (and not be late) to class, remain alert, etc.
I hope this scheme is acceptable to everyone (it has worked very well for everyone in the past).
A: The book that I mentioned in class today about infinities is the next-to-last reference in the class handout which discusses some aspects of infinities, among other things. The book is:
Rucker, R., Infinity and the Mind: the Science and Philosophy of the Infinite , Harvester Press, 1982.
This book is available at Amazon.com
Its fascinating stuff - enjoy!
A: Thanks for finding these errors; I gave you two extra credit points for finding these typos.
* There is no need to try all permutations of all the pieces; clearly each puzzle can be solved by placing the pieces in a fixed permutation order (as long as each piece is placed into the right spot on the board). If your code goes through all piece permutations (and then tries all possible position combinations for each permutation), it runs in time N! longer than it needs to (where N is the number of pieces). This means it would run in months or years of CPU time instead of just seconds (!)
* Instead of picking a random or arbitrary permutation, have your code try to place the pieces on the board in the order of their decreasing size. To see why this is a much more efficient strategy, consider the following example, of five pieces to tile an 8x8 board:
###### # ###### ######## # ######## ######## # ######## ######## # ########If you start by placing the four 1x1 pieces first, there are 64-choose-4 ways to place them (which is a number in the millions), but most of these choices will lead to an infeasibility when trying to place the last large 5th piece. On the other hand, if you place the large (60-square) piece first, the other four small pieces will immediately fall into place, saving you a lot of time. So this (extreme) example illustrates why it is often more efficient to place the larger pieces first (basically because this will lead to infeasibiliy or dead ends sooner, which in turn prunes the search tree more aggressively, and therefore reduce the overall run time).
There are many other kinds of optimizations that you can implement, and some of them will help reduce the runtime tremendously.
A: Make the "flipping-allowed" a global user-selectable flag that applies to all the pieces. All pieces can be rotated though.
A: Good point. For most of those puzzles, they are new (at least to me), and so I don't know the total number of solutions myself. But as some of the projects are being turned in, a consensus will form w.r.t. this data, and then we'll know the number of solutions for each puzzle.
A: That is fine with me.
A: You may assume that only keyboard characters will be used (i.e., letters, numbers, and special characters).
A: Your code should be able to solve ANY puzzle; and in particular, it should be able to solve the 8x8 puzzles that are specified in the project description, among others.
A: No, pieces will be randomly scattered in the files, separated by blanks (as in the puzzle instances at http://www.cs.virginia.edu/~robins/cs202/puzzles/)
A: Most systems have a timing command, that takes another command as an argument and returns the CPU time used during its execution (on UNIX systems it is the time(1) command).
A: Lets agree that the maximum number of allowed colors is 50 (so these may be denoted in the input file by all the digits (0-9), the letters (a-z), and a few printable special characters (basically all the keyboard characters).
A: Lets agree that no input file will be more than 80 characters wide.
A: Yes, that is an option, as long as such an alternate project is relevant to the class material, is non-trivial in scope, etc. Please feel free to make a list of a few possible project topics, and we can then review these topics together and decide on which one would be most appropriate.
1) Label every "point" in the solution (I use point to mean an individual piece of a tile, ie. one colored part, is there a better name for this?) in the solution with the "shape" of the piece it came from, and eliminate all solutions that are rotated/reflected versions of one another (reflections are only possible if the pieces are allowed to be reflected I believe). This eliminates all basic rotations/reflections as well as solutions where two identically shaped pieces are interchanged. Also eliminates solutions where a piece is rotated/reflected but preserves shape.
2) Same as above but label every point with the actual piece it came from, and eliminate. This eliminates rotations/reflections but allows two identically shaped pieces that are interchanged to be separate solutions. Also eliminates solutions where a piece is rotated/reflected but preserves shape.
3) Label every point with the piece and in-piece coordinates it came from, and eliminate. Eliminates basic rotations/reflections but allows two identically shaped pieces to be interchanged, and isomorphic rotations of an individual piece to count as separate solutions.
I appreciate the clarification.
A: What I had in mind is to eliminate entire solution ensembles that are rotations or reflections of other solutions. And if two pieces are identical, then swapping them does not create yet another solution. Finally, if a piece is identical to its reflection/flip (modulo rotation), then flipping it doesn't count as another solution either. So ideally your program should only generate the basic "interesting" *distinct* solutions (and any rotations, reflections, identical-piece-swapping, and identical-flipped-piece derivative solutions can always be easily generated from those basic ones). So this sounds like your number (1) scenario.
A: You can do this by putting the rationals in a table (with cell (a,b) representing the rational number a/b), and then using dovetailing to establish the 1-to-1 correspondence.
A: That's correct - these two sets have the same cardinality.
A: Yes; in fact, you can dovetail in *any* finite number of dimensions. For example, in 3D, imagine a small sphere centered at the origin, slowly expanding out in size; now, just number using integers all the lattice points (i.e., all (a,b,c) with a,b,c all being integers) that the sphere intersects as it slowly inflates (if it intersects several lattice points simultaneously, number these in arbitrary order). This shows that the set of all ordered triplets is countable.
A: You can use the "Unique Existance" quantifier (unless the problem states explicitly that you should not use it).
A: Remember that the "Universe" of values for X is the set of "all creatures", so "for all x (P(x) ^ Q(x))" means "every creature is a lion AND fierce", while "for all x (P(x) -> Q(x))" means "every creature that is a lion, IS also fierce", or equivalently, "all lions are fierce" (and non-lions are not necessarily fierce).
A: A set of Boolean functions is "functionally complete" if any other Boolean function can be represented as a composition of functions in this set. For example the set of functions {AND, OR, NOT} is functionally complete, since any of the other 2^(2^2)=16 Boolean functions over two variables can be represented as a combination of these three basic building blocks. Proving functional completeness *from scratch* for a set of functions is tedious (e.g., you can list out the many truth tables); a shorter proof may involve showing that a set of functions already known to be functionally complete can be fully represented using combinations of functions from unknown set in question.
A: A few of the problems on the homework sets do not appear in the Forth Edition. So I would recommend that you get the Fifth Edition (some errors/typos are always corrected from one edition to the next). Alternatively, you can xerox the problem set pages from, the Fifth Edition and work from those copied pages. (I would recommend just getting the latest book though - its simpler and that way you'll have the most up-to-date version; books are one of the best investments a person can make in my opinion). Also, consider that the second semester of Discrete Math CS302 uses the same textbook, so if you plan to take CS302, you'll need this book anyway.
A: Yes, it is a typo; it should be f(x) = floor(x/2) + ceiling(x/2) (so it is an open ceiling bracket followed by a closed ceiling bracket). And yes, this is worth an extra credit point - thanks for catching this!
A: Yes.
A: Yes.
A: Yes.
A: Yes. In fact, a real number can also be defined as a *sum* of an infinite number of rationals (but not as the sum of a finite number of rationals, which is always rational).
A: No, f(x) = O(g(x)) means f is upper-bounded by g.
A: Yes.
A: n can be any natural number, and all values of n are possible and must be accounted for.
A: The c's can be either positive or negative rationals.
A: Yes.
A: 5, 10, and 13 are mutually relatively prime, since not *all* three of them have a factor in common (although two of them, 5 and 10, do).
A: yes.
A: Yes.
A: Yes.
A: Yes. (Good question!)
A: It is a matrix where at least one of the two dimensions is not finite. A Boolean matrix is one where every matrix entry is at either 0 or 1.
A: That's only a very specific type of group. You also have to address the infinity of other types of groups.
A: Yes. A lower time complexity is worth more points.
A: No. If two matrices differ by even one entry, they are distinct.
A: Two seatings are equivalent if one is a rotation of the other; otherwise, they are non-equivalent.
A: Each element of the set is an MxN matrix.
A: Yes.
A: The people are seated uniformly around the table (and there is no distinguished "half" of the table).
A: You are given the matrix in some standard representation (e.g., a long list of vertex pairs). Everything else you require, you need to compute from this input data.
A: Solve this problem for all N, including 1.
A: Yes.
A: Yes.
A: Yes (but also give a sentence or two summarizing why that is a true statement, not necessarily a complete proof).
A: The number of chairs is the same as the number of people, namely N.
A: No.
A: In both cases the sum is 6, but these are two distinct events.
A: No, this applies to all weighted graphs; if the smallest-weight edge is unique, then "one of" (this singleton set) refers to that particular edge.
A: Yes.
A: Each entry in a Boolean matrix is either a 0 or a 1 (and nothing else).
A: For each pair of natural numbers M and N, all possible matrices of size MxN are in this set, so obviously this is an infinite set.
A: No, matrices of different dimensions are by definition different.
A: No, self-"know" does not count here.
A: Yes.
A: Yes.
A: Yes.
A: Yes.