Adversarial Lower Bound Arguments - Practice Problems | CS 1510, Assignments of Computer Science

Material Type: Assignment; Class: ALGORITHM DESIGN; Subject: Computer Science; University: University of Pittsburgh; Term: Unknown 1989;

Typology: Assignments

Pre 2010

Uploaded on 09/17/2009

koofers-user-zxd
koofers-user-zxd 🇺🇸

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 1510 Adversarial Lower Bound Arguments
1. In a simplified form of the game mastermind there is a hidden sequence H= (c1,...,ck) of kcolored
pegs. There are Cdifferent possible colors. Colors can be repeated in the hidden sequence. The game
consistes of repeated rounds. To start a round the guesser gives the hider a sequece G= (g1,...,gk)
of kcolors. The hider then tells the guesser how many of the guesses were correct, that is, the number
of indices jsuch that hj=gj. This ends a round.
Compute a lower bound as a function of kand Con the number of the number rounds required by the
guesser to guarantee that he/she will solve the puzzle. A typical values of k= 4 and C= 6; what do
you get for your lower bound in this case.
2. In the game mastermind there is a hidden sequence H= (c1,...,ck) of kcolored pegs. There are
Cdifferent possible colors. Colors can be repeated in the hidden sequence. The game consistes of
repeated rounds. To start a round the guesser gives the hider a sequece G= (g1,...,gk) of kcolors.
The hider then tells the guesser how many of the guesses were correct, that is, the number of indices
jsuch that hj=gj. In addition, the hider tells the guess how many colors are correct, but are in the
wrong position (think of Hand Gas being multi-sets and the hider tells the guesser the cardinality of
the multi-set intersection of Hand G). This ends a round.
Compute a lower bound as a function of kand Con the number of the number rounds required by the
guesser to guarantee that he/she will solve the puzzle. A typical values of k= 4 and C= 6; what do
you get for your lower bound in this case.
††
3. Prove that computing the OR of nbits requires Ω(log n) steps on a EREW PRAM, independent of
the number of processors used.
††
4. Consider the following situation. You have two workstations Aand Bconnected by a communication
line. The workstation Ais initially given an nbit integer x. The workstation Bis initially given an
nbit integer y. The goal of the two workstations is to communicate over the line in such a way that
they both know the number of bits that are 1 in xplus the number of bits that are 1 in y. Show that
the number of bits sent a cross the line must be Ω(l og n).
††
5. Consider the following situation. You have two workstations Aand Bconnected by a communication
line. The workstation Ais initially given an nbit integer x. The workstation Bis initially given an
nbit integer y. The goal of the two workstations is to communicate over the line in such a way that
they both know the bit-wise exclusive-or of xand y. Show that the number of bits sent across the line
must be Ω(n).
††
6. You goal is to find a counterfeit coin among a group of 9 coins. Counterfeit coins are lighter than
real coins. You know that exactly one of the 9 coins is counterfeit. To help you decide which coin is
legitimate you have a pan balance. A pan balance functions in the following manner. You can give
the pan balance any two disjoint subcollections, say S1and S2, of the coins. Let |S1|and |S2|be the
cumulative weight of the coins in S1and S2, respectively. The pan balance then determines whether
|S1|<|S2|,|S1|=|S2|, or |S1|>|S2|. Show how to solve this problem in two weighings on the pan
balance.
HINT: This is not a lower bound problem. It’s purpose is to build you intution.
pf3
pf4

Partial preview of the text

Download Adversarial Lower Bound Arguments - Practice Problems | CS 1510 and more Assignments Computer Science in PDF only on Docsity!

