Online product queries

1 / 62

# Online product queries - PowerPoint PPT Presentation

Online product queries. Based on the technical report of Alon and Schieber. Published by Chazelle &amp; Rozenberg and Yao. Wilhelm Ackermann. 1896-1963, phd 1925, function 1928. Ackermann ’s function. Ackermann ’s function (modified). is the inverse of the function. Inverse Ackermann function.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about 'Online product queries' - bandele

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Online product queries

Based on the technical report of Alon and Schieber

Wilhelm Ackermann

1896-1963, phd 1925, function 1928

is the inverse of the function

Inverse Ackermann function

A “diagonal”

The first “column”

We can define these row-inverses directly

# times you have to apply αk–1, starting from n, until you get a result ≤ 1.

The inverse Ackermann function

For every fixed n ≥ 6, the sequence

strictly decreases, until it settles at 3.

Today’s problem

You get a list of items from some semigroup (think of integers and the operation max)

Preprocess them so that you can compute the product of any query interval using a small number of precomputed products

pk(n) = # of products we have to precompute to answer a query using only k products

k=2

.......................

.......................

k=2

log(n) levels, linearly many products per level

 O(nlog(n)) = O(nα2(n)) products

k=3

√n

k=3

For every element x we have two products from x to the endpoints of its block  O(n)

k=3

For every interval of complete blocks we compute its product  O(n)

k=3

Recursively do the same inside each block

p3(n) = O(nloglog(n))=o(nlog(n)) = o(nα2(n))

Product queries

1 product per query (k=1):

2 products per query (k=2):

3 products per query:

4,5 products per query:

6,7 products per query:

k products per query:

(Implicit constants in upper bound are independent of k.)

k≥4

Compute a product from each element to the endpoints of its interval  2n

k≥4

Compute the product of each block and apply the algorithm for k-2 to these n/t elements

k≥4

Apply the algorithm recursively inside each block of size t

k≥4

Apply the algorithm recursively inside each block of size t

By induction assumption:

Let

Note that:

We do not quite get the induction through…

Let:

For k≥3

Homework

By induction assumption:

Let

Note that:

c≥4

k=2

x

z

If for each x we have a product such that x is the leftmost item in this product and the product has elements to the right of z then:

k=2

y

x

z

Otherwise for each y on the right we must have a set containing z in which y is the rightmost so:

k=3

√n

k=3

An element is global if it is the leftmost element or rightmost in a set that is not contained in an interval

A global interval is an interval whose elements are all global

k=3

If there are √n/2 global intervals then

k=3

Otherwise there are √n/2 non-global intervals each with a non-global element

k=3

Otherwise there are √n/2 non-global intervals each with a non-global element

In a cover of an interval as above one set is inside I1 and one set is inside I2

The last set must cover all the greens in the middle

k=3

So consider only the greens right before a non-global interval (except the first)

We have about √n/2 such greens

We have a subset corresponding to each interval of these greens

k≥4

Suppose we have a lower bound of Ω(nαm(n)) for k, we prove a lower bound of Ω(nαm+1(n)) for k+2:

t= αm(n)

An element is global if it is the leftmost element or the rightmost in a set that is not contained in an interval

A global interval is an interval whose elements are all global

k≥4

Suppose we have a lower bound of Ω(nαm(n)) for k, we prove a lower bound of Ω(nαm+1(n)) for k+2:

t= αm(n)

If there are n/2t global intervals then

k≥4

Suppose we have a lower bound of Ω(nαm(n)) for k, we prove a lower bound of Ω(nαm+1(n)) for k+2:

Otherwise there are n/2t=n/(2αm(n)) non-global intervals

Our cover must induces a cover of the green elements preceding these intervals (but the first) with k sets

k≥4

Suppose we have a lower bound of Ω(nαm(n)) for k, we prove a lower bound of Ω(nαm+1(n)) for k+2:

Weak ε-nets for convex sets (ANSSK’08)

Given: Set S of n points in Rd; parameter ε, 0 < ε < 1.

S

N

εn = 4

Objective: Construct a point set N that “stabs” all convex hulls of at least εn points of S.

Points of N do not have to be from S. Net is “weak”.

Weak ε-nets for convex sets

For convenience, let r = 1/ε, so r > 1.

Weak (1/r)-net: Stabs all convex hulls of n/r points of S.

Weak ε-Net Theorem: [ABDK ’92] Size of the net depends only on d and r.

There exist functions fd(r), independent of n, such that every set S in Rd has a weak (1/r)-net of size at most fd(r).

Best upper bounds:

