Top Banner
Problem Set 1, CS/EE 143, Fall 2016 Prof. Steven Low. TA: Daniel Guo * Due date: October 11 on class Problems marked as “Exercise” are for exercise only and DO NOT contribute to the score. Problems marked as “Challenge” are optional, and contribute to the score as bonus points. The total contribution from homework to the course grade is capped by 50%. Solutions for assignments and exercise problems on covered topics will be posted after the assignments are graded. 0 Survey Problem How long did this assignment take? 1 Introduction to Internet 1.1 W&P, P1.1 (Exercise) How many hosts can one have on the Internet if each one needs a distinct IP address? [Solution] Since the IP(v4) address is 4-byte, there can potentially be 2 32 distinct addresses. 1.2 Adapted from W&P, P1.3 8 Points. Imagine that all routers have 17 ports. There are 2 16 hosts to be connected. Assume you can organize the hosts and routers any way you like. Your goal is to (i) design the network structure so as to minimize the number of routers required, and (ii) based on the network design in (i), assign the addresses to minimize the size (number of entries) of the routing table required in each router. (a) 4 Points. Describe your network structure and explain why your design gives the minimum number of routers. (b) 4 Points. Describe your scheme for assigning addresses and routing. Explain why your design gives the minimum routing table size in each router. There exist theoretical lower bounds on the number of routers and the size of the routing table. Point out these lower bounds explicitly in your solution, and use them to verify your design. [Solution] The routers will be arranged in a tree topology, with each of 16 of the ports representing the next half-byte in the network address. The 17th port would be the link to the parent router. The * Courtesy to: Changhong Zhao ([email protected]) 1
12

Problem Set 1, CS/EE 143, Fall 2016 - Caltech Computingcourses.cms.caltech.edu/cs143/Solutions/HW1_solution.pdf · Problem Set 1, CS/EE 143, Fall 2016 Prof. Steven Low. TA: Daniel

Apr 21, 2018

Download

Documents

buidang
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: Problem Set 1, CS/EE 143, Fall 2016 - Caltech Computingcourses.cms.caltech.edu/cs143/Solutions/HW1_solution.pdf · Problem Set 1, CS/EE 143, Fall 2016 Prof. Steven Low. TA: Daniel

Problem Set 1, CS/EE 143, Fall 2016

Prof. Steven Low. TA: Daniel Guo ∗

Due date: October 11 on class

Problems marked as “Exercise” are for exercise only and DO NOT contribute to the score. Problemsmarked as “Challenge” are optional, and contribute to the score as bonus points. The total contributionfrom homework to the course grade is capped by 50%.

Solutions for assignments and exercise problems on covered topics will be posted after the assignmentsare graded.

0 Survey Problem

How long did this assignment take?

1 Introduction to Internet

1.1 W&P, P1.1 (Exercise)

How many hosts can one have on the Internet if each one needs a distinct IP address?

[Solution] Since the IP(v4) address is 4-byte, there can potentially be 232 distinct addresses.

1.2 Adapted from W&P, P1.3

8 Points. Imagine that all routers have 17 ports. There are 216 hosts to be connected. Assume youcan organize the hosts and routers any way you like. Your goal is to (i) design the network structure soas to minimize the number of routers required, and (ii) based on the network design in (i), assign theaddresses to minimize the size (number of entries) of the routing table required in each router.

(a) 4 Points. Describe your network structure and explain why your design gives the minimum numberof routers.

(b) 4 Points. Describe your scheme for assigning addresses and routing. Explain why your designgives the minimum routing table size in each router.

There exist theoretical lower bounds on the number of routers and the size of the routing table. Pointout these lower bounds explicitly in your solution, and use them to verify your design.

[Solution] The routers will be arranged in a tree topology, with each of 16 of the ports representingthe next half-byte in the network address. The 17th port would be the link to the parent router. The

∗Courtesy to: Changhong Zhao ([email protected])

1

Page 2: Problem Set 1, CS/EE 143, Fall 2016 - Caltech Computingcourses.cms.caltech.edu/cs143/Solutions/HW1_solution.pdf · Problem Set 1, CS/EE 143, Fall 2016 Prof. Steven Low. TA: Daniel

