Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Parallel

Calculation in the Narrows


October, 2005: Calculation in the Narrows

Dr. Ecco Solution

Solution to "Maximum Lottery," DDJ, September 2005.

Following the idea of the sultan's daughters problem, we will express our protocols by three numbers in increasing order: x, y, and z. The idea is to reject the first x, then choose the next one better than those first x. Call the position of that one p1 (so p1>x).

If p1>y then choose the next one better than any seen before (at a position we'll call p2). Otherwise, reject until position y and then pick the next one better than any seen before (at a position we'll still call p2).

If p2>z, then choose the next one better than any seen before (at a position called p3). Otherwise, reject until position z and then pick the next one better than any seen before (at a position we'll call p3).

For 100 balls in total and three keeps, you win roughly 68 percent of the time if you set x, y, and z to be 14, 32, and 64, respectively. Here is one example win for the following sequence:

3 78 80 90 25 95 51 27 57 40 65 48 55 72 26 73 54 31 15 2 89 61 97 98 8 50 38 18
88 52 4 42 68 16 62 9 94 99 20 28 56 58 76 93 10 96 63 35 81 91 66 11 30 5 0 24
82 29 41 12 47 71 44 92 43 32 85 84 7 59 60 86 69 21 83 79 64 67 74 37 1 46 22
19 33 39 87 45 36 13 23 75 34 70 53 49 77 17 6 14

The p1 position value in this case would be 23 where the value 97 is found, because 97 is the first value larger than 90, which is the largest of the first 14 numbers. The p2 value would be 38 where 99 is found and the third keep then is irrelevant.

Reader Improvements Concerning "Treasure Arrow"

Alan Dragoo pointed out that the delta is 15 centimeters so the arrow and plank each weigh 75 kilograms. Carl Smotricz noted that because the arrow is not quite horizontal, the horizontal distance between the two ends of the arrow is less than 10 meters. In fact, it is (102-(0.6)2)= 9.98. So, the arrowhead has dipped 0.6 meters for each 9.98 meters of horizontal distance. Continuing this line (Carl used trigonometry, but let's do this in a more elementary way), there would be a further dip of some amount x for the next 10 meters of horizontal distance. So, x=0.6×(10/9.98). This gives an extra 0.601 meters. So the arrow, in fact, points to 2.201 meters below the ceiling.

DDJ


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.