one slide summary musical
play

One-Slide Summary Musical Recursive transition networks and - PDF document

One-Slide Summary Musical Recursive transition networks and Backus-Naur Form context-free grammars are equivalent formalisms for Labyrinths specifying formal languages. Musical harmony contains an explicit notion of a stack. & Music


  1. One-Slide Summary Musical • Recursive transition networks and Backus-Naur Form context-free grammars are equivalent formalisms for Labyrinths specifying formal languages. • Musical harmony contains an explicit notion of a stack. & Music starts on the tonic, adds elements in a structured Puzzling way, and returns to the tonic. • find-closest is quite powerful. Problem sets? Pegboards • L-system fractals are based on a rewriting system that is very similar to BNF grammars. • We can use our CS knowledge up to this point to defeat the evil scourge of Cracker Barrel pegboard puzzles ! (More next time.) #1 #2 Outline Recursive Transition Networks • Recursive Transition Networks ORNATE NOUN – vs. Backus-Naur Form Grammars • Stacks and Musical Harmony • Playing Poker NOUN end ARTICLE ADJECTIVE begin – Revenge of find-closest Can we describe this using Backus Naur • That Cursed Pegboard! With Special Guests: Form? The CS 150 Chorus! – Problem Representation – Important Functions #3 #4 Recursive Transition Networks Recursive Transition Networks ORNATE NOUN ORNATE NOUN end end NOUN NOUN begin ARTICLE ADJECTIVE begin ARTICLE ADJECTIVE ORNATE NOUN ::= NOUN ORNATE NOUN ::= NOUN ORNATE NOUN ::= ARTICLE ADJECTIVE NOUN #5 #6

  2. Recursive Transition Networks Recursive Transition Networks ORNATE NOUN ORNATE NOUN end end NOUN NOUN begin ARTICLE ADJECTIVE begin ARTICLE ADJECTIVE ORNATE NOUN ::= ARTICLE ADJECTIVE NOUN ORNATE NOUN ::= ARTICLE ADJECTIVES NOUN ORNATE NOUN ::= ARTICLE ADJECTIVE ADJECTIVE NOUN ADJECTIVES ::= ADJECTIVE ADJECTIVES ORNATE NOUN ::= ARTICLE ADJECTIVE ADJECTIVE ADJECTIVE NOUN ADJECTIVES ::= ORNATE NOUN ::= ARTICLE ADJECTIVE ADJECTIVE ADJECTIVE ADJECTIVE NOUN ORNATE NOUN ::= ARTICLE ADJECTIVE ADJECTIVE ADJECTIVE ADJECTIVE ADJECTIVE NOUN #7 #8 Music Harmony Recursive Transition Networks Kleines Harmonisches Labyrinth ORNATE NOUN (Little Harmonic Labyrinth) NOUN end ARTICLE ADJECTIVE begin ORNATE NOUN ::= OPTARTICLE ADJECTIVES NOUN ADJECTIVES ::= ADJECTIVE ADJECTIVES ADJECTIVES ::= ε OPTARTICLE ::= ARTICLE OPTARTICLE ::= ε Which notation is better ? #9 #10 Hey Jude Hey Jude V: C = 3/2 * F V: C = 3/2 * F IV: Bb = 4/3 * F • John Lennon and Paul McCartney, 1968 Push Pop Fifth P Push Push o Pop Fourth p Fifth Tonic: Tonic: Tonic: Tonic: F = 1 F F F Tonic: Hey Jude, don’t make it V: bad. take a sad song and make it Tonic: better Re- IV: member to let her into your Tonic: heart, then you can V: start to make it bet- Tonic: -ter. #11 #12

  3. V: C = 3/2 * F V: C = 3/2 * F Music IV: Bb = 4/3 * F P Push Verse ::= Push o p Push Pop Pop Fifth Fourth Fifth • Almost All Music Is Like This Tonic: F Tonic: F Tonic: F = 1 Tonic: F – Pushes and Pops the listener's stack, but doesn't V+V: Gm = 3/2 * 3/2 * F -frain, don’t carry the get too far away from it – Repeats similar patterns in a structured way world up-on you shoul- V: C = 3/2 * F Bridge ::= IV: Bb = 4/3 * F – Keeps coming back to the Tonic, and ends on the Pain, Hey Jude re- Pop Tonic h s h u t r P u o F • Any famous Beatles song that doesn't end on And Anytime you feel the ders. Tonic: F = 1 Tonic: F the tonic? HeyJude ::= Verse VBBN VBBN Verse Verse Better Coda VBBN ::= Verse Bridge Bridge Nanana (ends on C) Coda ::= F Eb Bb F Coda #13 #14 Liberal Arts Trivia: Liberal Arts Trivia: Media Studies Latin American Studies • This important leader of Spanish America's • This 1988 book by Herman and Chomsky presented the seminal “propaganda model”, arguing that as news media outlets are run successful struggle for independence is by corporations, they are under competitive pressure. Consider the credited with decisively contributing to the dependency of mass media news outlets upon major sources of news, particularly the government. If a particular outlet is in independence of the present-day countries of disfavor with a government, it can be subtly 'shut out', and other Venezuela, Colombia, Ecuador, Peru, Panama, outlets given preferential treatment. Since this results in a loss in news leadership, it can also result in a loss of viewership. That can and Bolivia. He defeated the Spanish Monarchy itself result in a loss of advertising revenue, which is the primary and was in turn defeated by tuberculosis. income for most of the mass media (newspapers, magazines, television). To minimize the possibilities of lost revenue, therefore, outlets will tend to report news in a tone more favorable to government and business, and giving unfavorable news about government and business less emphasis. #15 #16 Problem Sets PS2: Question 4 Why is • Not just meant to review stuff you should already know (define (higher-card? card1 card2) – Get you to explore new ideas (> ( card-rank card1) ( card-rank card2) – Motivate what is coming up in the class better than • The main point of the PSs is learning , not (define (higher-card? card1 card2) evaluation (> ( car card1) ( car card2)) – Don’t give up if you can’t find the answer in the ? book (you won’t solve many problems this way) – Do discuss with other students #17 #18

  4. PS2: Question 9, 10 Can we do better? • Predict how long it will take • Identify ways to make it faster This is what we used in PS2 for our Poker-Bot: (define (find-best-hand hole-cards community-cards) (car ( sort (possible-hands hole-cards Most of next week and much of many later community-cards)) classes will be focused on how computer higher-hand?)) scientists predict how long programs will take, and on how to make them faster . #19 #20 Hmmm.... find-bestest (define (find-closest goal lst closeness) (define (find-bestiest lst bestiness) (if (= 1 (length lst)) (if (= 1 (length lst)) (car lst) (car lst) (pick-closest closeness goal (car lst) (pick-bestier bestiness (find-closest goal (cdr lst) closeness)))) (car lst) (find-bestiest (cdr lst) bestiness)))) (define (pick-closest closeness goal num1 num2) (define (pick-bestier bestiness num1 num2) (if (< (closeness goal num1) (if ( bestiness num1 num2) (closeness goal num2)) num1 We could num1 use these num2)) num2)) to find the This used to be best hand! (< (dist num1 goal) (dist num2 goal)) #21 #22 find-best-hand PS3: (define (find-bestiest lst bestiness) Lindenmayer System Fractals (if (= 1 (length lst)) (car lst) (pick-bestier bestiness (car lst) (find-bestiest (cdr lst) bestiness)))) (define (pick-bestier bestiness num1 num2) (if (bestiness num1 num2) num1 num2)) (define (find-best-hand lst) (find-bestest lst higher-hand?)) Next week: how much better is this? #23 #24

  5. CommandSequence ::= ( CommandList ) L-Systems CommandList ::= Command CommandList L-System CommandList ::= Command ::= F Rewriting CommandSequence ::= ( CommandList ) Command ::= R Angle Command ::= O CommandSequence CommandList ::= Command CommandList Start: (F) CommandList ::= Rewrite Rule: Command ::= F F → (F O(R30 F) F O(R-60 F) F) Command ::= R Angle Work like BNF replacement rules, Command ::= O CommandSequence except replace all instances at once! Why is this a better model for biological systems? #25 #26 Level 1 Level 0 Start: (F) F → (F O(R30 F) F O(R-60 F) F) Level 2 Level 3 (F) (F O(R30 F) F O(R-60 F) F) #28 Previous CS 150 Students: The Great Lambda Tree of Ultimate Knowledge and Infinite Power Tie Dye by Bill Ingram (Level 5 with color) Rose Bush by Jacintha Henry and Rachel Kay #29 #30

  6. Liberal Arts Trivia: Medicine Liberal Arts Trivia: Accounting • This vector-borne infectious disease is caused • In this bookkeeping system, each transaction is by protozoan parasites. It is widespread in recorded in at least two accounts. Each tropical regions, such as sub-Saharan African. transaction results in one account being Each year there are about 515 million cases of debited and another account being credited, it, killing between one and three million with the total debits equal to the total credits. people. No formal vaccine is available. Classic Luca Pacioli, a monk an collaborator of symptoms include sudden coldness followed by Leonardo da Vinci, is called the “father of rigor and then fever and sweating. accounting” because he published a usable, detailed description of this system. #31 #32 Pegboard Puzzle Solving the Pegboard Puzzle • How to represent the state of the board? – Which holes have pegs in them • How can we simulate a jump? – board state, jump positions → board state • How can we generate a list of all possible jumps on a given board? • How can we find a winning sequence of jumps? #33 #34 Pegboard Puzzle Data Abstractions (define ( make-board rows holes) We are • We'll use an (x,y) (cons rows holes)) defining our data notation to structures! (define ( board-holes board) (cdr board)) represent positions (define ( board-rows board) (car board)) on the pegboard. (define ( make-position row col) (cons row col)) ;; (x.y) (define ( get-row posn) (car posn)) (define ( get-col posn) (cdr posn)) 1,1 2,1 2,2 (define ( same-position pos1 pos2) 3,1 3,2 3,3 (and (= (get-row pos1) (get-row pos2)) 4,1 4,2 4,3 4,4 (= (get-col pos1) (get-col pos2)))) 5,1 5,2 5,3 5,4 5,5 #35 #36

Recommend


More recommend