3. Word Puzzles and Games. Robert Snapp rsnapp@uvm.edu



Similar documents
Lesson 1: Review of Decimals: Addition, Subtraction, Multiplication

Decision Models for Comparative Usability Evaluation of Mobile Phones Using the Mobile Phone Usability Questionnaire (MPUQ)

INCIDENCE-BETWEENNESS GEOMETRY

Playing with Numbers

US Presidents. Welcome, students!

Discrete mathematics

PUSD High Frequency Word List

C H A P T E R Regular Expressions regular expression

Verbs - Transitive and Intransitive

2. How many ways can the letters in PHOENIX be rearranged? 7! = 5,040 ways.

4. How many integers between 2004 and 4002 are perfect squares?

Grade 8 English Language Arts 90 Reading and Responding, Lesson 9

35 Permutations, Combinations and Probability

College of the Holy Cross CCSCNE 06 Programming Contest Problems

CMPSCI 250: Introduction to Computation. Lecture #19: Regular Expressions and Their Languages David Mix Barrington 11 April 2013

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 10

American Presidents. Author: Dr. Michael Libbee, Michigan Geographic Alliance

Fry Phrases Set 1. TeacherHelpForParents.com help for all areas of your child s education

Phonics. High Frequency Words P.008. Objective The student will read high frequency words.

Lesson 2. Operations with Integers. Objectives

Automata and Formal Languages

PROBABILITY SECOND EDITION

Unit 5 Length. Year 4. Five daily lessons. Autumn term Unit Objectives. Link Objectives

Ready, Set, Go! Math Games for Serious Minds

1. The RSA algorithm In this chapter, we ll learn how the RSA algorithm works.

Week 4 Lesson Plan. Pre-K. Our Neighborhood. Macmillan /McGraw-Hill. Extend. the Unit

Volume of Pyramids and Cones

6.3 Conditional Probability and Independence

Gift of the Magi By O Henry

Chapter 3. Distribution Problems. 3.1 The idea of a distribution The twenty-fold way

DISTANCE TIME GRAPHS. Edexcel GCSE Mathematics (Linear) 1MA0

CS104: Data Structures and Object-Oriented Design (Fall 2013) October 24, 2013: Priority Queues Scribes: CS 104 Teaching Team

1 Practice. Collecting and Working with Data

1. BODY AND SOUL 2. ATOMIC BOMB 3. GOOD NAME

