Programming Practice Programming Puzzles and Competitions CIS 4900 / 5920 Spring 2009.

Slides:



Advertisements
Similar presentations
Macro Processor.
Advertisements

Overview What is Dynamic Programming? A Sequence of 4 Steps
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 15: Exception Handling.
Chapter 16: Exception Handling C++ Programming: From Problem Analysis to Program Design, Fifth Edition.
Flow Charts, Loop Structures
UNIT-III By Mr. M. V. Nikum (B.E.I.T). Programming Language Lexical and Syntactic features of a programming Language are specified by its grammar Language:-
Monday, 12/9/02, Slide #1 CS 106 Intro to CS 1 Monday, 12/9/02  QUESTIONS??  On HW #5 (Due 5 pm today)  Today:  Recursive functions  Reading: Chapter.
Property Matching and Weighted Matching Amihood Amir, Eran Chencinski, Costas Iliopoulos, Tsvi Kopelowitz and Hui Zhang.
Random Variables November 23, Discrete Random Variables A random variable is a variable whose value is a numerical outcome of a random phenomenon.
1 Lab Session-IV CSIT-120 Spring 2001 Lab 3 Revision and Exercises Rev: Precedence Rules Lab Exercise 4-A Machine Language Programming The “Micro” Machine.
Properties of Text CS336 Lecture 3:. 2 Information Retrieval Searching unstructured documents Typically text –Newspaper articles –Web pages Other documents.
Algorithms for Regulatory Motif Discovery Xiaohui Xie University of California, Irvine.
Chapter 2: Design of Algorithms
1 Unsupervised Discovery of Morphemes Presented by: Miri Vilkhov & Daniel Feinstein linja-autonautonkuljettajallakaan linja-auton auto kuljettajallakaan.
Topics Automata Theory Grammars and Languages Complexities
Chapter 7. 2 Objectives You should be able to describe: The string Class Character Manipulation Methods Exception Handling Input Data Validation Namespaces.
Verificarea şi Validarea Sistemelor Soft Tem ă Laborator 2 Testare Black Box Dat ă primire laborator: Lab 2 Dat ă predare laborator: Lab 2,3.
1 Lab Session-III CSIT-120 Fall 2000 Revising Previous session Data input and output While loop Exercise Limits and Bounds Session III-B (starts on slide.
Programming for Linguists An Introduction to Python 24/11/2011.
CS 106 Introduction to Computer Science I 01 / 25 / 2010 Instructor: Michael Eckmann.
Computer Science Department Data Structure & Algorithms Problem Solving with Stack.
© The McGraw-Hill Companies, 2006 Chapter 4 Implementing methods.
1 CSC 221: Introduction to Programming Fall 2012 Functions & Modules  standard modules: math, random  Python documentation, help  user-defined functions,
Term 2, 2011 Week 6. CONTENTS Validating data Formats and conventions – Text – Numerical information – Graphics Testing techniques – Completeness testing.
Introduction Algorithms and Conventions The design and analysis of algorithms is the core subject matter of Computer Science. Given a problem, we want.
Lexical Analysis Hira Waseem Lecture
1 University of Palestine Topics In CIS ITBS 3202 Ms. Eman Alajrami 2 nd Semester
Searching. RHS – SOC 2 Searching A magic trick: –Let a person secretly choose a random number between 1 and 1000 –Announce that you can guess the number.
Lesson 3 CDT301 – Compiler Theory, Spring 2011 Teacher: Linus Källberg.
CS 61B Data Structures and Programming Methodology July 28, 2008 David Sun.
Examples of comparing strings. “ABC” = “ABC”? yes “ABC” = “ ABC”? No! note the space up front “ABC” = “abc” ? No! Totally different letters “ABC” = “ABCD”?
ITIP © Ron Poet Lecture 12 1 Finding Out About Objects.
CISC1100: Binary Numbers Fall 2014, Dr. Zhang 1. Numeral System 2  A way for expressing numbers, using symbols in a consistent manner.  " 11 " can be.
Cluster-specific Named Entity Transliteration Fei Huang HLT/EMNLP 2005.
Expert System Note: Some slides and/or pictures are adapted from Lecture slides / Books of Dr Zafar Alvi. Text Book - Aritificial Intelligence Illuminated.
Problem 1: Word Segmentation whatdoesthisreferto.
Chapter-4 Managing input and Output operation.  Reading, processing and writing of data are three essential functions of a computer program.  Most programs.
Specifying Languages Our aim is to be able to specify languages for use in the computer. The sketch of an FSA is easy for us to understand, but difficult.
Sections © Copyright by Pearson Education, Inc. All Rights Reserved.
CS404 Design and Analysis of Algorithms BBy DDr. M V S Peri Sastry BB.E, PhD(BITS-Pilani)
7 th Grade Language Arts Monday, October 5, 2015 No DOL this week Harris and Me Begin writing assessment- “Seventh Grade” Must be submitted by Friday at.
Chapter 15: Exception Handling C++ Programming: Program Design Including Data Structures, Fifth Edition.
Paper 2 30 Minutes/20 marks Letter Writing. Paper 2 30 Minutes/20 marks So, how should a letter be structured? 4-5 paragraphs Appropriate tone Rhetorical.
1 UNIT-I BRUTE FORCE ANALYSIS AND DESIGN OF ALGORITHMS CHAPTER 3:
An Introduction to Programming with C++ Sixth Edition Chapter 13 Strings.
CS 241 Discussion Section (2/9/2012). MP2 continued Implement malloc, free, calloc and realloc Reuse free memory – Sequential fit – Segregated fit.
Introduction to TopCoder Programming Puzzles and Competitions CIS 4900 / 5920 Spring 2009.
CS 221 – May 24 What is it good for? – Many trials or iterations needed for maximum precision – Large input – Intractable problems Please note: – H2 due.
CS 403: Programming Languages Lecture 20 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
Spring 16 CSCI 4430, A Milanova 1 Announcements HW1 due on Monday February 8 th Name and date your submission Submit electronically in Homework Server.
May 2006CLINT-LIN Regular Expressions1 Introduction to Computational Linguistics Regular Expressions (Tutorial derived from NLTK)
8 th Grade Language Arts Monday, October 5, 2015 No DOL this week Far North Begin essay assessment- “Charles” Must be submitted by Friday at 9 P.M.
Upcoming Contests TopCoder Marathon Match 49 (currently running – ends Feb. 18 th )
Perl Regular Expression in SAS
CMPE 280 Web UI Design and Development August 29 Class Meeting
Lexical Analysis.
* Lecture # 7 Instructor: Rida Noor Department of Computer Science
Lecture Outline for Recurrences
Software Requirements
Field Mapper Julian Ramirez February 5, 2015.
Programming Puzzles and Competitions CIS 4900 / 5920 Spring 2009
INFO/CSE 100, Spring 2005 Fluency in Information Technology
CS 100: Roadmap to Computing
Recitation Outline C++ STL associative containers Examples
The structure of programming
Genome 540: Discussion Section Week 3
News from Miss Gannuscio
CS 100: Roadmap to Computing
Early Midterm Some Study Reminders.
Presentation transcript:

Programming Practice Programming Puzzles and Competitions CIS 4900 / 5920 Spring 2009

Next Contest TopCoder SRM 434 (TOMORROW) Saturday, February 7 th, 12:00pm

Current contest: Marathon Match 49 Started Wednesday, February 4 th, 12:00pm Open until Wednesday, February 18 th, 12:00pm

Current contest: Marathon Match 49 Problem statement: t/?module=ViewProblemStatement&c ompid=8907&rd=13709

Problem: Text Segmentation

Text Segmentation Some languages, such as Chinese and Japanese, are written without spaces between the words

Text Segmentation Some languages, such as Chinese and Japanese, are written without spaces between the words This makes it difficult for search engines to decipher the meaning of a search (and therefore to return appropriate results)

Text Segmentation Given a group of words with no spaces (i.e. a string of letters), what is the best segmentation of the string into words? Example: “upordown”  “up or down”

Text Segmentation Ambiguities are possible, e.g.: “theyouthevent”  ?

Text Segmentation There are at least three ways to segment “theyouthevent” into valid words: –“they out he vent” –“the youth event” (most likely)

Text Segmentation Why is this important?

Text Segmentation Why is this important? Even in English we run into juxtapositions of words (such as domain names, for example)

Text Segmentation: Falls from grace These examples are borrowed from Peter Norvig.

Text Segmentation: Falls from grace whorepresents.com These examples are borrowed from Peter Norvig.

Text Segmentation: Falls from grace whorepresents.com therapistfinder.com These examples are borrowed from Peter Norvig.

Text Segmentation: Falls from grace whorepresents.com therapistfinder.com speedofart.com These examples are borrowed from Peter Norvig.

Text Segmentation: Falls from grace whorepresents.com therapistfinder.com speedofart.com expertsexchange.com These examples are borrowed from Peter Norvig.

Text Segmentation: Falls from grace whorepresents.com therapistfinder.com speedofart.com expertsexchange.com penisland.com These examples are borrowed from Peter Norvig.

Text Segmentation How can this be done?

Text Segmentation P 0 (x) = probability of encountering x as a single word P(y = [y 1 y 2 …y n ]) = probability of encountering y as a sequence of (concatenated) words y 1 y 2 …y n P max (y) = maximum probability of any segmentation of y

Text Segmentation We are trying to find the [y 1 y 2 …y n ] such that: P(y=[y 1 y 2 …y n ]) = P max (y) This is clearly the most likely segmentation of the word

Text Segmentation A simple recursion: P max (y) = max i P 0 (y[0:i]) x P max (y[i:n]) where n = length(y)

Text Segmentation P max (“theyouthevent”) = max( P 0 (“t”) x P max (“heyouthevent”), P 0 (“th”) x P max (“eyouthevent”), … P 0 (“theyouthevent”) x P max (“”) );

Options… Work on Marathon Match 49 –Go to Work on Text Segmentation –Go to practice/ practice/