f2(r) = O(r2) [ABDK ’92].

fd(r) = O(rd polylog r) [CEGGSW ’95].

fd(r) = Ω(r).

Best lower bound: Trivial.

Weak ε-nets for convex sets

We consider a special case.

S in R2 in convex position.

Previous upper bound for this case:

We will show:

α – inverse Ackermann function

Construction of weak (1/r)-netsfor planar sets in convex position

Given:n-point set S in convex position.

Want: Stab all convex hulls of n/r points.

B2

B3

B1

p2

p1

Place lgreen points equally spaced between the points of S.

The green points partition S into lblocksB1, …, Bl, each of size n/l.

A subset S' of size n/r must “touch” at least l/r different blocks.

block Bi

(size n/l)

Let m = l/r.

m-gon with vertices from m different blocks.

interval Ik

The m-gon partitions the green points into mnonempty intervalsI0,…,Im–1.

If 4 green pointspa, pb, pc, pd lie on 4 different intervals, then intersection between papc and pbpd lies inside the m-gon, so it stabsCH(S’).

We have reduced to the following problem:

Given a cyclic sequence of lgreen points divided into mintervalsI0, …, Im–1, in an unknown way.

I0

I1

I2

I3

I4

I5

I0

p0

pa

pb

pc

pd

pl–1

Construct a family of quadruples, s.t. some quadruple pa, pb, pc, pd “falls on” 4 different intervals.

I0

I1

I2

I3

I4

I5

I0

p0

pa

pb

pc

pl–1

Take p0 as the first point of all the quadruples. It stabs interval I0.

Need to construct a family of triples that stab 3 other intervals.

We have reduced to:

Stabbing interval chains with triples.

Stabbing interval chains with triples

Formulation of the problem:

Given a sequence of n elements:

I1

I2

Ik

pa

pb

pc

Interval chain of length k (k-chain):

Sequence of kconsecutive, disjoint, nonempty intervals.

A triple stabs a k-chain if its 3 elements fall on 3 different intervals.

Objective: Build a family of triples, as small as possible, that stabs allk-chains on n elements.

Stabbing interval chains with 3-tuples

Stabbing all 3-chains:

Stabbing all 4-chains:

Stabbing all 5-chains:

Stabbing all k-chains, k ≥ 6:

Back to weak ε-nets

Building weak (1/r)-nets for planar sets in convex position.

We reduced it to:

Stabbing, with triples, chains of sizel/r – 1 on l elements.

(l free parameter.)

Size of net:

Want to choose l (as function of r) to minimize this expression.

Back to weak ε-nets

Want to choose l as a function or r, minimizing:

Let

= α(r)

Get:

Claim: ≤ 4 for all large enough r.

Proof: Once k ≥ 3, αk(r) grows slowly enough that

Once r is large enough,

Back to weak ε-nets

Conclusion:

Every planar point set in convex position has a weak (1/r)-net of size

Stabbing interval chains with triples

Claim: We can stab all 4-chains in [1,n] with O(nlog(n))

triples.

B1

B2

y

Every 4-chain:

• is contained in B1, or
• is contained in B2, or
• contains y.

Stabbing interval chains with triples

B1

B2

y

• Recursively, build triples that stab all 4-chains in B1 and B2.
• Add all triples of the form (y, a, a+1).
• If a chain contains y, then it contains 2 intervals in either B1 or B2, and y falls in a third interval.

Stabbing interval chains with triples

Bounds for general k:

Let k be fixed.

We want to stab all k-chains in [1,n] with triples.

Assume by induction:

(can stab all (k – 2)-chains with

triples)

Claim:

We can stab all k-chains with

triples.

B1

B2

B3

B4

B5

B6

B7

B8

B9

B10

y1

y2

y3

y4

y5

y6

y7

y8

y9

Stabbing interval chains with triples

Divide range into n/t blocks of size t, leaving separators between them.

Consider a k-chain C. There are 3 possibilities:

• C is entirely contained in a block.
• An inner interval of C (not the first or last interval) falls within a block, and some other interval contains a separator.
• Every inner interval of Ccontains a separator.

Stabbing interval chains with triples

C

yi

yi+1

• The chain C is entirely contained in a block.

Apply the construction recursively within each block.

Stabbing interval chains with triples

C

yi

yi+1

• An inner interval of C (not the first or last interval) falls within a block, and some other interval contains a separator.

Construct all triples

for a between yi and yi+1.

C is stabbed.

C

• Every inner interval of Ccontains a separator.

Build on the separators a set of triples that stab all (k – 2)-chains.