[i carry your heart with me(i carry it in] i carry your heart with me(i carry it in. my heart)i am never without it(anywhere

KENDRIYA VIDYALAYA ASHOK NAGAR, CHENNAI 83 MODEL PAPER - I. Class :- V Competencies R W SP HW. Grade

Enumerating possible Sudoku grids

Integers are positive and negative whole numbers, that is they are; {... 3, 2, 1,0,1,2,3...}. The dots mean they continue in that pattern.

Colet Court. 11+ deferred examination reasoning section

Current California Math Standards Balanced Equations

Looking for Lincoln Throughout His Life

7.5 Emphatic Verb Tense

Introduction - elite English skills target series - Unseen Poetry

EKOLA Junior High School Bilingual Programme Entrance Test (1h15) Sample Paper. Result:

All Saints (or All Hallows) Celebration

CS103B Handout 17 Winter 2007 February 26, 2007 Languages and Regular Expressions

CAPS. Mathematics. Grade 2. Practice Book. Practice Book. Practice. Book. Book. Book. Book. Book. Book. Book. Book. Book. Book. Book. Book.

Phonics. P.041 High Frequency Words. Objective The student will read high frequency words.

1 I... swim well when I was very young. A can B could C knew. 3 What... on Sundays? A does Mary usually do B does Mary usually

Contents. A Word About This Guide Why Is It Important for My Child to Read? How Will My Child Learn to Read?... 4

Old Testament. Part One. Created for use with young, unchurched learners Adaptable for all ages including adults

THEORY of COMPUTATION

SECTION 10-5 Multiplication Principle, Permutations, and Combinations

Discrete Mathematics

Word Meaning Helping Your Child Determine the Meaning of Words

1-4. a: 40 b: 6 c: 7 d: a: 3 b: 5 c: 6 d: 2

Fifty Years Later: What Would King Say Now? Keith M. Kilty. On August 28, 1963, some 250,000 people marched on Washington, DC. The

Practicing for the. TerraNova. Success on Standardized Tests for TerraNova Grade 2 3. McGraw-Hill School Division

Lecture 24: Saccheri Quadrilaterals

Backseat A-B-See A CLEL Silver Bell Award Book for READ

Reconstruction SAC Lesson Plan

Regular Languages and Finite State Machines

Answer: (a) Since we cannot repeat men on the committee, and the order we select them in does not matter, ( )

Would you like to play tennis with me after school, Peter? I can t, Jane. I have to go straight home. How about tomorrow, then?

Decision Mathematics D1. Advanced/Advanced Subsidiary. Friday 12 January 2007 Morning Time: 1 hour 30 minutes. D1 answer book

Jesus Chooses His Disciples

Fundamentals of Probability

GLENVIEW NEW CHURCH SUNDAY MORNING PROGRAM Preschool Lessons, Phase 2 Lesson 14 The Wise Men (Matthew 2:1-12)

Assessment Management

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Lesson 3. The Novel ASSIGNMENT 8. Introduction to the Novel. Plot. Character

Math 408, Actuarial Statistics I, Spring Solutions to combinatorial problems

Comments on the Rubik s Cube Puzzle

Permutations & Combinations

Worksheet 2 nd. STANDARD COMPETENCY : 1. To use the statistics rules, the rules of counting, and the characteristic of probability in problem solving.

Multisensory Grammar Online

Today we are going to talk about Georges Seurat. Seurat was born in 1869.

Introduction Solvability Rules Computer Solution Implementation. Connect Four. March 9, Connect Four

List of United States Presidents by genealogical

California Treasures High-Frequency Words Scope and Sequence K-3

Preparing Your Child for School

GESE Initial steps. Guide for teachers, Grades 1 3. GESE Grade 1 Introduction

Reliability Guarantees in Automata Based Scheduling for Embedded Control Software

Fiction: Poetry. Classic Poems. Contemporary Poems. Example. Key Point. Example

Chapter 11 Number Theory

Write your spelling words in alphabetical order. Then write your words in reverse alphabetical order!

8.3 Probability Applications of Counting Principles

USA - A Divided Union? - African American Civil Rights

Accommodated Lesson Plan on Solving Systems of Equations by Elimination for Diego

Jacob Marries Rachel

Tagging with Hidden Markov Models

Symmetrical Pentomino Pairs

Lesson 21. Circles. Objectives

English (Literacy) Reading Target Ideas. P Scale 4

IN A SMALL PART OF THE CITY WEST OF

Fry s Sight Word Phrases

THEME: God is faithful when we are going through a tough time.

Pure Math 30: Explained!

Transcription:

3. Word Puzzles and Games Robert Snapp rsnapp@uvm.edu Department of Computer Science University of Vermont Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 1 / 27

1 Word Games Riddles Lipograms Palindromes Anagrams 2 Computational Questions Heuristics Trees (and Factorial Trees) The Multiplication Principle Enumerating Anagrams having n Unique Symbols Enumerating Anagrams having Repeated Symbols 3 References Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 2 / 27

A Riddle As I was going to St. Ives, I met a man with seven wives, Each wife had seven sacks, Each sack had seven cats, Each cat had seven kits; Kits, cats, sacks, and wives, How many were going to St. Ives? Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 3 / 27

A Riddle As I was going to St. Ives, I met a man with seven wives, Each wife had seven sacks, Each sack had seven cats, Each cat had seven kits; Kits, cats, sacks, and wives, How many were going to St. Ives? Probably only one person: the I of the rhyme. Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 3 / 27

A Lipogram Gadsby was walking back from a visit down in Branton Hill s manufacturing district on a Saturday night. A busy day s traffic had had its noisy run; and with not many folks in sight. His Honor got along without having to stop to grasp a hand, or talk; for a Mayor out of City Hall is a shining mark for any politician. And so, coming to Broadway, a booming bass drum and sounds of singing, told of a small Salvation Army unit carrying on amidst Broadway s night shopping crowds. Gadsby, walking toward that group, saw a young girl, back toward him, just finishing a long, soulful oration : : : (From, Ernest Vincent Wright, Gadsby, Wetzel Press, 1939; cf. Ross Eckler, Making the Alphabet Dance, St. Martin s Press, New York, 1996, pp. 2 3.) Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 4 / 27

Another Lipogram Enfettered, these sentences repress free speech. The text deletes selected letters. We see the revered exegete reject metred verse: the sestet, the tercet even les scènes élevées en grec. He rebels. He sets new precedents. He lets cleverness exceed decent levels. He eschews the esteemed genres, the expected themes even les belles lettres en vers. He prefers the perverse French esthetes: Verne, Péret, Genet, Perec hence, he pens fervent screeds, then enters the street, where he sells these letterpress newsletters, three cents per sheet. He engenders perfect newness wherever we need fresh terms. From Eunoia by Christian Bök, Couch House Books, Toronto, 2001. Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 5 / 27

Palindromes A man, a plan, a canal Panama! Madam, I m Adam. Was it a bat I saw? Rise to vote, sir. Draw, O Caesar, erase a coward. Egad, a base life defiles a bad age. Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 6 / 27

Anagrams: Origins The oldest known anagrams may have been written in 260 BC by Lycophron, a Greek poet. His poem Cassandra contains two: The letters in the name of Ptolemy Philadelphus are rewritten as which translates to made of honey. TOƒEMAIO ; A O MEƒITO ; The letters in the name of Arsinoë (Ptolemy s queen), AP INOH; are rewritten as which means Hera s violet. HPA ION; Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 7 / 27

Anagrams: American Presidents ABRAHAM LINCOLN: oh, call man brain HERBERT CLARK HOOVER: the ever dark horror HARRY S TRUMAN: rash army runt DWIGHT DAVID EISENHOWER: he did view the war doings JAMES EARL CARTER: a rare calm jester RONALD WILSON REAGAN: no darlings, no ERA law GEORGE HERBERT WALKER BUSH: huge berserk rebel warthog (cf. Ross Eckler, Making the Alphabet Dance, St. Martin s Press, New York, 1996, p. 139.) Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 8 / 27

More Anagrams INCOMPREHENSIBLE: problem in Chinese STORMY WEATHER: showery matter ROCKY MOUNTAINS: o, man ski country THE PIANO BENCH: beneath Chopin THE CAFETERIA: fact: I eat here. (cf. Ross Eckler, Making the Alphabet Dance, St. Martin s Press, New York, 1996, pp. 139 141.) Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 9 / 27

Anagrams Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 10 / 27

Anagrams: Four Questions 1 How do you unscramble a jumbled word, like PUGOR? 2 Can we create an algorithm (or procedure) so that anyone, even a computer can unscramble a jumbled word? 3 How many anagrams of PUGOR are there? That is, in how many different ways can these five letters be rearranged as a single word? 4 How many anagrams does an n-letter word have? (Do all n-letter words have the same number of anagrams?) Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 11 / 27

The Multiplication Principle In general, if a construction (or process) can be represented as a sequence of k steps, and the number of ways of performing each step is independent of any previous choices, and if n 1, n 2, n 3, : : :, n k denote the number of ways of performing each step, then N D n 1 n 2 n 3 n k ; denotes the total number of different constructions (or processes). This statement is called the multiplication principle. The number of permutations of abcd is found by setting k D 4, with n 1 D 4, n 2 D 3, n 3 D 2, and n 1 D 1, hence N D n 1 n 2 n 3 n 4 D 4 3 2 1 D 4Š Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 12 / 27

Some Problem Solving Heuristics 1 If the problem is too hard, try to solve an easier problem first. 2 Divide and Conquer: Hard problems can often be broken up into pieces, where each piece corresponds to an easier problem. 3 Generalize: Sometimes it is easier to solve a more general problem first. 4 Make a picture: Try to represent the problem as a picture. 5 Construct an abstraction. An abstraction is a simpler representation of the problem we are trying to solve. Reducing the problem to an abstraction that one has seen before often will suggest a simple solution. Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 13 / 27

Common Abstractions 1 A set is an unordered collection of objects (e.g., things, symbols, concepts, labels) in which each element (or member) appears no more than once. Matching left and right curly brackets, f: : :g, are used to denote a set. Thus the set of odd numbers between 0 and 10 is f1; 3; 5; 7; 9g, and the set of suits in a standard deck of playing cards is f~; ; ; }g. Since sets are unordered collections, f1; 3; 5; 7; 9g and f3; 1; 9; 5; 7g describe the same set. 2 The empty set is a special set that contains no objects at all. It is usually written as fg, or as ;. 3 A multiset is an unordered collection of objects in which each element can appear an arbitrary number of times. Thus f1; 3; 3; 9g is a multiset, but not a set. (Is every set also a multiset?). 4 A sequence is an ordered collection of objects. Often we will use left and right matching parentheses to denote a sequence, e.g. the alphabet is usually represented by the ordered sequence.a; B; C; : : : ; Z/. Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 14 / 27

Factorial Tree Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 15 / 27

Factorial Tree root VERTICES EDGES leaves The black dots are called nodes or vertices. The node at the top is called the root. The bottom nodes are called leaves. The colored lines are called branches, edges, or links. Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 16 / 27

Permutations of abc {a,b,c} a b c b c a c a b c b c a b a abc acb bac bca cab cba There are 6 anagrams using the letters a, b, c, one for each leaf node. Two begin with a, two begin with b, and two begin with c. Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 17 / 27

Permutations of abcd {a, b, c, d} a b c d b c d a c d a b d a b c c d b d b c c d a d a c b d a d a b b c a c a b d c d b c b d c d a c a d b d a b a c b c a b a abcd abdc acbd acdb adbc adcb bacd badc bcad bcda bdac bdca cabd cadb cbad cbda cdab cdba dabc dacb dbac dbca dcab dcba There are 24 anagrams using the letters a, b, c, d one for each leaf node. Six begin with a, six with b, six with c, and six with d. Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 18 / 27

A Riddle (Revised) As I was going to St. Ives, I met a man with seven wives, Each wife had seven sacks, Each sack had seven cats, Each cat had seven kits; Kits, cats, sacks, and wives, How many were leaving St. Ives? Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 19 / 27

Factorial tree with 5 different symbols Number of leaf nodes: 5Š D 5 4 3 2 1 D 5 4Š D 120. Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 20 / 27

Permuations of n different symbols Each time we add a symbol we create a new level in the tree. Number of permutations of n objects is nš D n.n 1/Š D n.n 1/.n 2/ 3 2 1: This can be understood from either the perspective of factorial trees, or the previously defined multiplication principle. Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 21 / 27

Anagrams of words with repeated symbols {,a 2,a 3 } a 2 a 3 a 2 a 3 a 3 a 2 a 2 a 3 a 3 a 2 a 2 a 3 a 2 a 3 a 3 a 2 a 3 a 2 Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 22 / 27

Anagrams of words with repeated symbols {,a 2,b 1 } a 2 b 1 a 2 b 1 b 1 a 2 a 2 b 1 b 1 a 2 a 2 b 1 a 2 b 1 b 1 a 2 b 1 a 2 Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 23 / 27

Anagrams with repeated letters How many anagrams of NEEDED exactly match NEEDED? EEE EEE EEE EEE EEE EEE DD NEEDED NEEDED NEEDED NEEDED NEEDED NEEDED DD NEEDED NEEDED NEEDED NEEDED NEEDED NEEDED By the multiplication principle, the number of times each anagram of NEEDED is repeated equals 3Š 2Š. Consequently, the number of different (or unique) anagrams of NEEDED equals 6Š 3Š 2Š D 6 5 4 3Š D 60: 3Š 2Š Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 24 / 27

Anagrams with words with repeated symbols How many different anagrams are there of abc? How many different anagrams are there of aaa? How many different anagrams are there of aab? How many different anagrams are there of abcd? How many different anagrams are there of aaaa? How many different anagrams are there of aaab? How many different anagrams are there of aabb? Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 25 / 27

Anagrams of words with repeated letters Consider the word MISSISSIPPI. How many unique permutations of these letters exist? First we count the frequency (number of occurrences) of each letter: Letter I M P S Count 4 1 2 4 As a check, note that n D 4 C 1 C 2 C 4 D 11, the length of the word. The number of unique permutations is then, 11Š D 34; 650: 4Š 1Š 2Š 4Š More generally, for a word that consists of k different letters of the alphabet, with r 1 repetitions of the first letter, r 2 of the second, : : :, r k of the k-th letter; the number of unique permutations equals.r 1 C r 2 C C r k /Š : r 1 Š r 2 Š r k Š Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 26 / 27

References [1] Bonnie Averbach and Orin Chein, Problem Solving Through Recreational Mathematics, Dover, Mineola, NY, 2000. (Contains diverse applications of the multiplication principle.) [2] Christian Bök, Eunoia, Couch House Books, Toronto, 2001. [3] Ross Eckler, Making the Alphabet Dance, St. Martin s Press, New York, 1996. [4] Ernest Vincent Wright, Gadsby, Wetzel Press, 1939. Robert R. Snapp 2014 3. Word Puzzles and Games CS 32, Fall 2014 27 / 27