Universitetet i Linköping Institutionen för datavetenskap Anders Haraldsson
|
|
- Bruce Horton
- 8 years ago
- Views:
Transcription
1 list functions TDDC65 Artificial intelligence and Lisp Lecture 2 in Lisp Recursion, symbols and lists (chapter 4, 5, 6 Haraldssons book) local variables and local functions recursion over sequences * patterns * recursive / iterative process * double recursion * back tracking the function cons graphical representation of lists the list as a binary tree traversing formulas Test of equality (= 5 5) - numbers (eq 'a 'a) - symbols (or pointers) (eql 5 5) - atoms (eql #\a #\a) (eql 'a 'a) (equal '(a b c) '(a b c)) - lists Test of data types (numberp 5) - number? (symbolp 'a) - symbol? (atom 5) - atom? = not a list? (atom 'a) (listp '(a b c)) - list? To create lists The primitive (cons 'a '(b c)) => (a b c) Concatenate 2 (or more) lists (append '(a b) '(x y)) => (a b x y) Create a list of a fixed number of elements (list 'a (1+ 4) (first '(b c))) => (a 5 b) Constant list '(a b c d) or (quote (a b c d)) Observe the difference. What is? (cons '(1 2) '(a b)) =>? (append '(1 2) '(a b)) =>? (list '(1 2) '(a b)) =>? Common Lisp functions for lists Some of them: Is an element on a list? (member 'x '(a b x c)) => true Remove all occurrences of an element (remove 'q '(a b q r q)) => (a b r) Reverse the elements on a list (reverse '(a b c)) => (c b a) Replace all occurrences of an element (subst 'new-q 'q '(a q (b q))) => (a new-q (b new-q)) Find the last part of a list (last '(ett två tre)) => (tre) Find the n+1 element (nth '(a b c d) 2) => c
2 How to add a new last element? Put five last on the list (one two three four). Example: (append '(one two three four) (list 'five)) => (one two three four five) Define a function add-to-the-end (defun add-to-the-end (e l) (append l (list e))) What happens here? (setq number-list '(one two three four)) (add-to-the-end 'five number-list) => (one two three four five) number-list =>? Local variables (let ((var expr) (var expr)...) expr) Avoid double calculations: g(x) = sin(f(x)) + cos(f(x)) (defun g (x) (let ((f-value (f x))) (+ (sin f-value) (cos f-value))) After the let-expression the binding disappear between the variable and value. Introduce a local name for a value: (let ((vocals (a e i o u å ä ö)))... (member (first l) vocals)... ) Local functions (labels ((fn (argument) body)) (fn (argument) body))...) expression) Example: f(x,y) = x!/y 2 (defun f (x y) (labels ((square (n) (* n n)) (fak (n) (if (= n 0) 1 (* n (fak (- n 1)))))) (/ (fak x) (square y)))) The function definitions are only valid inside f! Example: When we have iterative process the recursive function is defined locally. (defun fak (n) (fak-iter n 1)) (defun fak-iter (n res) (if (= n 0) res (fak-iter (- n 1) (* n res)))) (defun fak (n) (labels ((fak-iter (n res) (if (= n 0) res (fak-iter (- n 1) (* n res)))) ) (fak-iter n 1)))
3 Sequential processing of lists recursive process Sequential processing of lists iterative process (defun fn-sekv (l) ((endp l) init-value ) ( other condition expression ) (t ( operation (first l) (fn-sekv (rest l)) ))) (defun fn (l) (fn-iter l init-value )) (defun fn-iter (l res) ((endp l) res) ( other condition expression ) (t (fn-iter (rest l) ( operation (first l) res)) ))) recursive process: Example Replace the first occurrence of a given element (change 'karl kalle '(lisa per kalle stina)) => (lisa per karl stina) (defun change (new old l) ((endp l) ()) ((eq old (first l)) (cons new (rest l))) (t (cons (first l) (change new old (rest l))) ))) iterative process: (defun change (new old l) (change-iter new old l ())) (defun change-iter (n g l res) ((endp l) res) ((eq g (first l)) (append res (cons n (rest l)))) (t (change-iter n g (rest l) (add-to-the-end (first l) res))))) Why add-to-the-end instead of cons?
4 The substitution model for the two solutions: recursive process: (change 'karl kalle '(lisa per kalle stina)) -> (cons lisa (change karl kalle (per kalle stina)) -> (cons lisa (cons per (change karl kalle (kalle stina))) -> (cons lisa (cons per (cons karl (stina)))) -> (cons lisa (cons per (karl stina))) -> (cons lisa (per karl stina)) => (lisa per karl stina) iterative process: (change 'karl kalle '(lisa per kalle stina)) -> (ch-i karl kalle (lisa per kalle stina) ()) -> (ch-i karl kalle (per kalle stina) (lisa)) -> (ch-i karl kalle (kalle stina) (lisa per)) -> (ch-i karl kalle (append (lisa per) (cons karl (stina)))) => (lisa per karl stina) Double recursion Lists with lists as elements Pattern for sequences: (defun fn (l) ((endp l) init-value ) ( operation (first l) (fn (rest l)))) (t ( operation (fn (first l)) (fn (rest l)))) )) Total number of elements (defun symbols-in-seq (l) ((endp l) 0) (+ 1 (symbols-in-seq (rest l)))) (t (+ (symbols-in-seq (first l)) (symbols-in-seq (rest l))) ))) (symbols-in-seq '(a (b c (d e)) f)) => 6 Remove all occurrences of a symbol on all levels (defun my-all-remove (x l) ((endp l) ()) (if (eq x (first l)) (my-all-remove x (rest l)) (cons (first l) (my-all-remove x (rest l)))) (t (cons (my-all-remove x (first l)) (my-all-remove x (rest l))) ))) (my-all-remove 'q '(a q (b q (q)) c)) => (a (b nil) c)
5 Back tracking Is a given element somewhere in a list? (exist? 'q '(a (b q) c)) => t (defun exist? (x l) ((endp l) nil) (if (eq x (first l)) t (exist? x (rest l)))) (t (or (exist? x (first l)) (exist? x (rest l))) ))) Some problems are of the nature that you can not directly say if you have reached the right element or not. You must go on. Typical in search problems you must handle back tracking. Search one alternative, if it fails come back and try another alternative. Lab 2 and 3 use this concept. Here we will solve the following problem: Find the element after the last occurrence of a given element. We assume that the given element is not last in the list. (find-after x (a b x c)) => c (find-after x (a b x c x d x e)) => e (find-after x (a b c)) => element-not-on-list (defun find-after (x l) ((endp l) element-not-on-list) ((eq x (first l)) ; the element is found (let ((next-value (find-after x (rest l)))) ; check further (if (eq next-value element-not-on-list) (second l) next-value))) (t (find-after x (rest l))))) The function cons dotted pair: (cons a b) => (a. b) dotted list: (cons x (cons y z)) => (x y. z) association list: ((ett. one) (två. two) (tre. three)) Observe that all of these expressions describes the same list: (x y z) = (x y z. nil) = (x y. (z. nil)) = (x. (y. (z. nil)))
6 The list seen as a binary tree Pattern - binary tree: (defun fn (bt) (if (atom bt) <- leaf? processing of the leaf ( operation (fn (car bt)) (fn (cdr bt))))) The list seen as a binary tree pattern - binary tree - nil a special case: (defun fn (bt) ((eq bt nil) value ) ((atom bt) processing of the leaf ) (t ( operation (fn (car bt)) (fn (cdr bt))))) Observe: Here I use car and cdr instead of first and rest. (Better with primitives left and right) Number of elements (as leaves) Here is nil a leaf, it will be counted. (defun count-leaves (bt) (if (atom bt) 1 (+ (count-leaves (car bt)) (count-leaves (cdr bt)) ))) Here is nil not a leaf (defun count-leaves (bt) ((eq bt nil) 0) ((atom bt) 1) (t (+ (count-leaves (car bt)) (count-leaves (cdr bt)) ))) Sequence solution: Observations 3 cases - end of list - first element is an atom - first element is a list Binary tree solution 2 cases - atom (the leaf) - list (intern nod in the tree) Observe: The binary tree algorithm is more general, it includes the sequential algorithm. But, of course the problems nature gives what solution to use.
7 An arithmetic formula as a binary tree We represent the binary tree as a list with the following structure: (left-tree operator right-tree) * Define a function to calculate its value (value 3) => 3 (value ((2 + 4) * ((8-2) / 3))) => / 3 (defun value (expr) ((number? expr) expr) ((eq (operator expr) +) (+ (value (arg1 expr)) (value (arg2 expr)))) ((eq (operator expr) -) (- (value (arg1 expr)) (value (arg2 expr)))) ((eq (operator expr) *) (*......)) ((eq (operator expr) /) (/......)) (t (error... error message...)))) (defun number? (expr) (numberp expr)) (defun arg1 (expr) (first expr)) (defun arg2 (expr) (third expr) (defun operator (expr) (second expr))
Basic Lisp Operations
Basic Lisp Operations BLO-1 Function invocation It is an S-expression just another list! ( function arg1 arg2... argn) First list item is the function prefix notation The other list items are the arguments
More informationProgramming Languages in Artificial Intelligence
Programming Languages in Artificial Intelligence Günter Neumann, German Research Center for Artificial Intelligence (LT Lab, DFKI) I. AI programming languages II. Functional programming III. Functional
More informationChapter 15 Functional Programming Languages
Chapter 15 Functional Programming Languages Introduction - The design of the imperative languages is based directly on the von Neumann architecture Efficiency (at least at first) is the primary concern,
More informationForm & Function in Software. Richard P. Gabriel phd mfa
Form & Function in Software Richard P. Gabriel phd mfa Confusionists and superficial intellectuals... ...move ahead... ...while the deep thinkers descend into the darker regions of the status quo...
More informationHow To Program In Scheme (Prolog)
The current topic: Scheme! Introduction! Object-oriented programming: Python Functional programming: Scheme! Introduction Next up: Numeric operators, REPL, quotes, functions, conditionals Types and values
More informationDATA STRUCTURES USING C
DATA STRUCTURES USING C QUESTION BANK UNIT I 1. Define data. 2. Define Entity. 3. Define information. 4. Define Array. 5. Define data structure. 6. Give any two applications of data structures. 7. Give
More informationFunctional Programming. Functional Programming Languages. Chapter 14. Introduction
Functional Programming Languages Chapter 14 Introduction Functional programming paradigm History Features and concepts Examples: Lisp ML 1 2 Functional Programming Functional Programming Languages The
More informationRobot Programming with Lisp
4. More Functional Programming: Map/Reduce, Recursions Institute for Artificial Universität Bremen Outline 2 Mapping Mapping in functional programming is the process of applying a function to all members
More informationQUERYING THE COMPONENT DATA OF A GRAPHICAL CADASTRAL DATABASE USING VISUAL LISP PROGRAM
University 1 Decembrie 1918 of Alba Iulia RevCAD 16/2014 QUERYING THE COMPONENT DATA OF A GRAPHICAL CADASTRAL DATABASE USING VISUAL LISP PROGRAM Caius DIDULESCU, Associate Professor PhD eng. - Faculty
More informationData Mining Algorithms Parallelizing in Functional Programming Language for Execution in Cluster
Data Mining Algorithms Parallelizing in Functional Programming Language for Execution in Cluster Ivan Holod, PhD, Assoc. Prof., iiholod@mail.ru Aleksey Malov, PhD, alexeimal-2@yandex.ru Sergey Rodionov,
More informationML for the Working Programmer
ML for the Working Programmer 2nd edition Lawrence C. Paulson University of Cambridge CAMBRIDGE UNIVERSITY PRESS CONTENTS Preface to the Second Edition Preface xiii xv 1 Standard ML 1 Functional Programming
More informationVector storage and access; algorithms in GIS. This is lecture 6
Vector storage and access; algorithms in GIS This is lecture 6 Vector data storage and access Vectors are built from points, line and areas. (x,y) Surface: (x,y,z) Vector data access Access to vector
More informationOutline Basic concepts of Python language
Data structures: lists, tuples, sets, dictionaries Basic data types Examples: int: 12, 0, -2 float: 1.02, -2.4e2, 1.5e-3 complex: 3+4j bool: True, False string: "Test string" Conversion between types int(-2.8)
More informationParty Time! Computer Science I. Signature Examples PAIR OBJ. The Signature of a Procedure. Building a Set. Testing for Membership in a Set
Computer Science I Professor Tom Ellman Lecture 21 Party Time! Whom shall you invite? We will write the Party Planner program. It will select SETS of guests. By reasoning with RELATIONS. Before we party,
More informationSemester Review. CSC 301, Fall 2015
Semester Review CSC 301, Fall 2015 Programming Language Classes There are many different programming language classes, but four classes or paradigms stand out:! Imperative Languages! assignment and iteration!
More information10CS35: Data Structures Using C
CS35: Data Structures Using C QUESTION BANK REVIEW OF STRUCTURES AND POINTERS, INTRODUCTION TO SPECIAL FEATURES OF C OBJECTIVE: Learn : Usage of structures, unions - a conventional tool for handling a
More informationThe following themes form the major topics of this chapter: The terms and concepts related to trees (Section 5.2).
CHAPTER 5 The Tree Data Model There are many situations in which information has a hierarchical or nested structure like that found in family trees or organization charts. The abstraction that models hierarchical
More informationAlgorithms and Data Structures
Algorithms and Data Structures Part 2: Data Structures PD Dr. rer. nat. habil. Ralf-Peter Mundani Computation in Engineering (CiE) Summer Term 2016 Overview general linked lists stacks queues trees 2 2
More information1 Idioms, Patterns, and Programming
1 Idioms, Patterns, and Programming Chapter Objectives Chapter Contents This chapter introduces the ideas that we use to organize our thinking about languages and how they shape the design and implementation
More informationKITES TECHNOLOGY COURSE MODULE (C, C++, DS)
KITES TECHNOLOGY 360 Degree Solution www.kitestechnology.com/academy.php info@kitestechnology.com technologykites@gmail.com Contact: - 8961334776 9433759247 9830639522.NET JAVA WEB DESIGN PHP SQL, PL/SQL
More information1. Relational database accesses data in a sequential form. (Figures 7.1, 7.2)
Chapter 7 Data Structures for Computer Graphics (This chapter was written for programmers - option in lecture course) Any computer model of an Object must comprise three different types of entities: 1.
More informationSymbol Tables. Introduction
Symbol Tables Introduction A compiler needs to collect and use information about the names appearing in the source program. This information is entered into a data structure called a symbol table. The
More informationAnalyse et Conception Formelle. Lesson 5. Crash Course on Scala
Analyse et Conception Formelle Lesson 5 Crash Course on Scala T. Genet (ISTIC/IRISA) ACF-5 1 / 36 Bibliography Simply Scala. Online tutorial: http://www.simply.com/fr http://www.simply.com/ Programming
More informationWe will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share.
LING115 Lecture Note Session #4 Python (1) 1. Introduction As we have seen in previous sessions, we can use Linux shell commands to do simple text processing. We now know, for example, how to count words.
More informationESPResSo Summer School 2012
ESPResSo Summer School 2012 Introduction to Tcl Pedro A. Sánchez Institute for Computational Physics Allmandring 3 D-70569 Stuttgart Germany http://www.icp.uni-stuttgart.de 2/26 Outline History, Characteristics,
More informationSEQUENCES ARITHMETIC SEQUENCES. Examples
SEQUENCES ARITHMETIC SEQUENCES An ordered list of numbers such as: 4, 9, 6, 25, 36 is a sequence. Each number in the sequence is a term. Usually variables with subscripts are used to label terms. For example,
More informationProgramming Languages. Session 5 Main Theme Functional Programming. Dr. Jean-Claude Franchitti
Programming Languages Session 5 Main Theme Functional Programming Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences Adapted from course
More informationEastern Washington University Department of Computer Science. Questionnaire for Prospective Masters in Computer Science Students
Eastern Washington University Department of Computer Science Questionnaire for Prospective Masters in Computer Science Students I. Personal Information Name: Last First M.I. Mailing Address: Permanent
More informationLogistic Regression. Jia Li. Department of Statistics The Pennsylvania State University. Logistic Regression
Logistic Regression Department of Statistics The Pennsylvania State University Email: jiali@stat.psu.edu Logistic Regression Preserve linear classification boundaries. By the Bayes rule: Ĝ(x) = arg max
More informationAlgorithms Chapter 12 Binary Search Trees
Algorithms Chapter 1 Binary Search Trees Outline Assistant Professor: Ching Chi Lin 林 清 池 助 理 教 授 chingchi.lin@gmail.com Department of Computer Science and Engineering National Taiwan Ocean University
More informationLecture 10: Regression Trees
Lecture 10: Regression Trees 36-350: Data Mining October 11, 2006 Reading: Textbook, sections 5.2 and 10.5. The next three lectures are going to be about a particular kind of nonlinear predictive model,
More informationSample Questions Csci 1112 A. Bellaachia
Sample Questions Csci 1112 A. Bellaachia Important Series : o S( N) 1 2 N N i N(1 N) / 2 i 1 o Sum of squares: N 2 N( N 1)(2N 1) N i for large N i 1 6 o Sum of exponents: N k 1 k N i for large N and k
More informationMaster of Sciences in Informatics Engineering Programming Paradigms 2005/2006. Final Examination. January 24 th, 2006
Master of Sciences in Informatics Engineering Programming Paradigms 2005/2006 Final Examination January 24 th, 2006 NAME: Please read all instructions carefully before start answering. The exam will be
More information1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++
Answer the following 1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++ 2) Which data structure is needed to convert infix notations to postfix notations? Stack 3) The
More informationThis unit will lay the groundwork for later units where the students will extend this knowledge to quadratic and exponential functions.
Algebra I Overview View unit yearlong overview here Many of the concepts presented in Algebra I are progressions of concepts that were introduced in grades 6 through 8. The content presented in this course
More informationCOMPUTER SCIENCE TRIPOS
CST.98.5.1 COMPUTER SCIENCE TRIPOS Part IB Wednesday 3 June 1998 1.30 to 4.30 Paper 5 Answer five questions. No more than two questions from any one section are to be answered. Submit the answers in five
More informationDEFINITION 5.1.1 A complex number is a matrix of the form. x y. , y x
Chapter 5 COMPLEX NUMBERS 5.1 Constructing the complex numbers One way of introducing the field C of complex numbers is via the arithmetic of matrices. DEFINITION 5.1.1 A complex number is a matrix of
More informationOPTIMAL BINARY SEARCH TREES
OPTIMAL BINARY SEARCH TREES 1. PREPARATION BEFORE LAB DATA STRUCTURES An optimal binary search tree is a binary search tree for which the nodes are arranged on levels such that the tree cost is minimum.
More informationGUJARAT TECHNOLOGICAL UNIVERSITY, AHMEDABAD, GUJARAT. Course Curriculum. DATA STRUCTURES (Code: 3330704)
GUJARAT TECHNOLOGICAL UNIVERSITY, AHMEDABAD, GUJARAT Course Curriculum DATA STRUCTURES (Code: 3330704) Diploma Programme in which this course is offered Semester in which offered Computer Engineering,
More informationALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology)
ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology) Subject Description: This subject deals with discrete structures like set theory, mathematical
More informationRecursive Functions of Symbolic Expressions and Their Computation by Machine, Part I
Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I John McCarthy, Massachusetts Institute of Technology, Cambridge, Mass. April 1960 1 Introduction A programming system
More informationWeb Document Clustering
Web Document Clustering Lab Project based on the MDL clustering suite http://www.cs.ccsu.edu/~markov/mdlclustering/ Zdravko Markov Computer Science Department Central Connecticut State University New Britain,
More informationThe Smalltalk Programming Language. Beatrice Åkerblom beatrice@dsv.su.se
The Smalltalk Programming Language Beatrice Åkerblom beatrice@dsv.su.se 'The best way to predict the future is to invent it' - Alan Kay. History of Smalltalk Influenced by Lisp and Simula Object-oriented
More informationData Structure with C
Subject: Data Structure with C Topic : Tree Tree A tree is a set of nodes that either:is empty or has a designated node, called the root, from which hierarchically descend zero or more subtrees, which
More informationRegular Expressions with Nested Levels of Back Referencing Form a Hierarchy
Regular Expressions with Nested Levels of Back Referencing Form a Hierarchy Kim S. Larsen Odense University Abstract For many years, regular expressions with back referencing have been used in a variety
More informationMathematical Induction. Lecture 10-11
Mathematical Induction Lecture 10-11 Menu Mathematical Induction Strong Induction Recursive Definitions Structural Induction Climbing an Infinite Ladder Suppose we have an infinite ladder: 1. We can reach
More informationDELAWARE MATHEMATICS CONTENT STANDARDS GRADES 9-10. PAGE(S) WHERE TAUGHT (If submission is not a book, cite appropriate location(s))
Prentice Hall University of Chicago School Mathematics Project: Advanced Algebra 2002 Delaware Mathematics Content Standards (Grades 9-10) STANDARD #1 Students will develop their ability to SOLVE PROBLEMS
More informationAlgebra Unpacked Content For the new Common Core standards that will be effective in all North Carolina schools in the 2012-13 school year.
This document is designed to help North Carolina educators teach the Common Core (Standard Course of Study). NCDPI staff are continually updating and improving these tools to better serve teachers. Algebra
More informationEastern Washington University Department of Computer Science. Questionnaire for Prospective Masters in Computer Science Students
Eastern Washington University Department of Computer Science Questionnaire for Prospective Masters in Computer Science Students I. Personal Information Name: Last First M.I. Mailing Address: Permanent
More informationChapter 5. Recursion. Data Structures and Algorithms in Java
Chapter 5 Recursion Data Structures and Algorithms in Java Objectives Discuss the following topics: Recursive Definitions Method Calls and Recursion Implementation Anatomy of a Recursive Call Tail Recursion
More informationDynamic Cognitive Modeling IV
Dynamic Cognitive Modeling IV CLS2010 - Computational Linguistics Summer Events University of Zadar 23.08.2010 27.08.2010 Department of German Language and Linguistics Humboldt Universität zu Berlin Overview
More informationCOMPUTER SCIENCE. FACULTY: Jennifer Bowen, Chair Denise Byrnes, Associate Chair Sofia Visa
FACULTY: Jennifer Bowen, Chair Denise Byrnes, Associate Chair Sofia Visa COMPUTER SCIENCE Computer Science is the study of computer programs, abstract models of computers, and applications of computing.
More informationWhy? A central concept in Computer Science. Algorithms are ubiquitous.
Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online
More informationThomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation
Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science updated 03/08/2012 Unit 1: JKarel 8 weeks http://www.fcps.edu/is/pos/documents/hs/compsci.htm
More informationC H A P T E R Regular Expressions regular expression
7 CHAPTER Regular Expressions Most programmers and other power-users of computer systems have used tools that match text patterns. You may have used a Web search engine with a pattern like travel cancun
More informationThe previous chapter provided a definition of the semantics of a programming
Chapter 7 TRANSLATIONAL SEMANTICS The previous chapter provided a definition of the semantics of a programming language in terms of the programming language itself. The primary example was based on a Lisp
More informationPES Institute of Technology-BSC QUESTION BANK
PES Institute of Technology-BSC Faculty: Mrs. R.Bharathi CS35: Data Structures Using C QUESTION BANK UNIT I -BASIC CONCEPTS 1. What is an ADT? Briefly explain the categories that classify the functions
More informationSYSM 6304: Risk and Decision Analysis Lecture 5: Methods of Risk Analysis
SYSM 6304: Risk and Decision Analysis Lecture 5: Methods of Risk Analysis M. Vidyasagar Cecil & Ida Green Chair The University of Texas at Dallas Email: M.Vidyasagar@utdallas.edu October 17, 2015 Outline
More informationCorrespondence analysis for strong three-valued logic
Correspondence analysis for strong three-valued logic A. Tamminga abstract. I apply Kooi and Tamminga s (2012) idea of correspondence analysis for many-valued logics to strong three-valued logic (K 3 ).
More informationHow To Understand The Theory Of Computer Science
Theory of Computation Lecture Notes Abhijat Vichare August 2005 Contents 1 Introduction 2 What is Computation? 3 The λ Calculus 3.1 Conversions: 3.2 The calculus in use 3.3 Few Important Theorems 3.4 Worked
More information6.090, IAP 2005 Lecture 8
1 MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Science 6.090 Building Programming Experience IAP 2005 Lecture 8 Tags ; professor abstraction (define (make professor
More informationFX 115 MS Training guide. FX 115 MS Calculator. Applicable activities. Quick Reference Guide (inside the calculator cover)
Tools FX 115 MS Calculator Handouts Other materials Applicable activities Quick Reference Guide (inside the calculator cover) Key Points/ Overview Advanced scientific calculator Two line display VPAM to
More informationHadoop + Clojure. Hadoop World NYC Friday, October 2, 2009. Stuart Sierra, AltLaw.org
Hadoop + Clojure Hadoop World NYC Friday, October 2, 2009 Stuart Sierra, AltLaw.org JVM Languages Functional Object Oriented Native to the JVM Clojure Scala Groovy Ported to the JVM Armed Bear CL Kawa
More informationOverview. Essential Questions. Precalculus, Quarter 4, Unit 4.5 Build Arithmetic and Geometric Sequences and Series
Sequences and Series Overview Number of instruction days: 4 6 (1 day = 53 minutes) Content to Be Learned Write arithmetic and geometric sequences both recursively and with an explicit formula, use them
More informationProperties of sequences Since a sequence is a special kind of function it has analogous properties to functions:
Sequences and Series A sequence is a special kind of function whose domain is N - the set of natural numbers. The range of a sequence is the collection of terms that make up the sequence. Just as the word
More informationCatalan Numbers. Thomas A. Dowling, Department of Mathematics, Ohio State Uni- versity.
7 Catalan Numbers Thomas A. Dowling, Department of Mathematics, Ohio State Uni- Author: versity. Prerequisites: The prerequisites for this chapter are recursive definitions, basic counting principles,
More informationUnix Shell Scripts. Contents. 1 Introduction. Norman Matloff. July 30, 2008. 1 Introduction 1. 2 Invoking Shell Scripts 2
Unix Shell Scripts Norman Matloff July 30, 2008 Contents 1 Introduction 1 2 Invoking Shell Scripts 2 2.1 Direct Interpretation....................................... 2 2.2 Indirect Interpretation......................................
More informationChapter 13: Query Processing. Basic Steps in Query Processing
Chapter 13: Query Processing! Overview! Measures of Query Cost! Selection Operation! Sorting! Join Operation! Other Operations! Evaluation of Expressions 13.1 Basic Steps in Query Processing 1. Parsing
More informationIntelligent Agents. Chapter 2. Chapter 2 1
Intelligent Agents Chapter 2 Chapter 2 1 Reminders Assignment 0 (lisp refresher) due 1/28 Lisp/emacs/AIMA tutorial: 11-1 today and Monday, 271 Soda Chapter 2 2 Outline Agents and environments Rationality
More informationTuring Degrees and Definability of the Jump. Theodore A. Slaman. University of California, Berkeley. CJuly, 2005
Turing Degrees and Definability of the Jump Theodore A. Slaman University of California, Berkeley CJuly, 2005 Outline Lecture 1 Forcing in arithmetic Coding and decoding theorems Automorphisms of countable
More informationFactoring General Games
Factoring General Games Martin Günther Stephan Schiffel Michael Thielscher Department of Computer Science Dresden University of Technology, Germany {martin.guenther, stephan.schiffel, mit}@inf.tu-dresden.de
More informationAnalysis of Algorithms I: Binary Search Trees
Analysis of Algorithms I: Binary Search Trees Xi Chen Columbia University Hash table: A data structure that maintains a subset of keys from a universe set U = {0, 1,..., p 1} and supports all three dictionary
More informationFeature Construction for Time Ordered Data Sequences
Feature Construction for Time Ordered Data Sequences Michael Schaidnagel School of Computing University of the West of Scotland Email: B00260359@studentmail.uws.ac.uk Fritz Laux Faculty of Computer Science
More informationPartitioning and Divide and Conquer Strategies
and Divide and Conquer Strategies Lecture 4 and Strategies Strategies Data partitioning aka domain decomposition Functional decomposition Lecture 4 and Strategies Quiz 4.1 For nuclear reactor simulation,
More informationComputer Graphics CS 543 Lecture 12 (Part 1) Curves. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)
Computer Graphics CS 54 Lecture 1 (Part 1) Curves Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) So Far Dealt with straight lines and flat surfaces Real world objects include
More informationCompilers. Introduction to Compilers. Lecture 1. Spring term. Mick O Donnell: michael.odonnell@uam.es Alfonso Ortega: alfonso.ortega@uam.
Compilers Spring term Mick O Donnell: michael.odonnell@uam.es Alfonso Ortega: alfonso.ortega@uam.es Lecture 1 to Compilers 1 Topic 1: What is a Compiler? 3 What is a Compiler? A compiler is a computer
More information2 Integrating Both Sides
2 Integrating Both Sides So far, the only general method we have for solving differential equations involves equations of the form y = f(x), where f(x) is any function of x. The solution to such an equation
More informationTHE SEARCH FOR NATURAL DEFINABILITY IN THE TURING DEGREES
THE SEARCH FOR NATURAL DEFINABILITY IN THE TURING DEGREES ANDREW E.M. LEWIS 1. Introduction This will be a course on the Turing degrees. We shall assume very little background knowledge: familiarity with
More informationWESTMORELAND COUNTY PUBLIC SCHOOLS 2011 2012 Integrated Instructional Pacing Guide and Checklist Computer Math
Textbook Correlation WESTMORELAND COUNTY PUBLIC SCHOOLS 2011 2012 Integrated Instructional Pacing Guide and Checklist Computer Math Following Directions Unit FIRST QUARTER AND SECOND QUARTER Logic Unit
More informationLecture 1: Introduction
Programming Languages Lecture 1: Introduction Benjamin J. Keller Department of Computer Science, Virginia Tech Programming Languages Lecture 1 Introduction 2 Lecture Outline Preview History of Programming
More informationroot node level: internal node edge leaf node CS@VT Data Structures & Algorithms 2000-2009 McQuain
inary Trees 1 A binary tree is either empty, or it consists of a node called the root together with two binary trees called the left subtree and the right subtree of the root, which are disjoint from each
More informationThe Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge,
The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge, cheapest first, we had to determine whether its two endpoints
More informationEastern Washington University Department of Computer Science. Questionnaire for Prospective Masters in Computer Science Students
Eastern Washington University Department of Computer Science Questionnaire for Prospective Masters in Computer Science Students I. Personal Information Name: Last First M.I. Mailing Address: Permanent
More informationKrishna Institute of Engineering & Technology, Ghaziabad Department of Computer Application MCA-213 : DATA STRUCTURES USING C
Tutorial#1 Q 1:- Explain the terms data, elementary item, entity, primary key, domain, attribute and information? Also give examples in support of your answer? Q 2:- What is a Data Type? Differentiate
More informationDYNAMIC STUDENT MODELLING IN AN INTELLIGENT TUTOR FOR LISP PROGRAMMING. Brian J. Reiser John R. Anderson Robert G. Farrell
DYNAMIC STUDENT MODELLING IN AN INTELLIGENT TUTOR FOR LISP PROGRAMMING Brian J. Reiser John R. Anderson Robert G. Farrell Advanced Computer Tutoring Project Carnegie-Mellon University Pittsburgh, PA 15213
More informationLab 4: 26 th March 2012. Exercise 1: Evolutionary algorithms
Lab 4: 26 th March 2012 Exercise 1: Evolutionary algorithms 1. Found a problem where EAs would certainly perform very poorly compared to alternative approaches. Explain why. Suppose that we want to find
More informationAP Computer Science A - Syllabus Overview of AP Computer Science A Computer Facilities
AP Computer Science A - Syllabus Overview of AP Computer Science A Computer Facilities The classroom is set up like a traditional classroom on the left side of the room. This is where I will conduct my
More information1. Classification problems
Neural and Evolutionary Computing. Lab 1: Classification problems Machine Learning test data repository Weka data mining platform Introduction Scilab 1. Classification problems The main aim of a classification
More informationCS510 Software Engineering
CS510 Software Engineering Propositional Logic Asst. Prof. Mathias Payer Department of Computer Science Purdue University TA: Scott A. Carr Slides inspired by Xiangyu Zhang http://nebelwelt.net/teaching/15-cs510-se
More informationDecision Making under Uncertainty
6.825 Techniques in Artificial Intelligence Decision Making under Uncertainty How to make one decision in the face of uncertainty Lecture 19 1 In the next two lectures, we ll look at the question of how
More informationData Analysis 1. SET08104 Database Systems. Copyright @ Napier University
Data Analysis 1 SET08104 Database Systems Copyright @ Napier University Entity Relationship Modelling Overview Database Analysis Life Cycle Components of an Entity Relationship Diagram What is a relationship?
More informationLecture 8 February 4
ICS273A: Machine Learning Winter 2008 Lecture 8 February 4 Scribe: Carlos Agell (Student) Lecturer: Deva Ramanan 8.1 Neural Nets 8.1.1 Logistic Regression Recall the logistic function: g(x) = 1 1 + e θt
More informationOrdered Lists and Binary Trees
Data Structures and Algorithms Ordered Lists and Binary Trees Chris Brooks Department of Computer Science University of San Francisco Department of Computer Science University of San Francisco p.1/62 6-0:
More informationData Structures and Algorithms
Data Structures and Algorithms CS245-2016S-06 Binary Search Trees David Galles Department of Computer Science University of San Francisco 06-0: Ordered List ADT Operations: Insert an element in the list
More informationDRAFT. Algebra 1 EOC Item Specifications
DRAFT Algebra 1 EOC Item Specifications The draft Florida Standards Assessment (FSA) Test Item Specifications (Specifications) are based upon the Florida Standards and the Florida Course Descriptions as
More informationY. Xiang, Constraint Satisfaction Problems
Constraint Satisfaction Problems Objectives Constraint satisfaction problems Backtracking Iterative improvement Constraint propagation Reference Russell & Norvig: Chapter 5. 1 Constraints Constraints are
More informationAnalysis of Algorithms I: Optimal Binary Search Trees
Analysis of Algorithms I: Optimal Binary Search Trees Xi Chen Columbia University Given a set of n keys K = {k 1,..., k n } in sorted order: k 1 < k 2 < < k n we wish to build an optimal binary search
More informationSoftware Analysis (POPA Sec. 2.5.3, 2.5.4, 2.5.6)
Software Analysis (POPA Sec. 2.5.3, 2.5.4, 2.5.6) Klaus Ostermann Based on slides by Jurriaan Hage Towards embellished monotone frameworks From monotone framework to embellished monotone framework. We
More informationLecture 1: Course overview, circuits, and formulas
Lecture 1: Course overview, circuits, and formulas Topics in Complexity Theory and Pseudorandomness (Spring 2013) Rutgers University Swastik Kopparty Scribes: John Kim, Ben Lund 1 Course Information Swastik
More information