HKOI 2012 (Junior) Q4 - Penicillin Gary Wong For any question, please ask via MSN:

Slides:



Advertisements
Similar presentations
Honors Geometry Section 4.6 (1) Conditions for Special Quadrilaterals
Advertisements

Sections 5.1 & 5.2 Inequalities in Two Variables
1 Sections 5.1 & 5.2 Inequalities in Two Variables After today’s lesson, you will be able to graph linear inequalities in two variables. solve systems.
Senior Q2 Shy Tortoise. Sample >>> > > >>
Exhaustion, Branch and Bound Gary Wong If you have any question, please ask via MSN:
Solution for HKOI2010 Junior Q4 By Gary Sham. Problem Description  Given 4 kinds of insects with different number and year of activity.  Find the earliest.
Algebra A1Mr. Brennan Chapter 7 Systems of Linear Equations and Inequalities Review Hamilton-Wenham Regional High SchoolDepartment of Mathematics.
Wed Lab 5 discussion: Discuss aseptic technique and better ways/equipment for sampling. 5 minutes to look at plates Lecture continued Worksheet.
Intersection of Graphs. Example (1) Why we get two answers, when actually the graphs intersect at only one point?
Unit 1b Section 3-3 Solving Systems of Inequalities.
Counting Bacteria.
EXAMPLE 5 Solve a multi-step problem BANNER DIMENSIONS You are making banners to hang during school spirit week. Each banner requires 16.5 square feet.
Optimization sheet (1).
AP Bio Lab 8: Transformation We will start on TUESDAY!
Recombinant DNA.
Growing Microbes L.O: To understand how microorganisms can be safely cultured in a laboratory Answers in your book: Antibiotics do not work on which type.
Introduction to pGLO lab Bacteria Transformation Please take these notes carefully. You do not need to write anything in RED.
Who moved my cheese? Solution for HKOI2008 Junior Q4.
Starter 1. Bacterial colonies often grow very quickly. Sketch a graph to show the population growth curve of a colony of bacteria. 2. Discuss how the reproduction.
Practical Part Microscopic Examination of Microorganisms Experiments Identification of MOs Different Staining Techniques.
HKOI2006 Analysis and Solution Junior Q3 – Sudoku HKOI Training Team
HKOI 2014 Senior Pharmaceutical Company Problem Prepared by : Gary Wong.
Zone of Inhibition Area around antibiotic disk with no bacterial growth. Bacteriocidal – no bacteria living in ZOI. Bacteriostatic – bacteria are not reproducing.
Variables. Todays Lesson  In todays lesson you are going to:  Learn to use variables  Learn to ask for user input  Learn to save the users response.
Point Pattern Analysis Point Patterns fall between the two extremes, highly clustered and highly dispersed. Most tests of point patterns compare the observed.
One Answer, No Answers, or an Infinite Number of Answers.
Storage Centre HKOI 2007 Senior Q1 Kelly Choi. The Problem The COW Team are going to look for treasures in N ruins in a rectangular map. The COW Team.
HKOI 2012 (Senior) Q4 - Gene Mutation Gary Wong For any question, please ask via MSN:
BY GRAPHING Y = 2X + 1 Y = -X + 4 (1,3) IS THE SOLUTION.
1 GEM2505M Frederick H. Willeboordse Taming Chaos.
A.5 B. Solving Quadratic Equations A.5 B. Solving Quadratic Equations Objectives: 1.Factoring 2.Square Root Method 3.Completing the Square 4.Quadratic.
Enumeration (determine the numbers of bacteria in a sample) Direct Measurement of Microbial Growth  Microscopic count - the microbes in a measured volume.
2( ) 8x + 14y = 4 -12x – 14y = x = x = 4 8x + 14y = 4 8(4) + 14y = y = y = -28 ___ ___ y = -2 The solution is (4, -2)
LOOKING FOR THE OVERLAP SOLVING SYSTEMS OF INEQUALITIES.
2IMA20 Algorithms for Geographic Data Spring 2016 Lecture 7: Labeling.
2-4 Deductive Reasoning. Deductive Reasoning …(sometimes called Logical Reasoning) is the process of reasoning logically from given statements or facts.
Unit 1 – Living Cells Topic 2 – Microbes! Types of Microbes
How do you calculate the area of squares and rectangles?
Starter Decide whether the following statements relate to optical methods or dilution plating: Takes a very long time Uses a colorimeter Requires very.
6-3: Solving Equations with variables on both sides of the equal sign
Graph Representation, DFS and BFS
Unit 1 – Living Cells Topic 1 – Cells and DNA Topic 2 – Microbes!
Importance of a random sample: An in-class demonstration
Antibiotic Resistant Bacteria
TARGET DIMENSIONS FOR TABLE 1 COURSE OF FIRE
TYPES OF GRAPHS There are many different graphs that people can use when collecting Data. Line graphs, Scatter plots, Histograms, Box plots, bar graphs.
EXAMPLE 1 Use properties of special quadrilaterals
What is the difference between the following two questions?
CS 1430: Programming in C++.
7.5 Solving Radical Equations
Solving Special Systems
exa.im/stempy16.files - Session 12 Python Camp
7.5 Solving Radical Equations
Exploring Exponential Growth and Decay Models
JavaScript Arrays.
(-3)2 = -32 The first of these means -3 x -3, but the second one, we have to do the index first, so we square the 3, then make it negative.
Random fact There is no escaping them: Your body has 10 times more bacterial cells than human cells.
Here are four triangles. What do all of these triangles have in common
Cubes and cube roots.
Backpropagation.
EE4271 VLSI Design, Fall 2016 VLSI Channel Routing.
All About Shapes! Let’s Go!.
Understanding Fact and Opinion
Midterm Review October 23, 2006 ComS 207: Programming I (in Java)
6.4 Solving Compound Inequalities
7.5 Solving Radical Equations
Counting Shapes.
Given a list of n  8 integers, what is the runtime bound on the optimal algorithm that sorts the first eight? O(1) O(log n) O(n) O(n log n) O(n2)
Data Literacy Graphing and Statisitics
Control Structures.
Presentation transcript:

