Top Banner
Forensics and CS Philip Chan
104

Forensics and CS Philip Chan. CSI: Crime Scene Investigation high tech forensics tools DNA profiling Use.

Jan 01, 2016

Download

Documents

Eugenia Summers
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Forensics and CS

Philip Chan

Page 2: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

CSI: Crime Scene Investigation

www.cbs.com/shows/csi/

high tech forensics tools

DNA profiling Use as evidence in court cases

Page 3: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

DNA

Deoxyribonucleic Acid

Each person is unique in DNA (except for twins)

DNA samples can be collected at crime scenes

About .1% of human DNA varies from person to person

Page 4: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Forensics Analysis

Focus on loci (locations) of the DNA Values at the those loci (DNA profile) are

recorded for comparing DNA samples.

Page 5: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Forensics Analysis

Focus on loci (locations) of the DNA Values at the those loci (DNA profile) are

recorded for comparing DNA samples. Two DNA profiles from the same person have

matching values at all loci.

Page 6: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Forensics Analysis

Focus on loci (locations) of the DNA Values at the those loci (DNA profile) are

recorded for comparing DNA samples. Two DNA profiles from the same person have

matching values at all loci. More or fewer loci are more accurate in

identification? Tradeoffs?

Page 7: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Forensics Analysis

Focus on loci (locations) of the DNA Values at the those loci (DNA profile) are

recorded for comparing DNA samples. Two DNA profiles from the same person have

matching values at all loci. More or fewer loci are more accurate in

identification? Tradeoffs?

FBI uses 13 core loci http://www.cstl.nist.gov/biotech/strbase/fbicore.htm

Page 8: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

We do not want to wrongly accuse someone How can we find out how likely another

person has the same DNA profile?

Page 9: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

We do not want to wrongly accuse someone How can we find out how likely another

person has the same DNA profile?

How many people are in the world?

Page 10: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

We do not want to wrongly accuse someone How can we find out how likely another

person has the same DNA profile?

How many people are in the world?

How low the probability needs to be so that a DNA profile is unique in the world?

Page 11: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

We do not want to wrongly accuse someone How can we find out how likely another

person has the same DNA profile?

How many people are in the world?

How low the probability needs to be so that a DNA profile is unique in the world?

Low probability doesn’t mean impossible Just very unlikely

Page 12: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Review of basic probability

Joint probability of two independent events P(A,B) = ?

Page 13: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Review of basic probability

Joint probability of two independent events P(A,B) = P(A) * P(B)

Independent events mean knowing one event does not provide information about the other events

P(Die1=1, Die2=1) = P(Die1=1) * P(Die2=1) = 1/6 * 1/6 = 1/36.

Page 14: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Enumerating the events

1 2 3 4 5 6

1 1,1 1,2 …

2

3

4

5

6

36 events, each is equally likely, so 1/36

Page 15: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Joint probability

P(Die1=even, Die2=6) = ?

Page 16: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Joint probability

P(Die1=even, Die2=6) = 1/2 * 1/6 = 1/12

P(Die1=1, Die2=5, Die3=4) = ?

Page 17: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Joint probability

P(Die1=even, Die2=6) = 1/2 * 1/6 = 1/12

P(Die1=1, Die2=5, Die3=4) = (1/6)3 = 1/216

Page 18: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

DNA profile probability

How to estimate?

Page 19: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

DNA profile probability

How to estimate?

Assuming loci are independent P(Locus1=value1, Locus2=value2, ...) = P(Locus1=value1) * P(Locus2=value2) * ...

Page 20: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

DNA profile probability

How to estimate?

Assuming loci are independent P(Locus1=value1, Locus2=value2, ...) = P(Locus1=value1) * P(Locus2=value2) * ...

How to estimate P(Locus1=value1)?

Page 21: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

DNA profile probability

How to estimate?

Assuming loci are independent P(Locus1=value1, Locus2=value2, ...) = P(Locus1=value1) * P(Locus2=value2) * ...

How to estimate P(Locus1=value1)? a random sample of size N from the

population and find out how many people out of N have

