CSE 331, Spring 2000

Similar documents

Accounting Assessment Report

1/16/2019. Self Leadership Self Awareness and Leadership. Leader Traits and self-awareness Role management exercise Leadership Philosophy

The Mental Capacity Act 2005; a short guide for the carers and relatives of those who may need support. Ian Burgess MCA Lead 13 February 2017

Success Criteria: Extend your thinking:

A foot x-ray series is required only if there is pain in the midfoot zone and any one of the following:

1/19/2018. Writing Proficiency: Memos Self Leadership Self Awareness and Leadership

Assessment Field Activity Collaborative Assessment, Planning, and Support: Safety and Risk in Teams

Risk factors in health and disease

Action plan: serialisation of Nordic packages focus on Product Codes

National Imaging Associates, Inc. (NIA) Frequently Asked Questions (FAQ s) For PA Health & Wellness Providers

Creating and Linking Charge Objects

Bariatric Surgery FAQs for Employees in the GRMC Group Health Plan

Year 10 Food Technology. Assessment Task 1: Foods for Special Needs. Name: Teacher:

Meaningful Use Roadmap Stage Edition Eligible Hospitals

Part 1. Saturated and Branched-Chain Fatty Acids

SPORTS PSYCHOLOGY PERFORMANCE TECHNIQUES

Humanities and Social Sciences Division. o Work Experience, General. o Open Entry/Exit. Distance (Hybrid Online) for online supported courses

EXPLORING THE PROCESS OF ASSESSMENT AND OTHER RELATED CONCEPTS

A Phase I Study of CEP-701 in Patients with Refractory Neuroblastoma NANT (01-03) A New Approaches to Neuroblastoma Therapy (NANT) treatment protocol.

Module 6: Goal Setting

The Interface Between Theory of Mind and Language Impairment

Record of Revisions to Patient Tracking Spreadsheet Template

GSB of EDA Meeting Minutes

Benefits for Anesthesia Services for the CSHCN Services Program to Change Effective for dates of service on or after July 1, 2008, benefit criteria