CS 1510 Adversarial Lower Bound Arguments

  1. In a simplified form of the game mastermind there is a hidden sequence H = (c 1 ,... , ck) of k colored pegs. There are C different possible colors. Colors can be repeated in the hidden sequence. The game consistes of repeated rounds. To start a round the guesser gives the hider a sequece G = (g 1 ,... , gk) of k colors. The hider then tells the guesser how many of the guesses were correct, that is, the number of indices j such that hj = gj. This ends a round. Compute a lower bound as a function of k and C on the number of the number rounds required by the guesser to guarantee that he/she will solve the puzzle. A typical values of k = 4 and C = 6; what do you get for your lower bound in this case. †
  2. In the game mastermind there is a hidden sequence H = (c 1 ,... , ck) of k colored pegs. There are C different possible colors. Colors can be repeated in the hidden sequence. The game consistes of repeated rounds. To start a round the guesser gives the hider a sequece G = (g 1 ,... , gk) of k colors. The hider then tells the guesser how many of the guesses were correct, that is, the number of indices j such that hj = gj. In addition, the hider tells the guess how many colors are correct, but are in the wrong position (think of H and G as being multi-sets and the hider tells the guesser the cardinality of the multi-set intersection of H and G). This ends a round. Compute a lower bound as a function of k and C on the number of the number rounds required by the guesser to guarantee that he/she will solve the puzzle. A typical values of k = 4 and C = 6; what do you get for your lower bound in this case. ††
  3. Prove that computing the OR of n bits requires Ω(log n) steps on a EREW PRAM, independent of the number of processors used. ††
  4. Consider the following situation. You have two workstations A and B connected by a communication line. The workstation A is initially given an n bit integer x. The workstation B is initially given an n bit integer y. The goal of the two workstations is to communicate over the line in such a way that they both know the number of bits that are 1 in x plus the number of bits that are 1 in y. Show that the number of bits sent across the line must be Ω(log n). ††
  5. Consider the following situation. You have two workstations A and B connected by a communication line. The workstation A is initially given an n bit integer x. The workstation B is initially given an n bit integer y. The goal of the two workstations is to communicate over the line in such a way that they both know the bit-wise exclusive-or of x and y. Show that the number of bits sent across the line must be Ω(n). ††
  6. You goal is to find a counterfeit coin among a group of 9 coins. Counterfeit coins are lighter than real coins. You know that exactly one of the 9 coins is counterfeit. To help you decide which coin is legitimate you have a pan balance. A pan balance functions in the following manner. You can give the pan balance any two disjoint subcollections, say S 1 and S 2 , of the coins. Let |S 1 | and |S 2 | be the cumulative weight of the coins in S 1 and S 2 , respectively. The pan balance then determines whether |S 1 | < |S 2 |, |S 1 | = |S 2 |, or |S 1 | > |S 2 |. Show how to solve this problem in two weighings on the pan balance. HINT: This is not a lower bound problem. It’s purpose is to build you intution. †
  1. You goal is to find a counterfeit coin among a group of n coins. Counterfeit coins are lighter than real coins. You know that exactly one of the n coins is counterfeit. To help you decide which coin is legitimate you have a pan balance. A pan balance functions in the following manner. You can give the pan balance any two disjoint subcollections, say S 1 and S 2 , of the coins. Let |S 1 | and |S 2 | be the cumulative weight of the coins in S 1 and S 2 , respectively. The pan balance then determines whether |S 1 | < |S 2 |, |S 1 | = |S 2 |, or |S 1 | > |S 2 |. Show that solving this problem requires at least ⌈log 3 n⌉ weighings on the pan balance. †
  2. Show that there is no comparison based sorting algorithm who running time is linear for at least half of the n! inputs of length n. ††
  3. Show that 2n − 1 comparisons are necessary in the worst case to merge two sorted lists of length n. ††
  4. In the broadcast gossip problem there are n workstations. There workstations may be initially pro- grammed in any way that you like. After they are programmed, an arbitary k of them are given an integer. Assume time is divided into unit slots and that a workstation can transmit its integer in a unit slot. Workstations can only communicate via broadcast. If more than one workstation tries to broadcast in a time slot then all the workstations detect interference (that is, they don’t get the message, but they can tell that more than two workstations attempted to broadcast). If only one workstation broadcasts in a time slot then it succeeds and all workstations hear the broadcast. If only no workstation broadcasts in a time slot then this can be detected by all workstations. Here assume that the workstations goal is for all workstations to successfully transmit their messages. Explain how to solve this problem in time n. HINT: This is not a lower bound question, it is just a warm-up question to understand the problem. †
  5. Consider the broadcast problem where the goal is for at least one workstation to successfully transmit its message. Show how to solve this problem in time O(log n). HINT: This is not a lower bound question, it is just a warm-up question to understand the problem. ††
  6. Consider the broadcast problem where the goal is for all workstations to successfully transmit their messages. Show how to solve this problem in time O(k log n). HINT: This is not a lower bound question, it is just a warm-up question to understand the problem. ††
  7. Consider the broadcast problem where the goal is for all workstations to successfully transmit their messages and all workstations know a priori that k = 2. That is, the workstations can be programmed under the assumption that k = 2. Show to solve this problem requires time Ω(log n). ††
  8. Consider the broadcast problem where the goal is for all workstations to successfully transmit their messages. Show to solve thie problem requires time Ω(k log n k ). HINT: The math gets a bit involved here. The first fact you need is that x! can be approximated well by

2 πx( x e )x, where e is the base of the natural logarithm. The second fact you need is that (1 + x/y)y can be approximated well by ex^ when y is large. † † †

although they may be delayed arbitrarily long. Show that there is no algorithm that will allow the good workstations to agree on a bit.

HINT: As the rating suggests, this should not be attempted by the faint of heart. This is a very hard problem.

† † ††