value1 at Locus1

Page 22: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Database of DNA profiles

Id Locus1 Locus2 Locus3 … Locus13

A5212

A6921

Page 23: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Problem Formulation

Given A sample profile (e.g. collected from the crime

scene) A database of known profiles

Find The probability of the sample profile if it

matches a known profile in the database

Page 24: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Breaking Down the Problem

Find The probability of the sample profile if it matches a

known profile in the database

What are the subproblems?

Page 25: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Breaking Down the Problem

Find The probability of the sample profile if it matches a

known profile in the database

What are the subproblems? Subproblem 1

Find whether the sample profile matches 1a: ? 1b: ?

Subproblem 2 Calculate the probability of the profile

Page 26: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Breaking Down the Problem

Find The probability of the sample profile if it matches a

known profile in the database

What are the subproblems? Subproblem 1

Find whether the sample profile matches 1a: check entries in the database

1b: check loci in each entry

Subproblem 2 Calculate the probability of the profile

Page 27: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Simpler Problem for 1a (very common) Given

an array of integers (e.g. student IDs) an integer (e.g. an ID)

Find whether the integer is in the array

(e.g. whether you can enter your dorm)

int[] directory; // student id’sint id; // to be found

Page 28: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Linear Search

Page 29: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Linear/Sequential Search

Check one by one Stop if you find it Stop if you run out of items to check

Not found

Page 30: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of Checks (speed of algorithm) Consider N items in the array

Best-case scenario When does it occur? How many checks?

Page 31: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of Checks (speed of algorithm) Consider N items in the array

Best-case scenario When does it occur? How many checks? First item;1 check

Worst-case scenario When does it occur? How many checks?

Page 32: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of Checks (speed of algorithm) Consider N items in the array

Best-case scenario When does it occur? How many checks? First item;1 check

Worst-case scenario When does it occur? How many checks? Last item or not there; N checks

Average-case scenario Average of all cases (1 + 2 + … + N) / N = [N(N+1)/2] / N = (N+1)/2

Page 33: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Matching DNA profiles

Each profile has 13 loci Do we always need to check all 13 loci to

decide if a match occurs or not?

Page 34: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Can we do better? Faster algorithm? What if the array is sorted, items are in an

order E.g. a phone book

Page 35: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Binary Search

Page 36: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Binary Search

1. Check the item at midpoint

2. If found, done

3. Otherwise, eliminate half and repeat 1 and 2

Page 37: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Breaking down the problem

While more items and not found in the mid point What are the two subproblems?

Page 38: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Breaking down the problem

While more items and not found in the mid point Eliminate half of the items Determine the mid point

Page 39: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of checks (Speed of algorithm) Best-case scenario

When does it occur? How many checks?

Page 40: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of checks (Speed of algorithm) Best-case scenario

When does it occur? How many checks? In the middle; 1 check

Page 41: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of checks (Speed of algorithm) Best-case scenario

When does it occur? How many checks? In the middle; 1 check

Worst-case scenario When does it occur? How many checks?

Page 42: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of checks (Speed of algorithm) Best-case scenario

When does it occur? How many checks? In the middle; 1 check

Worst-case scenario When does it occur? How many checks? Dividing into two halves, half has only one

item ? checks

Page 43: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of checks (Speed of algorithm)T(1) = 1

T(N) = T(N/2) + 1

Page 44: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of checks (Speed of algorithm)T(1) = 1

T(N) = T(N/2) + 1

Page 45: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of checks (Speed of algorithm)T(1) = 1

T(N) = T(N/2) + 1

= [ T(N/4) + 1 ] + 1

Page 46: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of checks (Speed of algorithm)T(1) = 1

T(N) = T(N/2) + 1

= [ T(N/4) + 1 ] + 1

Page 47: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of checks (Speed of algorithm)T(1) = 1

T(N) = T(N/2) + 1

= [ T(N/4) + 1 ] + 1

= [ [ T(N/8) + 1] + 1] + 1

Page 48: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of checks (Speed of algorithm)T(1) = 1

T(N) = T(N/2) + 1