Commun. Theor. Phys. (Beijing, China) 38 (2002) pp. 555{560 c International Academic Publishers Vol. 38, No. 5, November 15, 2002 Capability Analysis

Breast Cancer Awareness Month 2018 Key Messages (as of June 6, 2018)

Podcast Transcript Title: Common Miscoding of LARC Services Impacting Revenue Speaker Name: Ann Finn Duration: 00:16:10

NATIONAL SENIOR CERTIFICATE GRADE 12

2017 PEPFAR Data and Systems Applied Learning Summit Day 2: MER Analytics/Available Visualizations, Clinical Cascade Breakout Session TB/HIV EXERCISE

Adult Preventive Care Guidelines

CONSENT FOR KYBELLA INJECTABLE FAT REDUCTION

EMC believes the information in this publication is accurate as of its publication date. The information is subject to change without notice.

William Paterson University College of Science and Health DEPARTMENT OF PUBLIC HEALTH HealthyU Syllabus

Dental Benefits. Under the TeamstersCare Plan, you and your eligible dependents have three basic options when you need dental care.

Career Confidence. by Kevin Gaw

Interpretation. Historical enquiry religious diversity

Advance Care Planning Collaboration 101

Pain relief after surgery

FOLLOW-UP IN-DEPTH INTERVIEW GUIDELINES

National Imaging Associates, Inc. (NIA) Frequently Asked Questions (FAQs) For Louisiana Healthcare Connections Providers

National Imaging Associates, Inc. (NIA) Frequently Asked Questions (FAQs) For Managed Health Services (MHS)

23/11/2015. Introduction & Aims. Methods. Methods. Survey response. Patient Survey (baseline)

Strategies for Avoiding Plagiarism Part Two: Paraphrasing

NIA Magellan 1 Spine Care Program Interventional Pain Management Frequently Asked Questions (FAQs) For Medicare Advantage HMO and PPO

ANXIETY SYMPTOMS INTERVENTION SESSION HANDOUTS. Introduction to Fighting Fear by Facing Fear. Making a Fears and Worries List

Implementation of G6PD testing and radical cure in P. vivax endemic countries: considerations

Rate Lock Policy. Contents

How to become an AME Online

Using Causal Inference To Make Sense of Messy Data

(Please text me on once you have submitted your request online and the cell number you used)

Extended G/L Segment Codes

ITEC Level 3 Diploma in Complementary Therapies. Assignment Guidance Form. Unit 384 Principles and Practice of Complementary Therapies

ADULT CHILDREN OF ALCOHOLICS Characteristics. Adult Children of Alcoholics

Frequently Asked Questions: IS RT-Q-PCR Testing

MEDICATION GUIDE Pioglitazone and Metformin Hydrochloride (PYE o GLI ta zone and met FOR min HYE-droe- KLOR-ide)Tablets, USP

National Programme on Technology Enhanced Learning (Phase II)

ICT4LIFE. Final Conference. ICT4Life field work - tailored solutions in diverse regional context Ariane Girault, E-Seniors Association

WHAT IS HEAD AND NECK CANCER FACT SHEET

2017 Optum, Inc. All rights reserved BH1124_112017

Hearing Service Fees and Fee Codes Effective: January 01, 2019

Bedfordshire and Hertfordshire DRAFT Priorities forum statement Number: Subject: Prostatism Date of decision: January 2010 Date of review:

Reference: Patient A. Brenda WXXXXX Date of Birth: 4/15/57

EXECUTIVE SUMMARY INNOVATION IS THE KEY TO CHANGING THE PARADIGM FOR THE TREATMENT OF PAIN AND ADDICTION TO CREATE AN AMERICA FREE OF OPIOID ADDICTION

Students should select ONE novel from the list below and annotate according to the Annotation Rubric.

Dear Student, IMMUNIZATION RECORD INSTRUCTIONS

Annual Principal Investigator Worksheet About Local Context

Understanding Blood Counts

BRCA1 and BRCA2 Mutations

MEDICATION GUIDE Pioglitazone (pie-oh-glit-ah-zohn) and Metformin (met-fore-min) Hydrochloride Tablets USP

Q 5: Is relaxation training better (more effective than/as safe as) than treatment as usual in adults with depressive episode/disorder?

Wound Care Equipment and Supply Benefits to Change for Texas Medicaid July 1, 2018

DATA RELEASE: UPDATED PRELIMINARY ANALYSIS ON 2016 HEALTH & LIFESTYLE SURVEY ELECTRONIC CIGARETTE QUESTIONS

Sensory Loss. Unit reference number: M/616/7368 Level: 3. Credit value: 3 Guided learning hours: 21. Unit summary

P02-03 CALA Program Description Proficiency Testing Policy for Accreditation Revision 1.9 July 26, 2017

Lower Extremity Amputation (LEA) Considerations / Issues

Lee County Florida Income Guideline Chart

Name: Anchana Ganesh Age: 21 years Home Town: Chennai, Tamil Nadu Degree: B.Com. Profilometer Score. Profilometer Graph

A MORE HUMAN APPROACH TO INNOVATION RESEARCH 2

Cognitive Processing for Interpreters. Humanities and Social Sciences Division. o Work Experience, General. o Open Entry/Exit

Screening Questions to Ask Patients

University College Hospital. Pump school Starting on an insulin pump. Children and Young People s Diabetes Service

o Work Experience, General o Open Entry/Exit Distance (Hybrid Online) for online supported courses

Structured Assessment using Multiple Patient. Scenarios (StAMPS) Exam Information

Approaches to the Care and Support of Individuals with Dementia

GUIDANCE DOCUMENT FOR ENROLLING SUBJECTS WHO DO NOT SPEAK ENGLISH

Immunisation and Disease Prevention Policy

A pre-conference should include the following: an introduction, a discussion based on the review of lesson materials, and a summary of next steps.

Glaucoma Interviews: Due Tuesday, May 22 nd

Campus Climate Survey

Initial Postoperative Knee Care Patella or Quadriceps Tendon Repairs: - Videos are available on Dr. Witty s website: drjeffreywitty.

Completing the NPA online Patient Safety Incident Report form: 2016

Physical Fitness for the Physically Limited. o Work Experience, General. o Open Entry/Exit. Distance (Hybrid Online) for online supported courses

Independent Charitable Patient Assistance Program (IPAP) Code of Ethics

Session78-P.doc College Adjustment And Sense Of Belonging Of First-Year Students: A Comparison Of Learning Community And Traditional Students

FOUNDATIONS OF DECISION-MAKING...

NATIONAL WEEK OF DEAF PEOPLE 19 th 25 th October 2013 EVENT QUIDELINES. Equality for Deaf People

To learn the importance of cardiovascular exercise, to study the hamstring muscle and to practice basic martial arts kicks.

Computer vision quality assessment of barley kernels

Properties detailed info There are a few properties in Make Barcode to set for the output of your choice.

Transcription:

YOUR NAME: SECTION NUMBER: CSE 331, Spring 2000 Class Exercise 15 Algrithm Design Techniques-Greedy Algrithms March 13, 2000 Fllwing are five f the cmmn types f algrithms. Fr many prblems it is quite likely that at least ne f these methds will wrk. 1. Greedy Algrithms 2. Divide and Cnquer 3. Dynamic prgramming 4. Randmized algrithms 5. Backtracking Algrithms Greedy Algrithms: A greedy algrithm btains a slutin t a prblem by making a sequence f chices. Fr each decisin pint in the algrithm, the chice that seems best at the mment is chsen. That is, it makes lcally ptimal chice in the hpe that this chice will lead t the glbally ptimal slutin. Hwever, this heuristic strategy des nt always yield ptimal slutins. Thus greedy algrithms may nt always lead t the ptimal slutins but fr many prblems they d. Fr many f these prblems where greedy algrithms d nt yield ptimal slutins, they may still be useful because the perfrmance f the greedy algrithm may be much better than the algrithm giving ptimal slutins. An example f a greedy algrithm that leads t an ptimal slutin is A Simple Scheduling Prblem given n page 342 f the text bk. Here, given a set f jbs and their lengths f running time, find a schedule that will give the minimum average wait time. The greedy algrithm fr this prblem is t select the next jb fr running that has the shrtest running time. When this jb is cmpleted select the next jb frm the remaining jbs with the 1

shrtest running time, and s n. Nte that we are chsing the best jb as we g (i.e. selecting the best jb at the mment we schedule the next jb) withut wrrying abut whether it will lead t the glbal ptimal slutin r nt. Anther example f a greedy algrithm is the huffman cding fr file cmpressin Nrmally fixed length binary cdes (8 bits) are used t represent characters such as alphabatic and numeric characters. It is mre efficient, hwever, t build cdes fr a particular file, fr example, fr cmpressing the data in the file based n the frequencies f use f different characters inthe file. Huffman cde is such a cde and is a variable length cde with mre frequently used characters having smaller cde than the less frequently used characters in the file. If character cdes are fixed lengths then the end f the characters in the string can be determined easily by cunting 8 bits (fr 8-bit cde) per character. 1. Give the fixed minimum length cdes (cde wrds) fr the alphabet: {a,b,c.d}. Give the encding f the string aabcd. 2. Fr a lrge file where certain characters appear mre ften than thers, it is mre efficient t use variable length cdes. One prblem in using variable length cdes is t find a methd fr determining the bundaries f the cde wrds in a string. If A is 11, B is 00, C is 010, D is 10 and R is 011, what is the character stringfrthefllwing(ntethatgingfrmlefttrightintheencded string, substrings will uniquely identify the cdes): 11000111101011 3. Assume that the cdes fr A, B, C, D are as fllws: A is 0, B is 1 and C is 10 Can yu identify the bundaries f the cde wrds uniquely in the string 001 and 0010? 4. What relatinships have t be satisfied between the cdes s that cdes can be uniquely identified in the string? 2

Prefix cdes are cdes where n cde wrd is a prefix f sme ther cde wrd. 5. If we have a binary tree and the leaf ndes represent the characters and branches are labeled 0 s and 1 s, then the paths t the leaf ndes represent variable length cdes. These cdes d nt have any prefixes that are cdes f anther character, why? Give the variable length cdes fr each f the characters fr tw binary trees belw. 0 1 0 1 0 1 B D A 0 / 0 1 C R 6. D the cdes satisfy prefix prperty? Are they ptimal (i.e., can yu reduce the sizes f sme f the cdes)? 7. Thus, the tree has t be a full tree (i.e., all ndes in the tree except the leaves has t have tw children) fr the cdes t be ptimal. Why that is necessary? 8. A R B 3

D C Is the abve tree a full tree? Which leaf ndes in the tree shuld represent mre frequent characters and why? Huffman Cding 9. Huffman cdes are prefix cdes created using full trees. Here frequencies f the characters in the file are used t generate the cdes. Characters with high frequencies f ccurrences in the file have smaller cdes while thse with small frequencies f ccurrences have larger cdes. Huffman cde guarantees ptimal file cmpressin (i.e., fr all pssible sizes f cde wrds, huffman cdes give the largest file cmpressin). Huffman algrithm that generates the huffman cdes is based n greedy apprach. Initially, each character represents a ne nde subtree with the frequencies f the characters labeling the ndes. In each step tw subtrees with smallest frequencies are merged t create a larger tree. This is discussed n pages 348-350 f the text bk. Anexamplef hwthealgrithmwrksisattached. 10. Huffman algrithm is a gd example f the use f binary tree and the pririty queue. Draw the heap (an implementatin f pririty queue) fr the fllwing frequencies: A:50, B:40, C:5, D:3, E:1 11. Cnstruct the huffman tree fr the abve frequencies. 12. Hw is the heap used in cnstructing the Huffman tree? 13. The algrithm uses BuildHeap, Extract Min, and Insert. Indicate the number f times these peratins are used t create the huffman tree if there are C characters in the alphabet. Optimallity f huffman cde 14. Why des the tree has t be a full tree? 4

15. Is the ptimality changed if we swap tw characters at the same depth f the tree? 16. Hw can we imprve the cst if there is a deeper nde with higher frequency and a higher level nde with smaller frequency? 17. Can we say that the tw least frequent symbls are siblings at the deepest level? 5