root router would have a dead 17th port, and so there would be a routing table of size 16 on the firstrouter, and 17 on every other router. This would be of the form:

• (prefix, halfbyte, unmatched) routes to the port indexed by halfbyte, where prefix is the totalspecified address on the parent router that points to this router on its 17th port;

• default route goes to port 17;

• the root router is just: (halfbyte, unmatched) routes to the port indexed by halfbyte.

The total number of routers we use is 212 + 28 + 24 + 20 = 4369.

This is optimal because:

(a) Consider all the routers and hosts as vertex and links as edge. Then in the result graph, it shouldbe a tree, otherwise we can further remove edges and/or vertexes to simplify the graph. Assume wehave N routers. For each router, we have 17 ports. For each host, we have 1 port. The total numberof edges should be no less than the total number of vertex minus 1, which is (N + 216 − 1) to provideconnectivity. Also we have the number of edges should be no larger than half of the total ports, whichis (17N + 216)/2. Hence we have (17N + 216)/2 ≥ (N + 216 − 1), so N ≥ 4368.9.

(b) The routing table at every router except the root has only 17 entries, which is minimum with arouter fanout of 17.

1.3 W&P, P1.4 (Exercise)

Assume that a host A in Berkeley sends packets with a bit rate of 100Mbps to a host B in Boston.Assume also that it takes 130ms for the first acknowledgment to come back after A sends the firstpacket. Say that A sends one packet of 1Kbyte and then waits for an acknowledgment before sendingthe next packet, and so on. What is the long-term average bit rate of the connection? Assume nowthat A sends N packets before it waits for the first acknowledgment. Express the long-term average bitrate of the connection as a function of N . [Note: 1 Mbps = 106 bits per second; 1 ms = 1 millisecond= 10−3 second.]

[Solution] It takes 1KB/100Mbps = 0.08ms to transmit one packet. When N = 1, the connectiontransfers 1 packet per RTT, i.e., 1KB per 130.08ms ∼ 130ms. This represents a throughput of 1KB/0.13s= 61.5 kbps. (If you use 1KB = 1,024 bits instead of 1,000 bits, then the throughput will be 63 kbps.)It is OK to ignore the packet transmission time (0.08ms) since it is order of magnitude smaller thanthe propagation delay of 130ms.

When N is small enough (see below), the sender sends N packets, and then stops and waits for the firstACK which arrives after one RTT of 130.08ms ∼ 130ms. Therefore the throughput is N KB/130ms =61.5N kbps.

Let K be the largest integer such that K 1 KB100Mbps ≤ 130.08 ms, i.e., K = 1, 626. When N ≥ K, the

sender would have already received the first ACK when it finishes transmitting N packets, and thereforecan immediately transmit the N + 1st packet. In this case, the throughput is 100Mbps.

In summary, the throughput is:

throughput =

