|
home—info—lectures—exams—archive
Although you are welcome to typeset your work nicely (using Microsoft Word or LaTeX or whatever to get nice logic symbols), it's probably much easier to write formulas by hand.
Logic and eBay You might think to yourself, after the problem on Logiconian web pages from the previous homework, “great, maybe we can use propositional logic for web queries, but no search-engine I've ever seen lets me type ‘∧’ or ‘∨’.” Different search engines on the web have their own syntax for specifying searches.
Aside: Note that a formula may be true for some web pages, and false for others. The search engine is concerned with finding all web pages which satisfy the formula. This is called a query, in database lingo.Some search engines allow full Boolean queries. Some interpret a list of several words in a row as an implicit conjunction (AND), while others might as an implicit disjunction (OR).
Read over the search syntax for the search language of eBay®.
Aside: Apparently, eBay expects their users to: (a) realize their query isn't working, (b) realize that some equivalent query can work, and (c) be adept at Boolean algebra to find the working equivalent query. More likely, they didn't have a discrete math student on their programming staff, and thus didn't think deeply about their syntax.
Logic and Email: In Microsoft's mail program Entourage, a user can set up different folders for filing their messages. Moreover, there is even a way to set up rules, so that incoming messages get auto-filed into a certain folder. For example, I have a rule set up so that all mail from and to certain mailing lists ("[ap-compsci]" and "[sigcse-members]") are automatically moved into a specific mail folder (see picture).
Near the top-right of that image, notice that the rule is applied ("executed") for incoming messages which meets any of my four criteria. That is, Entourage combines the four criteria (call them a, b, c, d) and executes the rule whenever the propositional logic formula (a∨b∨c∨d) is true.
(3pts) Logic and iTunes: Besides the mail program above, many other programs also let users combine several small conditions (formulas) by connecting those conditions with AND, or by connecting those conditions with OR. iTunes is one such example: the screen-shot at right specifies songs which “Match any of the following rules” (OR); it could also be set to “Match all of the following rules” (AND).
In iTunes, one can create “smart playlists” —
really, a formula which determines whether a particular song gets
should be added to a playlist.
For example, the image shown
specifies a smart-playlist which contains all songs
which
“have a five-star-rating, OR have
not been played in over
a year”.
After creating this smart-playlist, we name it
“high-priority”;
the second screen-shot lets you glimpse
songs 12-19 on the playlist “high-priority”.
After the preceding problem (3b) about email queries, you might initially think that there is no way to express a formula for all songs which “(have a five-star-rating, or have not been played in over a year), and are not ABBA”. However, there is an indirect way of doing it: iTunes allows options of the form “the song is on the playlist ________”. Use this option, along with existing playlists, to make a playlist which contains exactly those songs which have (have a five-star-rating, or have not been played in over a year), and are not ABBA.
What happens if you try to make a smart-playlist named "weird-list", which consists of: All songs whose playlist is equal to "weird-list" (?!). That would be an odd playlist, but it's one you can imagine creating. Do you think Abba's "SOS" should be included in "weird-list"?
Even worse: What happens if you try to make a smart-playlist named "twisted", which consists of: All songs whose playlist is not equal to "twisted". Yikes! If you made such a playlist, should it include Abba's "SOS"?
How, do you think, does iTunes prevent itself from creating such odd playlists?
(If you want to confirm your guess,
you can download iTunes for Windows or Mac.)
To verify for yourself: does iTunes also prevent a pair of playlists with a mutual dependency?
home—info—lectures—exams—archive
©2008, Ian Barland, Radford University Last modified 2008.Oct.10 (Fri) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |