HANGMAN OPTIMIZATION Kyle Anderson, Sean Barton and Brandyn Deffinbaugh.

Slides:



Advertisements
Similar presentations
Spelling Correction for Search Engine Queries Bruno Martins, Mario J. Silva In Proceedings of EsTAL-04, España for Natural Language Processing Presenter:
Advertisements

1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
Huffman code and ID3 Prof. Sin-Min Lee Department of Computer Science.
Recursively Defined Functions
Introduction to Probability The problems of data measurement, quantification and interpretation.
On the Genetic Evolution of a Perfect Tic-Tac-Toe Strategy
Optimal Analyses for 3  n AB Games in the Worst Case Li-Te Huang and Shun-Shii Lin Dept. of Computer Science & Information Engineering, National Taiwan.
Tutorial 6 of CSCI2110 Bipartite Matching Tutor: Zhou Hong ( 周宏 )
Part 3: The Minimax Theorem
Designing Algorithms Csci 107 Lecture 4. Outline Last time Computing 1+2+…+n Adding 2 n-digit numbers Today: More algorithms Sequential search Variations.
Multiplication Rule. A tree structure is a useful tool for keeping systematic track of all possibilities in situations in which events happen in order.
Chapter 4 Normal Forms for CFGs Chomsky Normal Form n Defn A CFG G = (V, , P, S) is in chomsky normal form if each rule in G has one of.
Matrix Games Mahesh Arumugam Borzoo Bonakdarpour Ali Ebnenasir CSE 960: Selected Topics in Algorithms and Complexity Instructor: Dr. Torng.
1 Algorithm Efficiency, Big O Notation, and Role of Data Structures/ADTs Algorithm Efficiency Big O Notation Role of Data Structures Abstract Data Types.
Algorithms and Efficiency of Algorithms February 4th.
Complexity (Running Time)
Dovetail Killer? Implementing Jonathan’s New Idea Tarek Sherif.
1 Unsupervised Discovery of Morphemes Presented by: Miri Vilkhov & Daniel Feinstein linja-autonautonkuljettajallakaan linja-auton auto kuljettajallakaan.
© 2006 Pearson Addison-Wesley. All rights reserved10 A-1 Chapter 10 Algorithm Efficiency and Sorting.
Huffman Codes Message consisting of five characters: a, b, c, d,e
CHAPTER 7: SORTING & SEARCHING Introduction to Computer Science Using Ruby (c) Ophir Frieder at al 2012.
Natural Language Processing Expectation Maximization.
1.
LISTS. RECAP Major Topics Variables Functions Sensing Messaging OOP.
Text Analysis Everything Data CompSci Spring 2014.
MA/CSSE 473 Days Optimal BSTs. MA/CSSE 473 Days Student Questions? Expected Lookup time in a Binary Search Tree Optimal static Binary Search.
SPELLING GAME PROJECT SAMPLE ASSESSMENT MATERIAL GCSE Computing.
Senior Project – Computer Science – 2015 Modelling Opponents in Board Games Julian Jocque Advisor – Prof. Rieffel Abstract Modelling opponents in a game.
1 Computer Algorithms Lecture 3 Asymptotic Notation Some of these slides are courtesy of D. Plaisted, UNC and M. Nicolescu, UNR.
Finding dense components in weighted graphs Paul Horn
Data Structures and Algorithm Analysis Hashing Lecturer: Jing Liu Homepage:
Randomized Turing Machines
CSC312 Automata Theory Lecture # 2 Languages.
 Make sure you are subscribed to announcements on Moodle.  Activity 4 will be due 48hrs after your lab ends.
Chapter 12 Recursion, Complexity, and Searching and Sorting
Genetic Algorithms Michael J. Watts
OPTIMAL TEXT SELECTION ALGORITHM ASR Project Meetings Dt: 08 June Rohit Kumar - LTRC, IIIT Hyderabad.
Presenter: Chih-Yuan Chou GA-BASED ALGORITHMS FOR FINDING EQUILIBRIUM 1.
MA/CSSE 473 Days Optimal linked lists Optimal BSTs Greedy Algorithms.
CPSC 335 Randomized Algorithms Dr. Marina Gavrilova Computer Science University of Calgary Canada.
3. Counting Permutations Combinations Pigeonhole principle Elements of Probability Recurrence Relations.
Compression.  Compression ratio: how much is the size reduced?  Symmetric/asymmetric: time difference to compress, decompress?  Lossless; lossy: any.
Data structure design Jordi Cortadella Department of Computer Science.
Analysis of Algorithms CSCI Previous Evaluations of Programs Correctness – does the algorithm do what it is supposed to do? Generality – does it.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
GENETIC ALGORITHMS.  Genetic algorithms are a form of local search that use methods based on evolution to make small changes to a popula- tion of chromosomes.
Introduction to Algorithms Chapter 16: Greedy Algorithms.
Cluster-specific Named Entity Transliteration Fei Huang HLT/EMNLP 2005.
Chapter 18: Searching and Sorting Algorithms. Objectives In this chapter, you will: Learn the various search algorithms Implement sequential and binary.
Tetris Agent Optimization Using Harmony Search Algorithm
ALGORITHMS.
R-Trees: A Dynamic Index Structure For Spatial Searching Antonin Guttman.
LISTS. LEARNING OBJECTIVES Create a block that accepts a parameter Create a block that returns a value Create scripts that manipulates lists Incorporate.
Lecture 12 Huffman Algorithm. In computer science and information theory, a Huffman code is a particular type of optimal prefix code that is commonly.
Fast and Memory-Efficient Regular Expression Matching for Deep Packet Inspection Publisher : ANCS’ 06 Author : Fang Yu, Zhifeng Chen, Yanlei Diao, T.V.
Adversarial Search 2 (Game Playing)
Artificial Intelligence in Game Design Lecture 20: Hill Climbing and N-Grams.
HANGMAN- Software/ Hardware Integration Project Idea was to design a working C++ program to play a Hangman word guessing game Idea was to design a working.
Discriminative n-gram language modeling Brian Roark, Murat Saraclar, Michael Collins Presented by Patty Liu.
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
Algorithm Complexity is concerned about how fast or slow particular algorithm performs.
Applied Discrete Mathematics Week 11: Relations
Lecture – 2 on Data structures
Engineering Innovation Center
Objective of This Course
Chapter 11 Data Compression
Matthew Renner, Trish Beeksma, Patch Kenny
Game Description Player 1: Decides on integer x > 0
Agenda Warmup Lesson 1.9 (random #s, Boolean variables, etc)
Presentation transcript:

HANGMAN OPTIMIZATION Kyle Anderson, Sean Barton and Brandyn Deffinbaugh

ABSTRACT Our group attempted to find an optimal strategy to solve a game of hangman between three different algorithms, a unigram, a bigram and an exhaustive search. The game of hangman would be randomly played using a imported dictionary of 8988 common English words, modified by us to remove words with symbols such as contractions.

RULES OF THE GAME 1.)A random word is chosen and presented to the player as a string of underscores Ex. Chosen word is Cat, presented string is “ _ _ _ “ 2.) A correct guess yields a filled in blank on the target string corresponding to the location or locations of the correctly guessed letter. Ex. A is guessed, player is presented with “ _ A _ “ 3.) A incorrect guess does not fill in any of the target string. 4.)No limit to amount of guesses.

FORMAL PROBLEM STATEMENT Given a string of length N randomly chosen from a internal dictionary, find the letters of the string using n-gram models to find probabilities of letter frequency, and then input the letter or letter combination with the highest occurrence into the string. If a character or combination of characters are found to match a portion of the target string, then their positions in the target string are reveled to the player. The problem is considered solved when the entire length N string is revealed.

ALGORITHMS USED 1) A unigram algorithm that guesses using the letter occurrences in the supplied dictionary. The first guess is always the most common occurring letter. Ex. E, B, C etc. 2) A bigram algorithm also guesses using the letter occurrences in the supplied dictionary; however, this algorithm uses letter pairs instead of single letters. Ex. AA, AB, AC etc. 3) Our exhaustive search algorithm simply guesses from the letter A to the letter Z, and does not reference the dictionary or letter frequencies at all.

EXPERIMENTAL PROCEDURE The dictionary used in the experiment was 8988 words long, and was formatted to remove words with symbols in them such as contractions. The letter frequency that each algorithm used was generated at run time of that algorithm, based on the entirety of the dictionary. Repeated letters in a word are not counted twice for the letter frequency. The exhaustive search algorithm did not reference the dictionary at all.

DATA UnigramRunTimeUnigramGuessesBigramRunTimeBigramGuessesExhaustiveRunTimeExhaustiveGuesses Average Standard Deviation Maximum Minimum

PROBLEMS WITH OUR WORK Our time measurement was not accurate for smaller words. Time complexity of the exhaustive search could be better optimized.

RESULTS SUMMARY

RESULTS SUMMARY CONTINUED

CONCLUSIONS The unigram performed the best in terms of average guesses with the average amount of guesses being 16.6 and second in terms of run time taking seconds to complete. The bigram performed the worst in terms of average guesses having to guess times on average to complete the word, but best in terms of run time averaging seconds to complete. The exhaustive search was second in terms of average guesses taking guesses to and the worst in terms of run time averaging seconds to complete.

FUTURE WORK For the unigram and bigram algorithm you could update their letter frequencies based on the length of the word given. Having the algorithm remove words that do not have letters in the positions that have been guessed already and updating the unigram and bigram frequency with the new word bank. Trying to use the algorithms with a different programming language may yield more accurate run times.

DISCUSSION QUESTIONS 1) What was the most effective algorithm with respect to average guesses?  A.) Unigram. 2) What is a unigram? What is a bigram?  A.) Unigram is the probability of a single token to appear in a set using either that set or another set to find the initial probability they appear. Bigram is the probability of all combinations of tokens to appear in a given set using that set or another set to find the initial probability. 3.) What is the Big(O) of the unigram algorithm? Bigram? Exhaustive search?  A.) Unigram: M*N^2, Bigram: M*N^2, Exhaustive search: M^2*N^2.