2 Pages

HA3

Course: CSC 236, Fall 2009
School: Toledo
Rating:
 
 
 
 
 

Word Count: 765

Document Preview

236 =========================================================================== CSC Homework Assignment 3 Winter 2008 =========================================================================== Due: by 10am on Thu 3 Apr Worth: 8% For each question, please write your answer carefully. Keep in mind that approximately half of the marks for each question will be given purely for...

Register Now

Unformatted Document Excerpt

Coursehero >> Ohio >> Toledo >> CSC 236

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
236 =========================================================================== CSC Homework Assignment 3 Winter 2008 =========================================================================== Due: by 10am on Thu 3 Apr Worth: 8% For each question, please write your answer carefully. Keep in mind that approximately half of the marks for each question will be given purely for having the correct proof structure, written up clearly and precisely, irrespective of the correctness of the proof. Also, make sure that you use notation and terminology correctly, and that you explain and justify what you are doing -- marks *will* be deducted for incorrect or ambiguous use of notation and terminology, and for making incorrect, unjustified, ambiguous, or vague claims in your solutions. 1. Reminders: - In a Binary Search Tree (BST), every node stores a value with the property that each node's value is greater than or equal to all the values in the node's left subtree and less than or equal to all the values in the node's right subtree. For this question, assume that no two values are the same, i.e., each value is different from all the others -- this is not strictly necessary for the code below to be correct, but it makes the statement of correctness and its proof easier. - In Python (including the "pseudo-code Python" I use in the course), it is possible to test if a reference is "null" by using it as a truth value, e.g., the expression 'node.left' in a boolean context (when evaluating an if-statement or while-statement) is considered True if 'node.left' exists, and False if 'node.left' does not exist (i.e., if 'node.left' is the special value None; the Python version of "null"). Also, the keyword 'is' compares that two references actually refer to the same object, e.g., 'node is node.parent.right' has value True when 'node' is its parent's right child, False otherwise. Prove that the following algorithm is correct, including filling in appropriate loop invariants where indicated. # Precond: 'node' is a reference to the root of a non-empty BST where each # node stores a numerical value (in field 'datum'), in addition to # references to its 'parent', 'left' child, and 'right' child. Also, # every value in the tree is unique (does not appear more than once). count = 0 average = 0.0 # LI^1: The subtree rooted at 'node' contains the smallest value in the # entire tree. node.left: while node = node.left # LI^2: 'average' stores the average of every value in the tree that is # strictly less than 'node.datum' (or the average of every value in # the tree if 'node' is None). while node: count += 1 average += (node.datum - average) / count # Let 'current' denote the value just added to the average # (i.e., 'current' = 'node.datum' for the current node). if node.right: node = node.right # LI^3: (TO BE FILLED IN: state the relationship between 'current' # and values in the subtree rooted at 'node'.) while node.left: node = node.left else: # LI^4: (TO BE FILLED IN: state the relationship between 'current' # and values in the subtree rooted at 'node'.) while node.parent and node is node.parent.right: node = node.parent node = node.parent # Hint: state the relationship between 'current' and 'node.datum' for # the value of 'node' at this point. # Postcond: 'average' stores the average of every value in the tree. 2. Give a NFA and a DFA for the following language, and justify that both are correct (i.e., you do not have to write a complete proof of correctness, but you should describe clearly the meaning of each state, or show your work if you use a construction given in class). { w (- {-,0,1}* : **|w| >= 3 and** the third-last character of w is not 0 } (Where "third-last" is counted from the right.) 3. ...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Toledo - CSC - 236
=CSC 236 Lecture Summary for Week 2 Winter 2008=CONVENTION: Because we use induction almost always on natural numbers, I will omit "(- N" from all quantifiers from now on - so remember that for every quantifi
Toledo - CS - 104
CSC 104 Tutorial NotesBowen HuiJuly 06th 2005Recall from last time=- links - image - global vs. local - within document - emailIntroduction=- an HTML form is a section of a document - contains: regular HTML content controls-
Toledo - CS - 104
<html>this is a test page</html>
Toledo - CSC - 236
=CSC 236 Sample Solutions for Week 9 Tutorial Fall 2007=This is the example in section 2.4 of the textbook, rephrased to use thesame notation I use in lecture.Prove the correctness of the following algorithm.Recall that
Toledo - CSC - 363
=CSC 363H Example of Turing machine description Fall 2007=We are going to define a TM that subtracts two numbers written in binary,as follows. - The input alphabet is {0,1,#} ('#' to separate the numbers). - If the input
Toledo - CSC - 363
=CSC 363H Exercise 4 Fall 2007=A. Show that there are countably many lists of 5 natural numbers. (Hint: For part of the answer, consider the sum of the numbers.)B. Show that there are uncounta
Toledo - CSC - 363
=CSC 363 Lecture Summary for Week 7 Fall 2008=Two last examples of <=m. - EQ_TM is neither recognizable nor co-recognizable. (A language is "co-recognizable" if its complement is recognizable. Similar def
Toledo - CSC - 373
=CSC 373 Homework Assignment 2 - Marking Scheme Fall 2008=NOTE TO STUDENTS:You will find below the marking scheme used for your homework, includingthe meaning of marking codes and number of marks associated with each one.Th
Toledo - CSC - 373
=CSC 373 Lecture Summary for Week 1 Fall 2008=-Administrative information-Course Information Sheet.Please answer polls about office hours (on bulletin board) by this Friday!Motivation: - Abstraction is goo
Toledo - CSC - 373
=CSC 373 Homework Exercise 3 - Marking Scheme Fall 2008=NOTE TO STUDENTS:You will find below the marking scheme used for your homework, includingthe meaning of marking codes and number of marks associated with each one.Th
Toledo - ECONOMICS - 4060
Discussion of "A Model of the Distribution of Talent Across Education Fields"Written by Elena CapatinaModel Overview Uses a signaling model to analyze the sorting decisions of agents into education fields Agents develop all their skills at high
East Los Angeles College - GEOG - 5815
Geog5811M GIS in the Workplace Assessment 1Contributions to Discussion ThreadsIntroduction This course is assessed on two pieces of work. This first assessment is worth 10% of your module marks. Your task is to: post responses to at least 4 of t
East Los Angeles College - GEOG - 5891
Greater London Greater Manchester Merseyside South Yorkshire Tyne and Wear West Midlands West Yorkshire Avon Bedfordshire Berkshire Buckinghamshire Cambridgeshire Cheshire Cleveland Cornwall Cumbria Derbyshire Devon Dorset Durham
East Los Angeles College - GEOG - 2750
GEOG2750Earth Observation & GIS of the Physical Environment20 Credit Level 2 Module Louise Mackay & Steve Carver Module InformationSee also http:/www.geog.leeds.ac.uk/courses/level2/geog2750/index.htmlWeek 14 GEOG2750 Earth Observation & GIS of
East Los Angeles College - GEOG - 2750
School of Geography University of Leeds GEOG27502004/2005 Level 2 Louise MackayPractical 7 and Assignment 4:Interpreting and explaining ERS2 SAR backscatter responseWeek 8Task: To use ERDAS Imagine to apply a speckle reduction filter to the E
Toledo - CSC - 2106
University of TorontoDepartment of Computer ScienceUniversity of TorontoDepartment of Computer ScienceLecture 9: Agreeing RequirementsValidating Requirements Validating Requirements Validation basics Validation basics Reviews and Inspections
Toledo - ECE - 461
Review of Important Networking ConceptsIntroductory material. This module uses the example from the previous module to review important networking concepts: protocol architecture, protocol layers, encapsulation, demultiplexing, network abstractions.
East Los Angeles College - TT - 0604
SCOUTO3 BALLOON/SONDES CAMPAIGN NIAMEY 26 JULY 26 AUGUST 2006J. P. Pommereau, A. Garnier and SCOUTO3 teamObjectives: Convective transport across tropopause associated to MCS Chemistry, dehydration, microphysics in TTLBalloonsFlight permissio
Toledo - UNI - 320
UNI320Y: Canadian Questions: Issues and DebatesWeek 9: Recognizing and Negotiating Citizenship Professor Emily Gilbert http:/individual.utoronto.ca/emilygilbert/ Recognizing and Negotiating Citizenship I.Limits to Multiculturalism Recogn
Toledo - UNI - 320
UNI320Y: Canadian Questions: Issues and DebatesWeek 2: Racializing CitizenshipProfessor Emily Gilbert http:/individual.utoronto.ca/emilygilbert/ Racializing CitizenshipI.Racism, Imperialism and Citizenship Citizenship as a Technology of
East Los Angeles College - LIB - 141
<!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Transitional/EN" "http:/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Cranfield CERES: Log In</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <script id
Toledo - UNI - 320
UNI320Y: Canadian Questions: Issues and DebatesWeek 4: Educating CitizensProfessor Emily Gilbert http:/individual.utoronto.ca/emilygilbert/ Educating CitizensI.Moral Reform in Early 20th Century Canada Schools, Education and Citizenship
Toledo - ACT - 348
ACT 348H1F, Advanced Life Contingencies, Fall 2008Lecture Section Lecture times, location InstructorL0101 M 3:00 p.m.-5:00 p.m. RW117 W 11:00 a.m.-12:00 p.m. RW117 Dr. Andrei Badescu, SS3105 tel: 416-946-7582 fax: 416-978-5133 badescu@utstat.to
East Los Angeles College - LIB - 1553
<!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Transitional/EN" "http:/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Cranfield CERES: Log In</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <script id
Laurentian - MGT - 3360
Chapter FourThe External Environment Thomson Learning 20044-1Relationship Between Environmental Characteristics and Organizational ActionsEnvironmentComplexity Uncertainty (Information) Stability Environmental SectorsOrganization Respon
Maple Springs - PSYC - 2120
Social Psychology-Lecture 4 Social Motivation Weiner's theory of social conduct Attitudes Tri-componential Separate Entities Attitude ChangeSocial Psychology-Lecture 3: Social Motivation Social Motivation: How we judge others and interact
East Los Angeles College - MUSI - 2923
MUSI2923Week 41MUSI 2923 The psychology of listening and performanceWeek 4: Infant perception and vocalisationModule Leader: Course Website: Aims To introduce you to research on early skills in music perception and vocalisation, and to provi
East Los Angeles College - MUSI - 2912
Case Study 2: Trehub, Bull and Thorpe (1984)MUSI 2912 Musical DevelopmentOverview Introduction: perceptual experiment with infants and children Theoretical background Methodologies Results for Trehub et al (1984) Experiments and observation
Laurentian - CPSC - 200303
Chapter 9: Sample ApplicationsOutline Spreadsheets Databases Numeric and Symbolic Computations Computer NetworksSocial Issues Applications Software Virtual Machine Hardware Algorithmic Foundations 1SpreadsheetsAn electronic
CSU Fullerton - IPC - 144
Lab 11 - IPC144 Introduction to Programming Using C Section _Name _ Student Number _+-+|Weekly Tip: When you are done writing to a file, remember to || close the file. Closing ensures that all data || gets to the devic
East Los Angeles College - GEOG - 5105
GEOG5105 CENSUS ANALYSIS AND GIS PRACTICAL EXERCISE 1 FINDING INFORMATION ON ACADEMIC AND OFFICIAL CENSUS WEB SITES Name: _ The purpose of this exercise is to introduce you to two important websites that provide access to the Area Statistics from the
East Los Angeles College - GEOG - 5105
Geog5105 Unit 9 Worksheet: Geographical Conversion IssuesName: _ Make notes for future reference. Email the completed worksheet to Prof Rees (p.rees@geog.leeds.ac.uk) and Christine Macdonald (c.macdonald@geog.leeds.ac.uk). Co
East Los Angeles College - GEOG - 5105
GEOG5105M Census Analysis and GIS Unit 2 The Census Data System: Procedures, Outputs and GeographyThe aims of this unit are to: provide an outline of the processes that are needed to produce census outputs describe the nature of those outputs d
Laurentian - MGT - 200603
Lecture Presentation Softwareto accompanyInvestment Analysis and Portfolio ManagementEighth Edition byFrank K. Reilly & Keith C. BrownChapter 6Chapter 6 Efficient Capital MarketsQuestions to be answered: What is does it mean to say tha
East Los Angeles College - ACOM - 1900
AUTHOR(S)YEARTITLEJOURNAL/CONFERENCEAccot;Zhai2001Scale effects in steering law tasksProc. ACM CHIAcredolo1977Developmental Changes in the Ability to Coordinate Perspectives of a Large-Scale SpaceDevelopmental PsychologyAginsky;Harris;Ren
CSU Fullerton - BTP - 200
42. A. Teaching at Seneca is a union job, with union imposed limits on the amount of work a teacher may perform. The hours a teacher supposedly puts in are tallied to make sure that the limits are not exceeded. Code a
Sveriges lantbruksuniversitet - ECON - 19963
PROFILE OF STUDENTS IN SFU COURSES COURSE: ECON 301-5 ALL SECTIONS LOCATION: SFU TITLE: MICROECONOMIC THEORY SECTION TYPE: LEC SEMESTER: 1996-3 ENROL: 131
Allan Hancock College - ACOLS - 164
Cavity Enhanced Frequency Modulation SpectroscopyNicola van Leeuwen and Andrew WilsonUniversity of Otago Physics Department, PO Box 56, Dunedin, New Zealand Ph. +64 3 479 7789, Fax. +64 3 479 0964, Email. nicolav@physics.otago.ac.nzFrequency modu
Sveriges lantbruksuniversitet - HUM - 20011
Sheet1 PROFILE OF STUDENTS IN SFU COURSES COURSE: HUM 350-4 E01 TITLE: GREAT FIGURES SEMESTER: 2001-1 LOCATION: DOW SECTION TYPE: SEM ENROL: 17= PROGRAM OF STUDENT (Top 5 programs reported in each category Programs with < 3 students not shown separ
East Los Angeles College - LIB - 1457
<!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Transitional/EN" "http:/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Cranfield CERES: Log In</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <script id
CSU Fullerton - SYS - 466
Domain Class Diagram:PurchaseOrder poNum poStatus 1 contains 1.npurchases product from 0.n 1Vendor vendorNum companyName companyPhone vendorEmail 1 sells 0.n Product prodNum qtyOnHandPOItem records purchase of qtyOrdered qtyRecvd 0.n 1Quest
CSU Fullerton - T - 3074
Linux version 2.6.17 (root@Knoppix) (gcc version 4.0.4 20060507 (prerelease) (Debian 4.0.3-3) #4 SMP PREEMPT Wed May 10 13:53:45 CEST 2006BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 000000000009fc00 (usable) BIOS-e820: 0000000000
CSU Fullerton - OPS - 234
AS/400 Operations Navigator It is now possible for a user to execute AS/400 commands without having to learn Command Language syntax. Also, for those users who are aware of CL but feel more productive by pointing and clicking with a graphical interfa
CSU Fullerton - CTC - 203
Career Assessment1 It is logical that, if you do what you like to do and if enjoy the tasks involves, then you will be more energized and perform better. A first step is to take a good hard look at yourself, where you are, what's important to yo
CSU Fullerton - CTC - 206
Section 2 - PreparationPart 1- Self Assessment Part 2- Labour MarketPart 3 - Job Ad & ResumePart 4 - Cover LetterSection 2 - PreparationPart 1 Self AssessmentYou will: Write self assessment test & review results Relate skills to job area
Allan Hancock College - DAB - 2008183
1 Duties Amendment Bill 2008_Duties Amendment Bill 2008Explanatory NotesGeneral OutlinePolicy Objective of the BillsThe Bill seeks to amend the Duties Act 2001 to remove duties pai
Sveriges lantbruksuniversitet - ARTS - 20033
Sheet1 PROFILE OF STUDENTS IN SFU COURSES COURSE: WS 405-4 D01 LOCATION: SFU TITLE: THEORETICAL ISSUES SECTION TYPE: SEM SEMESTER: 2003-3 ENROL: 20 = PROGRAM OF STUDENT (Top 5 programs reported in each category Programs with < 3 students not shown se
Sveriges lantbruksuniversitet - APSC - 19972
PROFILE OF STUDENTS IN SFU COURSES COURSE: CMNS 421-4 D01 LOCATION: SFU TITLE: ISSUES SEMINAR SECTION TYPE: SEM SEMESTER: 1997-2 ENROL: 18
East Los Angeles College - GEOG - 5081
Geog5081M GIS and Regional Planning Unit 7 NotesMobile GISThe aims of this unit are to: introduce mobile technologies and global positioning provide two case studies of mobile GIS that are relevant to planning.On completion of this unit you sh
East Los Angeles College - GEOG - 5195
Geog5191M Geodemographics and Database Marketing Unit 6 Notes Advanced Database Marketing TechniquesThe aims of this unit are to introduce you to the following techniques: data mining intelligent geodemographic targeting microsimulationOn compl
Toledo - JGP - 438
The textbook in general goes into more depth on each topic than we have in class, so it is difficult to identify exactly which parts of the text you have to know by section number alone. Here is my attempt. Section numbers are for the 2nd Edition of
Air Force Academy - STA - 575
April 8, 1997Mr. William WatsonEditorial Page EditorThe Ottawa Citizen1101 Baxter Road,Box 5020,Ottawa, OntarioK2C 3M4Dear Bill:Re:Catherine Ford Gun Control Column - April 7, 1997In her column
Allan Hancock College - TAR - 20091
EXPLANATORY STATEMENT Select Legislative Instrument 2009 No. 31Subject - Telecommunications Act 1997 Telecommunications Amendment Regulations 2009 (No. 1)Subsection 594(1) of the Telecommunications Act
Toledo - CSC - 263
=CSC 263H Addendum to Lecture Outline for Week 10 Winter 2004=-Disjoint Sets--Remember that in each implementation considered below, we have directaccess to each element from an outside source, and a way to keep track ofany r
Toledo - CSC - 263
CSC 263H - Winter 2004: REQUEST FOR REMARK = Student number: _ Lecture section: _ Last name: _ Instructor: _ First name: _ Name of TA: _ Email address: _ Tutorial
Toledo - CSC - 263
=CSC 263H Tutorial Outline for Week 3 Winter 2004=-Binary Search Trees [section 3.1]-You've all seen binary search trees in CSC148H/A58H before, but let'sreview their definition and how to perform SEARCH, INSERT,
Toledo - CSC - 263
=CSC 263H Lecture Summary for Week 1 Winter 2004=-Course organization-See course information sheet.-Data Structures-An "Abstract Data Type" (ADT) is a set of objects together with a set ofoperations that can
Toledo - CSC - 263
=CSC 263H Lecture Outline for Week 8 Winter 2004=[Q: denotes a question that you should think about and that will be answered during lecture. ]-Incremental Hashing->Note that this material was originally in
Toledo - CS - 180
CSC 180Notes for Tutorial #11Monday 25 November Wednesday 27 November SUMMARY OF THE TOPICS 1. Questions about Assignment Four. 2. Dynamic memory allocation 1. Questions about Assignment Four. =Assignment Four has been posted. P
Allan Hancock College - NBTSAB - 2001457
_ NEW BUSINESS TAX SYSTEM (CAPITAL ALLOWANCES) BILL 2001 1998-1999-2000-2001 THE PARLIAMENT OF THE COMMONWEALTH OF AUSTRALIA HOUSE OF REPRESENTATIVES NEW BUS
Air Force Academy - EE - 823
Assignment 2Chapter 5Third Edition ( 2001 McGraw-Hill)Chapter 55.24 Schottky junctiona. Consider a Schottky junction diode between Au and n-Si, doped with 1016 donors cm-3. The crosssectional area is 1 mm2. Given the work function of Au as 5.