HKOI 2012 (Junior) Q4 - Penicillin Gary Wong For any question, please ask via MSN:

For your interest (if any) The history in the problem is really true! Penicillin refers to a group of antibiotics Examples: Penicillin G Amoxicillin Ampicillin … Bacteria and viruses are 2 different things

Problem Statement Each of N points (x i, y i ) can “grow” into an “unclean” square with side 2t at time t, with (x i, y i ) as the “centre” A special point P(h, k) can “grow” into a square with side 2ts at time t “Growth” is bounded by a rectangle with dimension P x Q Area covered by square centred at P will be always clean

Problem Statement Find the area of unclean area N.B.: Overlapped area should be counted repeatedly Constraints: 50% N <= 50 P, Q, s, t <= % 1 <= N <= 10,000 1 <= P, Q, s, t <= 100,000 0 <= x i, h <= P 0 <= y i, k <= Q

Statistics Max. score: 100 No. of max: 2 Std dev: Mean: 5.29 Disappointed…

Statistics Disappointed…

Solution – 50% N <= 50 P, Q, s, t <= 100 How about declaring a 2D array to mimic the agar plate? Simulate the growth step by step! Count how many times each cell was covered, clear all sterile part Complexity? Very roughly, O(NPQt) In fact much less than this

Solution – 100% 1 <= N <= 10,000 1 <= P, Q, s, t <= 100,000 O(NPQt) cannot work anymore… Note that Each point is independent from each other, because overlapped areas are counted repeatedly If you know how to do for one point, same for other (N-1) points

Solution – 100% The problem reduces to: Given 2 “growing” squares, find the brown area without covered by green square

Solution – 100% Consider the brown square Top-left corner: (x i – t, y i – t) Bottom-right corner: (x i + t, y i + t)

Solution – 100% But what if it reaches/exceeds boundaries? Actual top-left corner (max(0, x i – t), max(0, y i – t)) Actual bottom-right corner (min(P, x i + t), min(Q, y i + t))

Solution – 100% Similarly, for green square, Top-left corner (max(0, h – st), max(0, k – st)) Bottom-right corner (min(P, h + st), min(Q, k + st))

Solution – 100% Next task: how to find intersection area between the 2 squares?

Solution – 100% Consider the corners of the intersection area! (a1, b1) (c1, d1) (a2, b2) (c2, d2)

Solution – 100% For the intersection area, Top-left corner (max(a1,a2), max(b1,b2)) Bottom-right corner (min(c1,c2), min(d1,d2)) (a1, b1) (c1, d1) (a2, b2) (c2, d2)

Solution – 100% How to detect the case of “no intersection”?

Solution – 100% Area of brown square minus area of intersection Do this for N times Complexity? O(N)

Common mistakes Areas were not counted repeatedly Cannot even pass the sample input in the problem Misunderstand that penicillin can kill only one layer of bacteria Forgot to use 64-bit integer type to store the answer

Any question?