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.”
In class today,
we used Venn diagrams to prove one of DeMorgan’s laws
on p. 22 of the textbook:
(A ∪ B)' = A' ∩ B'
See pp. 4– 6 of
these notes.
Now prove the other law of DeMorgan on p. 22 in the same way:
(A ∩ B)' = A' ∪ B'
Make Venn diagrams of the two sets
(A ∩ B)'
and
A' ∪ B'
and show that they have the same territory.
Extra credit for serious students:
write a proof in symbols that
(A ∩ B)' = 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.
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.
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
(p ∨ q) ∧
(p ∨ r)
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).
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.
I couldn’t remember in class that Immanuel Kant’s two types of propositions are analytic vs. synthetic. Sorry.
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.
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.
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
.
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
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.
<!doctype HTML>
.
<HTML>
and
</HTML>
tags.
<HEAD>
and
</HEAD>
tags.
<BODY>
and
</BODY>
tags.
<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?
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.)
<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 chmod
ing 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.