Homework 9: due Monday, 27 October, 2008

Similar documents
15-451/651: Design & Analysis of Algorithms January 22, 2019 Lecture #3: Amortized Analysis last changed: January 18, 2019

The Hiring Problem. Informationsteknologi. Institutionen för informationsteknologi

Understanding Annuities. Some Algebraic Terminology.

Elton, Gruber, Brown, and Goetzmann. Modern Portfolio Theory and Investment Analysis, 7th Edition. Solutions to Text Problems: Chapter 9

Finance 402: Problem Set 1 Solutions

Survey of Math: Chapter 22: Consumer Finance Borrowing Page 1

Generation of Well-Formed Parenthesis Strings in Constant Worst-Case Time

332 Mathematical Induction Solutions for Chapter 14. for every positive integer n. Proof. We will prove this with mathematical induction.

Parallel Prefix addition

Random Variables. 8.1 What is a Random Variable? Announcements: Chapter 8

Financial mathematics

TCOM501 Networking: Theory & Fundamentals Final Examination Professor Yannis A. Korilis April 26, 2002

Elton, Gruber, Brown, and Goetzmann. Modern Portfolio Theory and Investment Analysis, 7th Edition. Solutions to Text Problems: Chapter 16

Final Examination MATH NOTE TO PRINTER

YORK UNIVERSITY Faculty of Science Department of Mathematics and Statistics MATH A Test #2 November 03, 2014

Finite Math - Fall Section Future Value of an Annuity; Sinking Funds

Measures of Spread IQR and Deviation. For exam X, calculate the mean, median and mode. For exam Y, calculate the mean, median and mode.

COS 511: Theoretical Machine Learning. Lecturer: Rob Schapire Lecture #21 Scribe: Lawrence Diao April 23, 2013

Elton, Gruber, Brown and Goetzmann. Modern Portfolio Theory and Investment Analysis, 7th Edition. Solutions to Text Problems: Chapter 4

Linear Combinations of Random Variables and Sampling (100 points)

Hewlett Packard 10BII Calculator

Problem Set 6 Finance 1,

Solutions to Odd-Numbered End-of-Chapter Exercises: Chapter 12

Notes on experimental uncertainties and their propagation

FORD MOTOR CREDIT COMPANY SUGGESTED ANSWERS. Richard M. Levich. New York University Stern School of Business. Revised, February 1999

Mathematical Thinking Exam 1 09 October 2017

A Php 5,000 loan is being repaid in 10 yearly payments. If interest is 8% effective, find the annual payment. 1 ( ) 10) 0.

3: Central Limit Theorem, Systematic Errors

MATH 373 Quiz 3 Fall 2017 October 12, 2017

Chapter 3 Student Lecture Notes 3-1

Multifactor Term Structure Models

Survey of Math Test #3 Practice Questions Page 1 of 5

Tests for Two Correlations

Data Mining Linear and Logistic Regression

Standardization. Stan Becker, PhD Bloomberg School of Public Health

SIMPLE FIXED-POINT ITERATION

Lecture Note 2 Time Value of Money

Capability Analysis. Chapter 255. Introduction. Capability Analysis

y\ 1 Target E-2 Extra Practice r i r Date: Name: 1. a) What is the approximate value of d when t = 3? Explain the method you used.

Macroeconomic Theory and Policy

Appendix for Solving Asset Pricing Models when the Price-Dividend Function is Analytic

A DUAL EXTERIOR POINT SIMPLEX TYPE ALGORITHM FOR THE MINIMUM COST NETWORK FLOW PROBLEM

Macroeconomic Theory and Policy

WHAT ARE REGISTERED SHARES?

iii) pay F P 0,T = S 0 e δt when stock has dividend yield δ.

Members not eligible for this option

ECE 586GT: Problem Set 2: Problems and Solutions Uniqueness of Nash equilibria, zero sum games, evolutionary dynamics

2) In the medium-run/long-run, a decrease in the budget deficit will produce:

PhysicsAndMathsTutor.com