= [ T(N/4) + 1 ] + 1

= [ [ T(N/8) + 1] + 1] + 1

= … any pattern?

Page 49: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of checks (Speed of algorithm)T(1) = 1

T(N) = T(N/2) + 1

= [ T(N/4) + 1 ] + 1

= [ [ T(N/8) + 1] + 1] + 1

= …

= T(N/2k) + k

Page 50: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of checks (Speed of algorithm)T(1) = 1

T(N) = T(N/2) + 1

= [ T(N/4) + 1 ] + 1

= [ [ T(N/8) + 1] + 1] + 1

= …

= T(N/2k) + k

N/2k gets smaller and eventually becomes 1

Page 51: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of checks (Speed of algorithm)T(1) = 1

T(N) = T(N/2) + 1

= [ T(N/4) + 1 ] + 1

= [ [ T(N/8) + 1] + 1] + 1

= …

= T(N/2k) + k

N/2k gets smaller and eventually becomes 1 solve for k

Page 52: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of Checks (Speed of Algorithm) N/2k = 1

N = 2k

k = ?

Page 53: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of Checks (Speed of Algorithm) N/2k = 1

N = 2k

k = log2N

Page 54: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of Checks (Speed of Algorithm) N/2k = 1

N = 2k

k = log2N

T(N) = T(N/2k) + k

= T(1) + log2N

= ? + log2N

Page 55: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of Checks (Speed of Algorithm) N/2k = 1

N = 2k

k = log2N

T(N) = T(N/2k) + k

= T(1) + log2N

= 1 + log2N

Page 56: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

N (Linear search) vs log N + 1 (Binary search)

N

100 7.6

1,000 11.0

10,000 14.3

100,000 17.6

1,000,000 20.9

10,000,000 24.3

100,000,000 27.6

Page 57: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Before using Binary Search

The array needs to be sorted (in order)

Page 58: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Sorting

Page 59: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Sorting (arranging the items in adesired order) How is the phone book arranged?

Why? Why not arranged by numbers?

Page 60: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Sorting (arranging the items in adesired order) How is the phone book arranged?

Why? Why not arranged by numbers?

Order Alphabetical Low to high numbers DNA profile with 13 loci?

Page 61: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Sorting

Imagine you have a thousand numbers in an array

How would you systemically sort them?

Page 62: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Selection Sort (ascending)

Find/select the smallest item Swap the smallest item with the first item

Page 63: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Selection Sort (ascending)

Find/select the smallest item Swap the smallest item with the first item Find/select the second smallest item Swap the second smallest item with the

second item …

Page 64: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Example

6 7 2 5 1

Page 65: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Example

6 7 2 5 1

Page 66: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Example

6 7 2 5 1

1 7 2 5 6

Page 67: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Example

6 7 2 5 1

1 7 2 5 6

Page 68: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Example

6 7 2 5 1

1 7 2 5 6

1 2 7 5 6

Page 69: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Example

6 7 2 5 1

1 7 2 5 6

1 2 7 5 6

Page 70: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Example

6 7 2 5 1

1 7 2 5 6

1 2 7 5 6

1 2 5 7 6

Page 71: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Example

6 7 2 5 1

1 7 2 5 6

1 2 7 5 6

1 2 5 7 6

Page 72: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Example

6 7 2 5 1

1 7 2 5 6

1 2 7 5 6

1 2 5 7 6

1 2 5 6 7

Page 73: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Breaking down the problem

Get all the items in ascending order Get one item at the wanted position/index

What are the two subproblems?

Page 74: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Breaking down the problem

Get all the items in ascending order Get one item at the wanted position/index

Find the smallest item

Page 75: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Breaking down the problem

Get all the items in ascending order Get one item at the wanted position/index

1. Find the smallest item

2. Swap the smallest item with the item at the wanted position

Page 76: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Algorithm Summary (Selection Sort) For each “desired” position

Between the “desired” position and the end Find the smallest item

Swap the smallest item with the item at the “desired” position

Page 77: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of comparisons (Speed of Algorithm) Consider counting

