Spring 2025 CISC-1100-C01 Homework

  1. Monday, January 13, 2025. Read the course syllabus. Get the textbook and read the Set Theory chapter. Were you able to understand the proof that there is an irrational number on pp. 4–5 of my notes?

    Good news, everybody: I will create an account for each student on the Fedora Linux server storm.cis.fordham.edu. You will use this account to learn the rudiments of the Linux operating system, and to create a little website by writing in HTML, the “Hypertext Markup Language”. We can relate the construction of this website to the topics of this course (the Structures of Computer Science) by emphasizing that a document in HTML is an example of a tree structure: it consists of little things nested inside of bigger ones.

    Fordham says: “On Tuesday February 18th, ALL classes follow a Monday schedule. There WILL BE NO TUESDAY classes.”

  2. Monday, January 27, 2025. Look ahead in the sequences and summations notes so that you won’t be seeing the material for the first time when we do it in class on February 3.

    In class today, we used Venn diagrams to prove one of DeMorgan’s laws on p. 22 of the textbook:
    (AB)' = A' ∩ B'
    See pp. 4– 6 of these notes. Now prove the other law of DeMorgan on p. 22 in the same way:
    (AB)' = A' ∪ B'
    Make Venn diagrams of the two sets (AB)' and A' ∪ B' and show that they have the same territory. Extra credit for serious students: write a proof in symbols that (AB)' = A' ∪ B' like the proof on page 6 of the notes.

    Log into the Linux server storm.cis.fordham.edu and practice the Linux commands in these notes: pwd, cd, ls, more, touch, mv, cp, rm, and wget. Practice editing a file with the vi editor.

  3. Monday, February 3, 2025. ATTENTION. On Monday, February 3, one of the students left their computer in the classroom (room 602 in the Leon Lowenstein Center) after class at 8:45 pm. We left the computer with the guard at the security desk at the entrance to the campus at the northwest corner of Columbus Avenue & West 60th Street. Please let me know what happens.

    By 6:00 pm EST on Sunday night, February 9, 2005, put a file named page.html into the public_html subdirectory of your home directory on our server storm.cis.fordham.edu. You can create this file by downloading my page.html file as we did in class on February 3, but please then use the vi editor to change the content of this file to something more interesting. (While you’re at it, you could correct my minor misspellings and typographical errors.) Here’s the example we looked at in class. Keep on editing, Jake!

    Verify that your web page is visible in any browser in the world by pointing the browser at
    https://storm.cis.fordham.edu/~jsmith/page.html
    where jsmith is your Fordham name. To see the source code (i.e., the actual lines of HTML) of the web page you’re viewing in your browser,

    Admire the web pages of the other students.

    Study the Sequences and Summation notes. On February 10, we will continue with mathematical induction. You could try to download, compile (i.e., use the c++ command to translate the program into an a.out file), and execute the C++ program sum.C on p. 7 of the notes. If you have a pineapple, count the number of spirals in each direction. Are they a pair of consecutive terms in the Fibonacci sequence? Bring it in if you can.

  4. Monday, February 10, 2025. I hereby assign the “masochistic” homework on page 6. Your table will have eight rows, because 8 = 23 = 2 × 2 × 2, and the following eight columns.
    1. p
    2. q
    3. r
    4. qr
    5. pq
    6. pr
    7. p ∨ (qr)
    8. (pq) ∧ (pr)

    To bring this assignment into the realm of the humanly possible, please feel free to use an online truth table generator such as this one. To see how it works, copy and paste the logical expression
    (pq) ∧ (pr)
    into the box where it says
    Enter expression …
    and see what happens. (In this web site,
    ¬ means “not”,
    (the scrunched symbol) means “exclusive or”,
    means “not or”,
    means “nand”, i.e., “not and”.) I am not a hard-hearted man. Thanks, Felix and Max!

    Download the file link.html into the public_html subdirectory of your home directory on storm.cis.fordham.edu and play with the links. Put some links to interesting things into your page.html. (For inspiration, see my page.html.)

    The web homework is due at 6:00 pm EST on Monday, February 17, 2025. The truth table homework should be handed in on paper the next time we meet (Tuesday, February 18).

  5. Tuesday, February 18, 2025. Operate the simple computer at the bottom of page 11. To do this, pick a number in the range 0 to 7 inclusive (i.e., a three-bit binary number), and put its three bits into the three variables p0, p1, p2. (Put the rightmost bit of your number into p0, the middle bit into p1, and the leftmost bit into p2.) Then put values into the other variables on page 12. Did it work? In the variables q0, q1, q2, do you end up with a three-bit binary number that is 1 bigger than the number you started with? (If you start with 7, you should wrap around and end up with 0.) Hand in on paper. Meditate on the “exercise for your imagination” on page 13.

    Extra credit for space cadets only: now that you’ve seen a three-bit incrementer, write a three-bit decrementer. Or expand the three-bit incrementer to a four-bit incrementer.

    Do page 117, exercise 3.3.11 in the textbook. If you have to resort to truth tables, you can use this truth table generator. The button in the generator means “nand”. Hand in on paper.

    Download table.html into the public_html subdirectory of your home directory on storm.cis.fordham.edu and play with the tables. (Check it out: cmajzun has already played with his or her tables.) Then put an interesting table into your page.html file by 6:00 pm EST on Sunday, February 23, 2025.

    Observe that the following three-step syllogism has the same structure as the one on pp. 108–109 about Socrates being mortal.

    1. Page 76 in the textbook says that all statements that can be true or false are propositions.
    2. The bottom of page 93 says that PQ is a statement that can be true or false.
    3. Therefore the statement PQ is a proposition.
    But the conclusion of this syllogism violates the warning on top of p. 93 that says “The statement PQ is not a proposition.”

    I couldn’t remember in class that Immanuel Kant’s two types of propositions are analytic vs. synthetic. Sorry.

  6. Monday, February 24, 2025. The actor Robert Di Niro, playing a retired American president, makes his first appearance in the TV series Zero Day wearing a Fordham sweatshirt. I corrected the embarrasing typos in the class notes.

    Operate the simple computer at the bottom of page 14. (Please press the Recompile button to make sure you’re getting the current version.) To do this, pick two numbers in the range 0 to 7 inclusive (i.e., two three-bit binary numbers). Put the three bits of the first number into the variables a0, a1, a2. Put the three bits of the second number into the variables b0, b1, b2. Then put values into the other variables on page 15. Did it work? In the four variables c0, c1, c2, c3, do you end up with the sum of the two numbers you started with? For your convenience, here are some numbers written in binary. The sum you get might have as many as four binary digits.

     000 (zero)
     001 (one)
     010 (two)
     011 (three)
     100 (four)
     101 (five)
     110 (six)
     111 (seven)
    1000 (eight)
    1001 (nine)
    1010 (ten)
    1011 (eleven)
    1100 (twelve)
    1101 (thirteen)
    1110 (fourteen)
    

    Each of the following tables pictures a relation between the members of the very small set of natural numbers
    S = {0, 1, 2}
    Is the relation in each table reflexive, symmetric, antisymmetric, transitive? Can you identify these relations? For example, is one of them the relation of equality (=) on the set S? How about the relation of inequality (≠) or the relation of less than (<)? (By the way, I made these tables with the HTML TABLE tags. To make the tables easier to read, I colored the entries on the main diagonal.)

    0 1 2
    0 T F F
    1 F T F
    2 F F T

    0 1 2
    0 F T T
    1 T F T
    2 T T F

    0 1 2
    0 F T T
    1 F F T
    2 F F F

    0 1 2
    0 T T T
    1 F T T
    2 F F T

    If you get the join command to work, update your résumé to say “Experience with SQL on a Fedora Linux platform”. Employers will love it.

    Put one or more images into your page.html. (jc208, rr97, rsidbatte did it.) Good news for Windows PC people: the CMD window on your Windows PC has the same sftp command (“Secure File Transfer protocol”) that a Macintosh has.

    At home, I have Safari version 17.4.1 on macOS Monterey 12.7.4. To display Safari’s Develop menu, I pulled down Safari’s Safari menu and selected Preferences…. Then I pressed the Advanced tab, and checked the checkbox ☑ for “Show features for advanced developers”. (I guess we’re advanced developers now.) When viewing a web page in Safari, I pulled down Safari’s Develop menu and selected Show Page Source.

  7. Monday, March 3, 2025. We found a gray Lenovo backpack in the classroom after class, but we left it there. Admire the images in the page.html files: jc208, ac98, cm46, rr97, kzemzami, rsidbatte.

    To get the dimensions of an image file on a Macintosh, select the image file in the Finder and press control-i (or pull down the Finder’s File menu and select Get Info) for information. Under More Info, look for Dimensions.

    Study for the midterm next Monday. It will cover Chapters 1 to 4 inclusive.

  8. Monday, March 10, 2025. No class next week (it’s Spring Break). Watch the total lunar eclipse.
  9. Monday, March 24, 2025. It’s easy to reason about whether a function is injective and/or surjective (p. 162) when its domain and codomain (p. 152) are tiny sets like the A = {1, 2, 3} and B = {a, b, c} that we used in class today. Now let’s consider the function f: ℝ → ℝ defined as f(x) = x2 for ∀ x ∈ ℝ. Its domain and codomain are infinitely large sets. Is this function injective? If not, why not? Is this function surjective? If not, why not? Is this function bijective?

    Look at the function sum in the last 6 lines of the C++ program summation.C. Does this function make more sense than the five “empty parentheses” functions on p. 187? Use the yellow form to run this function.

    Play with the widgets in the useless orange form and press its Submit button. Put a totally off-the-wall useless form into your page.html file. (What drugs, if any, have you not taken in the last 24 hours? Which cities do you want to target today: Washington/London/Moscow/Peking?) You can put rows and columns of checkboxes into an HTML table in your form. To contemplate the mysteries of Linux, you can log into storm.cis.fordham.edu and look at the “do nothing” gateway (i.e., program) that is launched by the orange form:

    cat ~mmeretzky/public_html/cgi-bin/donothing.cgi
    

    Look at The Visual Display of Quantitative Information at edwardtufte.com.

  10. Monday, March 31, 2025. Put a form into your web page page.html that will let the user type in two integers. Your form will therefore contain two INPUT tags with the attribute TYPE = "NUMBER". Also give the atributes NAME = "n" and NAME = "r" to the tags. Display instructions telling the user that r must be less than or equal to n, and that both numbers must be greater than or equal to 0. The form will launch the gateway program
    https://storm.cis.fordham.edu/~mmeretzky/cgi-bin/permutation.cgi
    In other words, the value of the ACTION attribute of the FORM tag in your form should be the name of this gateway. The gateway will compute the value of the expressions P(n, r) on p. 211 and C(n, r) on p. 212.

    Do the form and the gateway work? For example, do they display the astronomically large correct value 741,354,768,000 for the P(25, 9) on p. 212? How about the correct value of 4,845 for the C(20, 4) on p. 213?

    Please obey the following rules.

    1. A web page should contain only one <!doctype HTML>.
    2. A web page should contain only one pair of <HTML> and </HTML> tags.
    3. A web page should contain only one pair of <HEAD> and </HEAD> tags.
    4. A web page should contain only one pair of <BODY> and </BODY> tags.
    5. If a web page contains a form, the form should be between the <BODY> and </BODY> tags.

    A telephone number in the United States consists of seven digits. The first of these seven digits cannot be a 0 or a 1. For example, it would be illegal to have a phone number such as 123-4567. But let’s assume that the six remaining digits can be anything. So how many different phone numbers could there be in an area code? And how many phone numbers that have no zeroes could there be in an area code?

  11. Monday, April 7, 2025. In class today I was asked when to use the addition rules (pp. 232 and 238) and when to use the multiplication rules (pp. 234 and 240). I should have given the following answer.

    Admire the calculators for P(n, r) and C(n, r) (pp. 211–212) that your fellow students have made: jc208, ac98, cm46 (in font Playfair Display), rr97 (offering SELF DESTRUCT capability), smw5.

    Study the probability notes. (I cleaned them up a bit.) Get the birthdays of 23 randomly selected people and see if two or more of them share the same birthday. (A “birthday” is just a month and a day of the month; people born on 4/7/2006 and 4/7/2007 share the same birthday.)

    For example, to collect the birthdays of your Facebook friends, go to your Facebook page (e.g., MarkMeretzky) and click on the Friends tab. Then click on each friend, click on their About tab, select “Contact and basic info”, and look for their birthday. (Not everyone has exposed their birthday.)

  12. Monday, April 14, 2025. Steve Albanese <salbanese1@fordham.edu> informs me that we have classes on Monday, April 28 and on Monday, May 5. Our final exam is on Monday, May 12.

    If you want to run the C++ program easter.C on storm.cis.fordham.edu,

    cd
    pwd
    
    wget https://markmeretzky.com/fordham/1100/src/easter.C
    ls -l easter.C
    
    c++ easter.C
    ls -l a.out
    
    ./a.out
    Easter is on Sunday, April 20, 2025.
    

    Then you can use vi to edit easter.C and change the 2025 to a different year. Then feed the program to c++ again, and run the new a.out file.

    If you want to run the Python program easter.py on storm.cis.fordham.edu,

    cd
    pwd
    
    wget https://markmeretzky.com/fordham/1100/src/easter.py
    ls -l easter.py
    
    chmod u+x easter.py      (Change the mode of this file to give the user execute permission.)
    ls -l easter.py
    
    ./easter.py
    Easter is on Sunday, April 20, 2025.
    

    Then you can use vi to edit easter.py and change the 2025 to a different year, Then run it again. (You can run it again without chmoding it again.)

    Note to self: if they ever let me teach CISC-1100 again, concentrate on linear (p. 259) vs. binary (p. 269) search, and forget about bubble sort (p. 263) vs. merge sort (p. 265). Use binary search rather than merge sort as the vehicle for demonstrating logarithms.

  13. Monday, April 28, 2025.
  14. Monday, May 5, 2025. Final examination.