Ch Rival Pure private goods (most retail goods) Non-Rival Impure public goods (internet service)

ECO 209Y MACROECONOMIC THEORY AND POLICY LECTURE 8: THE OPEN ECONOMY WITH FIXED EXCHANGE RATES

CS 286r: Matching and Market Design Lecture 2 Combinatorial Markets, Walrasian Equilibrium, Tâtonnement

Major: All Engineering Majors. Authors: Autar Kaw, Jai Paul

Quiz on Deterministic part of course October 22, 2002

Elements of Economic Analysis II Lecture VI: Industry Supply

ISE High Income Index Methodology

OCR Statistics 1 Working with data. Section 2: Measures of location

Applications of Myerson s Lemma

Concepts: simple interest, compound interest, annual percentage yield, compounding continuously, mortgages

4. Greek Letters, Value-at-Risk

Physics 4A. Error Analysis or Experimental Uncertainty. Error

Single-Item Auctions. CS 234r: Markets for Networks and Crowds Lecture 4 Auctions, Mechanisms, and Welfare Maximization

A HEURISTIC SOLUTION OF MULTI-ITEM SINGLE LEVEL CAPACITATED DYNAMIC LOT-SIZING PROBLEM

Scribe: Chris Berlind Date: Feb 1, 2010

Supplementary material for Non-conjugate Variational Message Passing for Multinomial and Binary Regression

Random Variables. b 2.

THIS PAPER SHOULD NOT BE OPENED UNTIL PERMISSION HAS BEEN GIVEN BY THE INVIGILATOR.

IND E 250 Final Exam Solutions June 8, Section A. Multiple choice and simple computation. [5 points each] (Version A)

The Effects of Industrial Structure Change on Economic Growth in China Based on LMDI Decomposition Approach

Mode is the value which occurs most frequency. The mode may not exist, and even if it does, it may not be unique.

Computational Finance

Answers to exercises in Macroeconomics by Nils Gottfries 2013

Future value of an annuity

UNIVERSITY OF VICTORIA Midterm June 6, 2018 Solutions

Members not eligible for this option

Finite Mathematics for Business Economics Life Sciences Social Sciences Barnett Ziegler Byleen Twelfth Edition

ISyE 512 Chapter 9. CUSUM and EWMA Control Charts. Instructor: Prof. Kaibo Liu. Department of Industrial and Systems Engineering UW-Madison

Tests for Two Ordered Categorical Variables

In calculator: PV 4000 I/Y= N=12 PMT=348.13

EXAMINATIONS OF THE HONG KONG STATISTICAL SOCIETY

ISE Cloud Computing Index Methodology

University of Toronto November 9, 2006 ECO 209Y MACROECONOMIC THEORY. Term Test #1 L0101 L0201 L0401 L5101 MW MW 1-2 MW 2-3 W 6-8

University of Toronto November 9, 2006 ECO 209Y MACROECONOMIC THEORY. Term Test #1 L0101 L0201 L0401 L5101 MW MW 1-2 MW 2-3 W 6-8

Number of women 0.15

Price and Quantity Competition Revisited. Abstract

EDC Introduction

OPERATIONS RESEARCH. Game Theory

Consumption Based Asset Pricing

Pivot Points for CQG - Overview

Microeconomics: BSc Year One Extending Choice Theory

/ Computational Genomics. Normalization

Dr. A. Sudhakaraiah* V. Rama Latha E.Gnana Deepika

MATH 373 Quiz 5 Fall 2018 November 20, 2018

Evaluating Performance

Fast Laplacian Solvers by Sparsification

Actuarial Science: Financial Mathematics

Chapter 3 Descriptive Statistics: Numerical Measures Part B

Final Exam. 7. (10 points) Please state whether each of the following statements is true or false. No explanation needed.

An Efficient Heuristic Algorithm for m- Machine No-Wait Flow Shops

Problems to be discussed at the 5 th seminar Suggested solutions

Transcription:

PROBLEM ONE Homework 9: due Monday, 7 October, 008. (Exercses from the book, 6 th edton, 6.6, -3.) Determne the number of dstnct orderngs of the letters gven: (a) GUIDE (b) SCHOOL (c) SALESPERSONS. (Exercses from the book, 6 th edton, 6.6, 4-5) (a) In how many ways can we order the letters of SALESPERSONS so that all four S characters are adacent? (b) In how many ways can we order the letters of SALESPERSONS so that no two S characters are adacent? PROBLEM TWO (Pascal s Trangle) In class, we showed that for any n and k wth k n, we have ( ) n k Recall that ths notaton means ( ) ( ) n k k k If we plug n for k we get ( ) n ( ) + n k and snce ( ) n n! (n )!! n(n ), we get n(n ). Use k 3 to fnd the sum of ( ). k ( ) k + +... + k ( ) +... + ( ) n. k ( ) n + +... + (n ). () + 3 + 6 + 0 +... +. Can you use both formulas () and () to fnd the sum + 4 +... + n? n(n ). ()

3. Gve two arguments (one whch uses factorals and one whch s more heurstc, usng n obects etc.) to show that ( ) ( ) n n k n k PROBLEM THREE (Inserton Sort) In ths problem, you wll nvestgate the nserton sort algorthm. Here s the dea. We start wth a lst let us take as an example the lst A 0,, 4, 0,, EOL. We follow these steps (here we assume the lst has at least one number n t): A We start at the left wth an arrow, whch we wll call. B Next we start a new lst, whch we wll call B, whch conssts of only the lst element to whch ponts: B 0, EOL and we place an arrow, whch we wll call, at the begnnng of ths lst. 0 EOL C Move to the rght by one. If s at EOL, then qut. D Insert the element to whch ponts nto the lst B. To do ths, follow these steps: a Move to the rght untl we reach ether (a) the character EOL or (b) an element whch s greater than that to whch ponts (ths s the number n our case). Notce that we do not need to move n our case. b Insert the element drectly before the place ponted to by :

0 EOL c Put back at the begnnng of the lst B. 0 EOL E Go to step C. I wll contnue wth the algorthm. When we return to step 3, we move to the rght: and we nsert ths element n the lst B. Snce ponts to and ths s less than or equal to the number to whch ponts (the number 4), we move to the rght. 0 EOL Snce the number to whch ponts s greater than 4, we nsert 4 drectly before t: 4 0 EOL and return to the begnnng: 4 0 EOL We now return to step 3 and move to the rght: 3

and nsert ths element nto the lst B: returnng to the begnnng: Move to the rght: and nsert ths number nto B. To do ths, move to the rght untl we encounter a number whch s greater than the one to whch ponts: Place the number 0 4 0 EOL and return to the front. 4

0 4 0 EOL Lastly, move to the rght: Snce t ponts to EOL, we qut. The lst B s a sorted verson of A. Exercses for problem three:. Trace through ths algorthm, showng lsts wth arrows at each step (as I dd). Use the ntal data, 4,, 0, 0, EOL.. Here s some pseudocode whch should perform the nserton sort. It assumes that the lst A has sze at least. lne code 3 create the lst B wth two characters: A() and EOL 4 whle(a() EOL) { 5 whle(a() B() and B() EOL) { 6 + } 7 place A() drectly before spot n lst B 8 9 + } 0 Return B Trace through ths algorthm (show the status of each of the varables at each change) for the ntal data A, 4,, 0, 0, EOL. Each tme a varable does not change, you may wrte a dash ( ) for that varable n the tracng table. I have started you off (the frst lne s before anythng happens):,4,,0,0,eol?????,eol? 5

3. Gve a lst A wth 3 elements whch gves the worst-case number of lnes executed. How many lnes s ths? 4. Gve a lst B wth 3 elements whch gves the best-case number of lnes executed. How many lnes s ths? 5. For a lst of n elements, what s the worst-case number of lnes executed? What s the best-case number of lnes executed? How do these numbers compare to those we found n class for the bubble sort? Are there cases n whch the nserton sort s better? Are there cases n whch t s worse? 6