Number of comparisons between array items

Page 78: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of comparisons (Speed of Algorithm) Consider counting

Number of comparisons between array items Best-case scenario (least # of comparisons)

When does it occur? How many comparisons?

Page 79: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of comparisons (Speed of Algorithm) Consider counting

Number of comparisons between array items Best-case scenario (least # of comparisons)

When does it occur? How many comparisons?

Worst-case scenario (most # of comparisons) When does it occur? How many

comparisons?

Page 80: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of comparisons (Speed of Algorithm) Consider counting

Number of comparisons between array items Best-case scenario (least # of comparisons)

When does it occur? How many comparisons?

Worst-case scenario (most # of comparisons) When does it occur? How many

comparisons? Same number of comparisons

For all cases (ie best case = worst case)

Page 81: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of comparisons (Speed of Algorithm) To find the smallest item

How many comparisons?

Page 82: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of comparisons (Speed of Algorithm) To find the smallest item

How many comparisons? N-1

To find the second smallest item How many comparisons?

Page 83: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of comparisons (Speed of Algorithm) To find the smallest item

How many comparisons? N-1

To find the second smallest item How many comparisons? N-2

… Total # of comparisons?

Page 84: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of comparisons (Speed of Algorithm) To find the smallest item

How many comparisons? N-1

To find the second smallest item How many comparisons? N-2

… Total # of comparisons

(N-1) + (N-2) + … + 1

Page 85: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Number of comparisons (Speed of Algorithm) To find the smallest item

How many comparisons? N-1

To find the second smallest item How many comparisons? N-2

… Total # of comparisons

(N-1) + (N-2) + … + 1 N(N-1)/2 = (N2 – N)/2

Page 86: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Selection Sort

Not the fastest sorting algorithm Learn faster algorithms in more advanced

courses.

Page 87: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Revisiting Binary Search

Page 88: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Binary Search

While more items and not found in the mid point1. Eliminate half of the items

2. Determine the mid point

Page 89: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Eliminate half of the array

How to specify the focus region? Hint: index/position

Page 90: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Eliminate half of the array

How to specify the focus region? Hint: index/position

Start and end

Page 91: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

How to determine if the region has items (is not empty)? with start and end

Page 92: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

How to determine if the region has items (is not empty)? with start and end

Start <= end

Page 93: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

How do we adjust start and end?

Page 94: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

How do we adjust start and end?

What are the two different cases?

Page 95: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

How do we adjust start and end?

What are the two different cases? Item is before the middle item

Item is after the middle item

Page 96: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

How do we adjust start and end?

What are the two different cases? Item is before the middle item

Start: End:

Item is after the middle item

Page 97: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

How do we adjust start and end?

What are the two different cases? Item is before the middle item

Start: no change End: position before the mid point

Item is after the middle item

Page 98: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

How do we adjust start and end?

What are the two different cases? Item is before the middle item

Start: no change End: position before the mid point

Item is after the middle item Start: End:

Page 99: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

How do we adjust start and end?

What are the two different cases? Item is before the middle item

Start: no change End: position before the mid point

Item is after the middle item Start: position after the mid point End: no change

Page 100: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

How to determine the mid point?

with start and end?

Page 101: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

How to determine the mid point?

with start and end (start + end) / 2

Integer division will eliminate the fractional part

Page 102: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Algorithm Summary

1. Initialize start, end, and mid point (I)

2. While region has items and item is not at the mid point ( C )a) Eliminate half of the items by adjusting start

or end (U)

b) Update the mid point (U)

3. If region has items Position is mid point

else Position is -1

Page 103: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Overall Summary

Page 104: Forensics and CS Philip Chan. CSI: Crime Scene Investigation   high tech forensics tools DNA profiling Use.

Overall Summary

DNA samples from crime scene Identify people using known DNA profiles

If there is a match estimate probability of DNA profile

Matching a sample to known DNA profiles Linear/sequential search [N checks] Binary search [log2N + 1 checks]

Faster but needs sorted data/profiles Selection Sort [(N2 – N)/2 comparisons]