{61.5N kbps if N < 1, 626

100 Mbps if N ≥ 1, 626= min {61.5N kbps, 100 Mbps}

1.4 B&G, 2.9: Horizontal and vertical parity checks

4 Points. A horizontal and vertical parity check of size K by L takes (K− 1) binary sequences each of

2

Page 3: Problem Set 1, CS/EE 143, Fall 2016 - Caltech Computingcourses.cms.caltech.edu/cs143/Solutions/HW1_solution.pdf · Problem Set 1, CS/EE 143, Fall 2016 Prof. Steven Low. TA: Daniel

length (L− 1) bits and outputs K binary sequences each of length L bits such that if these sequencesare arranged into an K by L matrix, then each row and each column will have an even number of 1’s.The parity check works as follows. To send (K − 1) data sequences each of length (L − 1) bits, thesender sends the K by L matrix. The receiver checks the parity of each row and each column. If thereis any row or column that has odd parity, an error is detected.

(a) 2 Points. Give an example of a pattern of six errors that cannot be detected by horizontal andvertical parity checks.

(b) 2 Points. Find the number of different patterns of four errors that will not be detected by horizontaland vertical parity checks.

[Solution] (a) Any 6 bit errors in the following entry of the K×L matrix will not be detected: (i1, j1),(i1, j2), (i2, j2), (i2, j3), (i3, j3), (i3, j1), because every row and every column has zero or 2 bit errorswhich maintains valid parity of the matrix.

(b) Any 4 bit errors distributed such that every row and every column has zero or 2 bit errors will notbe detected. There are (

K2

)(L2

)=

1

4KL(K − 1)(L− 1)

such configurations.

1.5 Adapted from B&G, P3.1 (Exercise)

Customers arrive at a fast food restaurant at a rate of five per minute and wait to receive their orderfor an average of 10 minutes. Customers eat in the restaurant with probability 1/2 and take out theirorder without eating with probability 1/2. A meal requires an average of 20 minutes. What is theaverage number of customers in the restaurant?

[Solution] For customers who take out their orders, the average time spent in the restaurant is 10minutes; for those who eat in, the average time spent is 30 minutes. Therefore, the average time spentin the restaurant over all customers equals 20 minutes. Applying Littles law, this means the averagenumber of customers in the restaurant equals 20× 5 = 100.

1.6 Capacity constrained network design

3 Points. Two nodes A and B need to be connected via a communication link. On average, it isestimated that 1000 packets will arrive at A destined for B each second, each packet having an averagesize of 1 Kbyte. There are two design choices: (i) you build a single link with rate 10Mbps betweenA and B, (ii) you build two parallel 5Mbps links, and send a packet arriving at A randomly via eitherlink. Assume each link is equipped with an infinite sized buffer. Assuming the M/M/1 formula for thedelay on a link, compute the average packet delay in each case. Which design choice is better? Canyou explain why? You may ignore packet propagation times.

[Solution] In case (i), the link service rate equals 10Mbps/8Kb = 1250 pkts/sec. Therefore, the meandelay equals 1/(1250-1000) = 4 ms.

In case (ii), each link has a service rate of 625 pkts/sec, and sees an arrival rate of 500 pkts/sec. Themean delay therefore is 1/(625-500) = 8ms.

The first design choice is better since if you double the arrival rate as well as the service rate in anM/M/1 queue, the average waiting time decreases by a factor of 1/2.

3

Page 4: Problem Set 1, CS/EE 143, Fall 2016 - Caltech Computingcourses.cms.caltech.edu/cs143/Solutions/HW1_solution.pdf · Problem Set 1, CS/EE 143, Fall 2016 Prof. Steven Low. TA: Daniel

1.7 W&P: P2.6 (Exercise)

Consider a router in the backbone of the Internet. Assume that the router has 24 ports, each attachedto a 1Gbps link. Say that each link is used at 15% of its capacity by connections that have an averagethroughput of 200kbps. How many connections go through the router at any given time? Say that theconnections last an average of 1 minute. How many new connections are set up that go through therouter in any given second, on average?

[Solution] Aggregate average throughput per link is

1Gbps× 15% = 150Mbps.

Hence average number of connections per link is 150Mbps/200kbps = 750, and average number ofconnections at the router is 750× 24 = 18, 000.

Then Littles Law implies the number of new connections set up at the router:

λ = N/T = 18, 000/60 = 300 connections/sec.

1.8 W&P, P2.7

4 Points. We would like to transfer 20 KB (1 Byte=8 bits) file across a network from node A to nodeF. Packets have a length of 1 KB (neglecting header). The path from node A to node F passes through5 links, and 4 intermediate nodes. Each of the links is a 10 km optical fiber with a rate of 10 Mbps(assume speed of light in optical fiber is 2.0×108 m/s). The 4 intermediate nodes are store-and-forwarddevices, and each intermediate node must perform a 50 µs routing table look up after receiving a packetbefore it can begin sending it on the outgoing link. How long does it take to send the entire file acrossthe network?

[Solution] Look at the time diagram Figure 1.

Figure 1: Time diagram of packets transferred through 5 links and 4 intermediate nodes.

4

Page 5: Problem Set 1, CS/EE 143, Fall 2016 - Caltech Computingcourses.cms.caltech.edu/cs143/Solutions/HW1_solution.pdf · Problem Set 1, CS/EE 143, Fall 2016 Prof. Steven Low. TA: Daniel

Let:

link propagation delay = T1 = 10 km / (2× 108 m/s) = 0.05 ms

packet transmission time = T2 = 1kB/10Mbps = 0.8 ms

node processing time = T3 = 0.05 ms.

Assume A starts transmission at time 0, then:

The time at which B receives and finishes processing first packet is TB = T1 + T2 + T3.

The time at which C receives and finishes processing first packet is TC = TB + T1 + T2 + T3 = 2TB .

The time at which D receives and finishes processing first packet is TD = 3TB .

The time at which F receives the first packet is TF = 4TB + T1 + T2 since F does not need to look upthe routing table.

Therefore, the time at which F receives all 20 packets is

TF + 19T2

= 4(T1 + T2 + T3) + T1 + 20T2

= 5T1 + 24T2 + 4T3

= 5× 0.05 + 24× 0.8 + 4× 0.05 = 19.65 ms.

1.9 W&P, P2.9

3 Points. Consider the case of GSM cell phones. GSM operates at 270.88 Kbps and uses a spectrumspanning 200 KHz. What is the theoretical SNR (in dB) that these phones need for operation? Inreality, the phones use a SNR of 10 dB. Use Shannons theorem to calculate the theoretical capacityof the channel, under this signal-to-noise ratio. How does the utilized capacity compare with thetheoretical capacity?

[Solution]

(a) By Shannon’s formula C = W log2(1 + SNR), we have

270.88kbps = 200kHz log2(1 + SNR).

Hence, required SNR is 2270.88200 − 1 = 1.557 = 10 log10(1.557) dB = 1.9 dB.

(b) With SNR = 10 dB, Shannon capacity = 200kHz log2(1+10) = 692 kbps. Therefore, the utilizationis 270.88/692 = 39%.

1.10 IP addresses (Exercise)

Consider an IPv4 subnet with private IP address space 166.111.8.0/24. If each IP interface in the subnetneeds a distinct IP address, then how many IP interfaces can there be in the subnet? [Hint: to obtainthe right answer, please look up what is a broadcast address online.]

[Solution] There is a total of 28 = 256 IP addresses in this subnet. One of these IP addresses (the onewhose last 8 digits are all 1) should be reserved for broadcasting, leaving 255 IP addresses for physicalinterfaces. Hence, a maximum number of 255 IP interfaces is allowed in the subnet.

5

Page 6: Problem Set 1, CS/EE 143, Fall 2016 - Caltech Computingcourses.cms.caltech.edu/cs143/Solutions/HW1_solution.pdf · Problem Set 1, CS/EE 143, Fall 2016 Prof. Steven Low. TA: Daniel

2 Ethernet

2.1 W&P, P3.2 (Exercise)

Consider the Slotted ALOHA MAC protocol. There are N nodes sharing a medium, and time is dividedinto slots. Each packet takes up a single slot. If a node has a packet to send, it attempts transmissionwith a certain probability. The transmission succeeds if no other node attempts transmission in thatslot.

Now, suppose that we want to give differentiated services to these nodes, i.e., we want different nodesto get a different share of the medium. The scheme we choose works as follows: If node i has a packetto send, it will try to send the packet with probability pi. Assume that every node has a packet tosend all times. In such a situation, will the nodes indeed get a share of the medium in the ratio of theirprobability of access?

[Solution] Consider a given slot. Since every node has a packet to send and transmits with probabilitypi, the probability of success for any node i is

pi∏j 6=i

(1− pj) =pi

1− piβ

where β :=∏Nj=1(1− pj) is independent of any user j.

Therefore, the share of the media any user i gets is proportional to pi1−pi , not to pi.

2.2 W&P, P3.4

4 Points. Consider a commercial 10 Mbps Ethernet configuration with one hub (i.e., all end stationsare in a single collision domain).

(a) 2 Point. Find the Ethernet efficiency for transporting 512 byte packets (including Ethernet over-head) assuming that the propagation delay between the communicating end stations is always 25.6 µs,and that there are many pairs of end stations trying to communicate.

(b) 2 Points. Recall that the maximum efficiency of Slotted Aloha is 1/e. Find the threshold for theframe size (including Ethernet overhead) such that Ethernet is more efficient than Slotted Aloha if thefixed frame size is larger than this threshold. Explain why Ethernet becomes less efficient as the framesize becomes smaller.

[Solution]

(a) Following the derivation of efficiency of the text, we have

η =1

1 + 3.4A

where

A :=PROP

TRANS.

Now

TRANS = packet transmission time =512× 8 bits

10 Mbps= 409.6 µs.

Therefore A = 25.6 µs409.6 µs = 0.0625, and hence efficiency

η =1

1 + 3.4× 0.0625= 82%.

6

Page 7: Problem Set 1, CS/EE 143, Fall 2016 - Caltech Computingcourses.cms.caltech.edu/cs143/Solutions/HW1_solution.pdf · Problem Set 1, CS/EE 143, Fall 2016 Prof. Steven Low. TA: Daniel

(b) Let the Ethernet frame size be s bits, then

TRANS =s bits

10 Mbps=

s

10µs

and

A =PROP

TRANS=

10PROP

s.

We want s such that

η =1

1 + 3.4× 10PROPs

≥ 1

e

which implies

s ≥ 34 PROP

e− 1=

34× 25.6

2.718− 1= 506.6 bits.

A smaller frame size implies a larger A, which implies a smaller efficiency. Note that on average, aninterval of length 2(e − 1)PROP gets wasted between successful transmissions. A smaller frame sizeimplies therefore that the fraction of time spent transmitting data successfully is smaller.

2.3 W&P, P3.5 (Exercise)

Ethernet standards require a minimum frame size of 512 bits in order to ensure that a node can detectany possible collision while it is still transmitting. This corresponds to the number of bits that can betransmitted at 10 Mbps in one roundtrip time. It only takes one propagation delay, however, for thefirst bit of an Ethernet frame to traverse the entire length of the network, and during this time, 256 bitsare transmitted. Why, then, is it necessary that the minimum frame size be 512 bits instead of 256?

[Solution] A station detects collision by listening and comparing what it hears on the wire with whatit transmits. Therefore, if it transmits for a round-trip time, it can compare the signal it detects onthe wire with what it just transmitted onto the wire, and a collision is detected if they are different. Ifit transmits only for 1

2RTT, it would have stopped transmitting before the signal from the other endreaches it, and hence miss the detection. This is illustrated in Figure 3.

2.4 Switch vs Hub, W&P, P3.7

6 Points. In the network shown in Figure 4, all of the devices want to transmit at an average rateof R Mbps, with equal amounts of traffic going to every other node. Assume that all of the links arehalf-duplex and operate at 100Mbps and that the medium access control protocol is perfectly efficient.Thus, each link can only be used in one direction at a time, at 100Mbps. There is no delay to switchfrom one direction to the other.

1. 3 Points. What is the maximum value of R?

2. 3 Points. The hub is now replaced with another switch. What is the maximum value of R now?

[Solution] Denote the flows on links as in Figure 5.

(a) There are two potential bottlenecks: the switch-hub link or the hub.

Switch-hub link bottleneck:

Each node generates 7 flows, each of rate R/7, to each of the other nodes. Therefore the rate crossingthe link from switch to link is

X =R

7× 4× 4 =

16

7R.

7

Page 8: Problem Set 1, CS/EE 143, Fall 2016 - Caltech Computingcourses.cms.caltech.edu/cs143/Solutions/HW1_solution.pdf · Problem Set 1, CS/EE 143, Fall 2016 Prof. Steven Low. TA: Daniel

Figure 2: Diagram demonstrating why the minimum frame should be transmitted for RTT in order tosuccessfully detect collision.

Figure 3: An ethernet. Each circle represents a host, that wants to send an aggregate of R Mbps traffic,evenly to other hosts.

Figure 4: Flows in the hub-switch ethernet.

8

Page 9: Problem Set 1, CS/EE 143, Fall 2016 - Caltech Computingcourses.cms.caltech.edu/cs143/Solutions/HW1_solution.pdf · Problem Set 1, CS/EE 143, Fall 2016 Prof. Steven Low. TA: Daniel

The rate crossing the link from hub to switch is

Y = 4R

since the hub repeats all input flows on all links except from they come from. Then we have

X + Y ≤ 100 Mbps =⇒ R ≤ 15.9 Mbps.

Hub bottleneck:

Take any link, say, from hub to node A. The total rate of traffic on this link is the sum of all inputtraffic to the link except its own:

SA = 3R+X = (3 +16

7)R =

37

7R.

This traffic shares the link with the traffic from A to hub, which has the rate R. Therefore,

SA +R ≤ 100 Mbps =⇒ (37

7+ 1)R ≤ 100 Mbps =⇒ R ≤ 15.9 Mbps.

Hence, both bottlenecks impose the same upper bound for R.

(b) When the hub is replace with a switch, then X = Y and the switch-switch link is the only bottleneck.

2X =32

7R ≤ 100 Mbps =⇒ R ≤ 21.875 Mbps.

2.5 Spanning Tree Protocol, W&P, P3.6

6 Points. Consider the network topology shown in Figure 6, where 1, 2, . . . , 8 denote 8 switchesinterconnecting 9 Ethernets.

Figure 5: Each circle represents a switch, interconnecting 9 Ethernets.

1. 3 Points. Determine which links get deactivated after the Spanning Tree protocol runs, andindicate them on the diagram by putting a small X through the deactivated links.

2. 3 Points. A disgruntled employee wishes to disrupt the network, so she plans on unpluggingcentral bridge switch 8. How does this affect the spanning tree and the paths that Ethernetpackets follow?

9

Page 10: Problem Set 1, CS/EE 143, Fall 2016 - Caltech Computingcourses.cms.caltech.edu/cs143/Solutions/HW1_solution.pdf · Problem Set 1, CS/EE 143, Fall 2016 Prof. Steven Low. TA: Daniel

[Solution]

(a) The STP operates as follows:

1. The bridge with the smallest ID will be the root (Bridge 1).

2. Each bridge finds a shortest path to the root, where link cost is simply hop count (# bridges enroute to root). The port on a bridge through which it roots is called a root port (RP).

3. A tie is broken by choosing the port / path where the next hop (bridge) has a smallest ID.

4. Each LAN segment will choose a bridge towards the root; the port on the bridge thats chosen bythe LAN segment is called a designated port (DP).

5. A tie is broken by the LAN choosing a bridge with the smallest ID.

In Figure 7:

BP: blocked port

DP: designated port (incoming chosen by LAN)

RP: root port (outgoing chosen by bridge).

Figure 6: Spanning Tree Protocol.

Note that LAN chooses Bridge 2 over 8 because of smaller bridge ID.

(b) Since Bridge 8 has no DP (it only has 1 RP which will be used by Bridge 8 to send / receive fromthe root; the rest are all blocked ports), no LAN segment will use Bridge 8 to send or receive Ethernet

10

Page 11: Problem Set 1, CS/EE 143, Fall 2016 - Caltech Computingcourses.cms.caltech.edu/cs143/Solutions/HW1_solution.pdf · Problem Set 1, CS/EE 143, Fall 2016 Prof. Steven Low. TA: Daniel

frames. Therefore, removing Bridge 8 has no effect on the spanning tree, except that it has one fewerleaf node now.

2.6 Aloha (Challenge)

(a) (Equal Share). Assume that n hosts share a medium using the slotted ALOHA protocol: atevery time slot, each host attempts to send a packet with probability p. A host succeeds to send apacket at a given time slot if and only if it is the only host that sends a packet at that time slot.

1. 2 Points. What is the probability that a host sends a packet successfully at a give time slot?

2. 2 Points. What is the probability P{a packet sent} that a packet be sent at a given time slot?

3. 4 Points. What choice of p maximizes the probability P{a packet sent}? How does this maximumprobability behave as n→∞?

(b) (Unequal Share). Assume that n hosts share a medium using the slotted ALOHA protocol, butat every time slot, each host attempts to send a packet with a different probability. More specifically,let N := {1, . . . , n} denote the collection of hosts and assume that host i attempts to send a packetwith probability pi ∈ (0, 1) at every time slot for i = 1, . . . , n.

1. 2 Points. What is the probability Pi := P{i sends a packet successfully} that host i ∈ N sendsa packet successfully at a given time slot?

2. 2 Points. What is the ratio P1 : P2 : P3 : · · · : Pn? This ratio characterizes the share of mediumamong the hosts. Is the share of medium proportional to the probabilities pi that hosts attemptto send packets, i.e., is the ratio P1 : P2 : P3 : · · · : Pn equal to p1 : p2 : p3 : · · · : pn?

3. 5 Points. Assume∑ni=1 pi = 1 and let P :=

∑ni=1 Pi denote the probability that a packet gets

successfully transmitted at a given time slot. Prove that (p1, p2, p3, . . . , pn) = (1/n, 1/n, . . . , 1/n)minimizes P , i.e., (1/n, 1/n, . . . , 1/n) is the solution to

min

n∑i=1

pi∏j 6=i

(1− pj)

s.t. 0 ≤ pi ≤ 1, i = 1, . . . , n;n∑i=1

pi = 1.

It means that equal share of the medium minimizes the throughput.

[Solution]

(a) Answers given in the lecture/textbook.

(b)

1.Pi = pi

∏j 6=i

(1− pj)

2.P1 : P2 : P3 : · · · : Pn =

p11− p1

:p2

1− p2:

p31− p3

: · · · : pn1− pn

This is not proportional to the attempting probabilities in general.

11

Page 12: Problem Set 1, CS/EE 143, Fall 2016 - Caltech Computingcourses.cms.caltech.edu/cs143/Solutions/HW1_solution.pdf · Problem Set 1, CS/EE 143, Fall 2016 Prof. Steven Low. TA: Daniel

3. Consider the nontrivial case where n ≥ 3. Let P (p) :=∑ni=1 pi

∏j 6=i(1 − pj). Consider any

p = (p1, . . . , pn) 6= ( 1n , . . . ,

1n ) which satisfies

n∑i=1

pi = 1 and

0 ≤ pi ≤ 1, ∀i

Let M := maxi=1,...,n pi, and m := mini=1,...,n pi. Hence we have M > 1n > m. Without loss of

generality, let p1 = M and p2 = m, then p = (M,m, . . . , pn). Let p′ = (M+m2 , M+m

2 , . . . , pn). Itis sufficient to show P (p) > P (p′). We have

P (p)− P (p′) =

[M(1−m) + (1−M)m]

n∏j=3

(1− pj) + (1−m)(1−M)

n∑i=3

pi∏

j 6=1,2,i

(1− pj)

2× M +m

2(1− M +m

2)

n∏j=3

(1− pj) + (1− M +m

2)2

n∑i=3

pi∏

j 6=1,2,i

(1− pj)

=

((M +m)2

4−Mm

)2

n∏j=3

(1− pj)−n∑i=3

pi∏

j 6=1,2,i

(1− pj)

>

((M +m)2

4−Mm

)2

n∑i=3

pi

n∏j=3

(1− pj)−n∑i=3

pi∏

j 6=1,2,i

(1− pj)

(1)

=

((M +m)2

4−Mm

)2

n∑i=3

pi(1− pi)∏

j 6=1,2,i

(1− pj)−n∑i=3

pi∏

j 6=1,2,i

(1− pj)

=

((M +m)2

4−Mm

) n∑i=3

(1− 2pi)pi∏

j 6=1,2,i

(1− pj)

≥ 0 (2)

where the inequality in (1) is because (M + m)2 − 4Mm > 0 for M 6= m and∑ni=3 pi < 1, and

the inequality in (2) is because pi ≤ 12 since otherwise pi > M , which leads to a contradiction.

12