<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Yaniv's Gems</title>
	<atom:link href="http://yaniv.leviathanonline.com/blog/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://yaniv.leviathanonline.com/blog</link>
	<description>Strain your Brain</description>
	<lastBuildDate>Tue, 31 Aug 2010 17:39:33 -0700</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>Comment on Find the Duplicate by yaniv</title>
		<link>http://yaniv.leviathanonline.com/blog/riddles/find-the-duplicate/comment-page-1/#comment-40999</link>
		<dc:creator>yaniv</dc:creator>
		<pubDate>Tue, 31 Aug 2010 17:39:33 +0000</pubDate>
		<guid isPermaLink="false">http://yaniv.leviathanonline.com/blog/riddles/find-the-duplicate/#comment-40999</guid>
		<description>A clarification - the solution takes O(log(N)) bits of memory and O(N * logN) time, if you are only allowed actions on bits. Note that in this case the size of the input is N*log(N).
It is simpler to count the complexity in integers, in which case it is indeed O(N) running time and O(1) memory.</description>
		<content:encoded><![CDATA[<p>A clarification &#8211; the solution takes O(log(N)) bits of memory and O(N * logN) time, if you are only allowed actions on bits. Note that in this case the size of the input is N*log(N).<br />
It is simpler to count the complexity in integers, in which case it is indeed O(N) running time and O(1) memory.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Prisoners with Bit Sequences by yaniv</title>
		<link>http://yaniv.leviathanonline.com/blog/riddles/prisoners-with-bit-sequences/comment-page-1/#comment-38175</link>
		<dc:creator>yaniv</dc:creator>
		<pubDate>Tue, 29 Jun 2010 01:06:03 +0000</pubDate>
		<guid isPermaLink="false">http://yaniv.leviathanonline.com/blog/?p=185#comment-38175</guid>
		<description>Oh, and regarding rouli&#039;s comment, I forgot to say that I think that the riddle cannot be proved by looking at only finitely many bits (even if unbounded).
Not sure how to prove that though.

And finally, I thanked Haran for the riddle, but I should have also thanked Nadav for being a proxy :-)
So thanks Nadav! Cool riddle!</description>
		<content:encoded><![CDATA[<p>Oh, and regarding rouli&#8217;s comment, I forgot to say that I think that the riddle cannot be proved by looking at only finitely many bits (even if unbounded).<br />
Not sure how to prove that though.</p>
<p>And finally, I thanked Haran for the riddle, but I should have also thanked Nadav for being a proxy <img src='http://leviathanonline.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
So thanks Nadav! Cool riddle!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Prisoners with Bit Sequences by yaniv</title>
		<link>http://yaniv.leviathanonline.com/blog/riddles/prisoners-with-bit-sequences/comment-page-1/#comment-38173</link>
		<dc:creator>yaniv</dc:creator>
		<pubDate>Tue, 29 Jun 2010 00:59:49 +0000</pubDate>
		<guid isPermaLink="false">http://yaniv.leviathanonline.com/blog/?p=185#comment-38173</guid>
		<description>Hi,

Well, my solution is essentially the second one Dan describes (with the correct treatment for 1/2). Actually, the construction itself (modifying the proof of the Hahn-Banach theorem) is also very similar to the use of a filter.

For simplicity, I will start from the beginning (Dan - I must say that I really like your filter solution, Oded Badt solved it like this as well).

So, take the vector space of all bounded sequences (with the sup norm). Take the subspace of all converging sequences. On it, the limit linear functional is defined. Now, using Hahn-Banach we can indeed extend it to the entire space. The only problem is indeed with the value 1/2.

The correction for the value 1/2 is actually really simple, we will build our extension such that all binary sequences will get whole number values (we can even enforce that any sequence that is composed of whole numbers receives whole values).
How do we do it? Well, let&#039;s recall how the Hahn-Banach proof works: we have the set of pairs Fi,Hi of functionals Fi and subspaces Hi. What happens if we consider only ones which satisfy our requirement? Well, everything still works! Every chain still has an upper bound and the maximal element is our entire space! (BTW - it is enough to define it on the subspace spanned by all the sequences composed of whole numbers, which I think is equal to that spanned by all binary sequences but STRICTLY smaller than the entire space - comments?).

Anyway, the problem can also be solved by standard transfinite induction (i.e. our modified Hahn-Banach theorem can be proved with it). Which is kind of similar to the filter idea (without explicitly using it). I.e., take the next binary sequence not yet assigned, assign it 0, expand the functional, rinse and repeat.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Well, my solution is essentially the second one Dan describes (with the correct treatment for 1/2). Actually, the construction itself (modifying the proof of the Hahn-Banach theorem) is also very similar to the use of a filter.</p>
<p>For simplicity, I will start from the beginning (Dan &#8211; I must say that I really like your filter solution, Oded Badt solved it like this as well).</p>
<p>So, take the vector space of all bounded sequences (with the sup norm). Take the subspace of all converging sequences. On it, the limit linear functional is defined. Now, using Hahn-Banach we can indeed extend it to the entire space. The only problem is indeed with the value 1/2.</p>
<p>The correction for the value 1/2 is actually really simple, we will build our extension such that all binary sequences will get whole number values (we can even enforce that any sequence that is composed of whole numbers receives whole values).<br />
How do we do it? Well, let&#8217;s recall how the Hahn-Banach proof works: we have the set of pairs Fi,Hi of functionals Fi and subspaces Hi. What happens if we consider only ones which satisfy our requirement? Well, everything still works! Every chain still has an upper bound and the maximal element is our entire space! (BTW &#8211; it is enough to define it on the subspace spanned by all the sequences composed of whole numbers, which I think is equal to that spanned by all binary sequences but STRICTLY smaller than the entire space &#8211; comments?).</p>
<p>Anyway, the problem can also be solved by standard transfinite induction (i.e. our modified Hahn-Banach theorem can be proved with it). Which is kind of similar to the filter idea (without explicitly using it). I.e., take the next binary sequence not yet assigned, assign it 0, expand the functional, rinse and repeat.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Prisoners with Bit Sequences by Dan</title>
		<link>http://yaniv.leviathanonline.com/blog/riddles/prisoners-with-bit-sequences/comment-page-1/#comment-38031</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Sun, 27 Jun 2010 21:44:48 +0000</pubDate>
		<guid isPermaLink="false">http://yaniv.leviathanonline.com/blog/?p=185#comment-38031</guid>
		<description>Argh. Thought I got rid of all the less-thans, forgot to search up :\
If the above was less than clear, that is of course due to it being cut off just after the start of line (d), and joined five paragraphs down... Here are the solutions again, with the first and last paragraphs repeated from the last post:


First solution (warning: heavy set theory!):
This is a rather axiomatic approach, based on making some reasonable assumptions about the strategy and then living up to them. First, because of symmetry, it seems reasonable that each of them will have the same deterministic strategy, i.e. a function F from all infinite sequences of bits to the set {0,1} where output is the guess about the majority of the sequences in infinity. Now for some desired properties of F:
(a) F({a_n}) = c if {a_n} is the constant sequence a_n=c, for both c in {0,1} (reasonable)
(b) If sequences a_n and b_n differ only in finitely many places, then F({a_n})=F({b_n}). This is reasonable as what happens up to a finite time shouldn&#039;t matter, as it might differ from the behaviour at infinity.
(c) If sequences a_n and b_n complement each other, i.e. a_n+b_n=1 for all n (or for all but finitely many n, by (b)), then F({a_n})+F({b_n})=1, that is, they also complement. This is not only reasonable but necessary: Suppose the first person got sequence a_n, and the second got b_n. Now it could still be possible for the sum of the sequences to be constantly 1 or 2, the third person will just get the appropriate constant function. Hence for at least two people to guess the correct sum in both cases, the person who got {a_n} must guess differently from the person who got {b_n}.
(d) If b_n &gt;= a_n for all n, then F({a_n}) &gt;= F({b_n}). This is reasonable, as it does not make sense that seeing strictly more 1&#039;s in {b_n} than in {a_n} will make us guess that the majority was 1 for {a_n}, but 0 for {b_n}.

Now, note that any such function F:{0,1}^N → {0,1} could equivalently be considered as the indicator function of some subset (which by abusing notation we shall also call F) of the power set P(N), i.e. for any subset A of N, F(A)=1 if and only if A is in F. In this language the properties translate to: 
(a) N is in F, the empty set is not in F
(b) If A and B differ by finitely many elements, then A is in F if and only if B is in F
(c) A is in F if and only if its complement is not in F.
(d) If A is a subset of B, and A is in F, then B is also in F.

At this stage someone who is familiar with the concept might see that such a set F could be, for example, any free ultrafilter: A filter is a set F which satisfies (a),(d) and (e): If A,B are in F, then so is their intersection. Adding property (c) makes it an ultrafilter, and property (b) is then equivalent to the &quot;free&quot; property, which is that no singleton {x} is in F. Proving the existence of a free ultrafilter on N is non-trivial and requires the Axiom of Choice (or some weaker form of it). I recommend looking it up in Wikipedia. It might be simpler just to show that a set satisfying (a-d) exists, though.

Now let us show that any set F satisfying (a-d) will yield a working strategy: To show that at least two people out of three guess correctly is equivalent to showing that out of each two, at least one will guess correctly. Suppose that at infinity, the sum was 1. Then at no time did both people get 1 simultaneously. Hence their sets, A and B, are disjoint, i.e. A is contained in the complement of B and vice versa. Thus is F(A)=1 then by (d) F(B^c)=1 and by (c) F(B)=0, and similarly if F(B)=1 then F(A)=0. Then at least one of them will guess &#039;0&#039;, which is the correct response. If the sum at infinity was 2, then it can be similarly shown (using property (b) as well) that either F(A)=1 or F(B)=1, which again means at least one of the two guesses correctly.

(And that&#039;s all!)


Second solution(?) (warning: heavy analysis!):
It seems to me that many people, upon encountering this problem, try the following direction: &quot;If each of the sequences has a density at infinity, then it is very simple: If it is less than half, I will guess 0, if it is more than half, I will guess 1&quot;. A good idea, and true, although dependent on two big ifs: If there is a density (and in general of course there isn&#039;t), and if it isn&#039;t exactly 1/2 (where the above algorithm isn&#039;t defined). The big problem here of course is the existence of the density. Fortunately there exists a common (yet sophisticated and advanced) tool that solves it: The Hahn-Banach theorem. Basically, it allows us to extend any bounded linear functional on a subspace of the vector space of bounded sequences into a bounded linear functional on the entire space. For example, if we use it to extend the limit functional defined on the space of convergent sequences, we will get a functional F on all bounded sequences, which is bounded by the supremum, extends the notion of density, and will attain only values in [0,1] the bit sequences.

Now given the sequence of bits, we apply F on it, and if it less than 1/2 we guess 0, and if it is more than 1/2 we guess 1. As the sum a_n+b_n+c_n is constantly 1 or 2 at infinity, so is the sum F({a_n})+F({b_n})+F({c_n}) be 1 or 2, by the linearity of F and by the fact that it extends the limit functional. If the sum is 1 then at most one person can have F &gt; 1/2 (else the total sum is &gt; 1) and the other two guess correctly; if the sum is 2, then at most one can have F less than 1/2 (else the sum is less than 2), and again the other two guess correctly.

It can be seen that the only cases where we do not clearly win is if the values of F are (1,1/2,1/2) or (0,1/2,1/2). As before, in such a case we must have the two people guess differently. Because there are three people, it can be seen that this is not doable by having different people react differently to the value 1/2, and so we must decide for each bit sequence with F = 1/2 whether to guess 0 or 1, in such a way that any two complementary sequences (or more accurately - complementary up to a sequence with F=0) are assigned different guesses.

I had thought earlier that this could be done easily, but now I realize that it might not be so, and I&#039;m not really sure if this can be finished with something simpler than the first proof. In any case it will most likely require AoC again, but of course, even the Hahn-Banach theorem requires some weaker form of the AoC to hold.</description>
		<content:encoded><![CDATA[<p>Argh. Thought I got rid of all the less-thans, forgot to search up :\<br />
If the above was less than clear, that is of course due to it being cut off just after the start of line (d), and joined five paragraphs down&#8230; Here are the solutions again, with the first and last paragraphs repeated from the last post:</p>
<p>First solution (warning: heavy set theory!):<br />
This is a rather axiomatic approach, based on making some reasonable assumptions about the strategy and then living up to them. First, because of symmetry, it seems reasonable that each of them will have the same deterministic strategy, i.e. a function F from all infinite sequences of bits to the set {0,1} where output is the guess about the majority of the sequences in infinity. Now for some desired properties of F:<br />
(a) F({a_n}) = c if {a_n} is the constant sequence a_n=c, for both c in {0,1} (reasonable)<br />
(b) If sequences a_n and b_n differ only in finitely many places, then F({a_n})=F({b_n}). This is reasonable as what happens up to a finite time shouldn&#8217;t matter, as it might differ from the behaviour at infinity.<br />
(c) If sequences a_n and b_n complement each other, i.e. a_n+b_n=1 for all n (or for all but finitely many n, by (b)), then F({a_n})+F({b_n})=1, that is, they also complement. This is not only reasonable but necessary: Suppose the first person got sequence a_n, and the second got b_n. Now it could still be possible for the sum of the sequences to be constantly 1 or 2, the third person will just get the appropriate constant function. Hence for at least two people to guess the correct sum in both cases, the person who got {a_n} must guess differently from the person who got {b_n}.<br />
(d) If b_n &gt;= a_n for all n, then F({a_n}) &gt;= F({b_n}). This is reasonable, as it does not make sense that seeing strictly more 1&#8242;s in {b_n} than in {a_n} will make us guess that the majority was 1 for {a_n}, but 0 for {b_n}.</p>
<p>Now, note that any such function F:{0,1}^N → {0,1} could equivalently be considered as the indicator function of some subset (which by abusing notation we shall also call F) of the power set P(N), i.e. for any subset A of N, F(A)=1 if and only if A is in F. In this language the properties translate to:<br />
(a) N is in F, the empty set is not in F<br />
(b) If A and B differ by finitely many elements, then A is in F if and only if B is in F<br />
(c) A is in F if and only if its complement is not in F.<br />
(d) If A is a subset of B, and A is in F, then B is also in F.</p>
<p>At this stage someone who is familiar with the concept might see that such a set F could be, for example, any free ultrafilter: A filter is a set F which satisfies (a),(d) and (e): If A,B are in F, then so is their intersection. Adding property (c) makes it an ultrafilter, and property (b) is then equivalent to the &#8220;free&#8221; property, which is that no singleton {x} is in F. Proving the existence of a free ultrafilter on N is non-trivial and requires the Axiom of Choice (or some weaker form of it). I recommend looking it up in Wikipedia. It might be simpler just to show that a set satisfying (a-d) exists, though.</p>
<p>Now let us show that any set F satisfying (a-d) will yield a working strategy: To show that at least two people out of three guess correctly is equivalent to showing that out of each two, at least one will guess correctly. Suppose that at infinity, the sum was 1. Then at no time did both people get 1 simultaneously. Hence their sets, A and B, are disjoint, i.e. A is contained in the complement of B and vice versa. Thus is F(A)=1 then by (d) F(B^c)=1 and by (c) F(B)=0, and similarly if F(B)=1 then F(A)=0. Then at least one of them will guess &#8217;0&#8242;, which is the correct response. If the sum at infinity was 2, then it can be similarly shown (using property (b) as well) that either F(A)=1 or F(B)=1, which again means at least one of the two guesses correctly.</p>
<p>(And that&#8217;s all!)</p>
<p>Second solution(?) (warning: heavy analysis!):<br />
It seems to me that many people, upon encountering this problem, try the following direction: &#8220;If each of the sequences has a density at infinity, then it is very simple: If it is less than half, I will guess 0, if it is more than half, I will guess 1&#8243;. A good idea, and true, although dependent on two big ifs: If there is a density (and in general of course there isn&#8217;t), and if it isn&#8217;t exactly 1/2 (where the above algorithm isn&#8217;t defined). The big problem here of course is the existence of the density. Fortunately there exists a common (yet sophisticated and advanced) tool that solves it: The Hahn-Banach theorem. Basically, it allows us to extend any bounded linear functional on a subspace of the vector space of bounded sequences into a bounded linear functional on the entire space. For example, if we use it to extend the limit functional defined on the space of convergent sequences, we will get a functional F on all bounded sequences, which is bounded by the supremum, extends the notion of density, and will attain only values in [0,1] the bit sequences.</p>
<p>Now given the sequence of bits, we apply F on it, and if it less than 1/2 we guess 0, and if it is more than 1/2 we guess 1. As the sum a_n+b_n+c_n is constantly 1 or 2 at infinity, so is the sum F({a_n})+F({b_n})+F({c_n}) be 1 or 2, by the linearity of F and by the fact that it extends the limit functional. If the sum is 1 then at most one person can have F &gt; 1/2 (else the total sum is &gt; 1) and the other two guess correctly; if the sum is 2, then at most one can have F less than 1/2 (else the sum is less than 2), and again the other two guess correctly.</p>
<p>It can be seen that the only cases where we do not clearly win is if the values of F are (1,1/2,1/2) or (0,1/2,1/2). As before, in such a case we must have the two people guess differently. Because there are three people, it can be seen that this is not doable by having different people react differently to the value 1/2, and so we must decide for each bit sequence with F = 1/2 whether to guess 0 or 1, in such a way that any two complementary sequences (or more accurately &#8211; complementary up to a sequence with F=0) are assigned different guesses.</p>
<p>I had thought earlier that this could be done easily, but now I realize that it might not be so, and I&#8217;m not really sure if this can be finished with something simpler than the first proof. In any case it will most likely require AoC again, but of course, even the Hahn-Banach theorem requires some weaker form of the AoC to hold.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Prisoners with Bit Sequences by Dan</title>
		<link>http://yaniv.leviathanonline.com/blog/riddles/prisoners-with-bit-sequences/comment-page-1/#comment-38029</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Sun, 27 Jun 2010 21:38:29 +0000</pubDate>
		<guid isPermaLink="false">http://yaniv.leviathanonline.com/blog/?p=185#comment-38029</guid>
		<description>Maybe it&#039;s time to post some solutions.

Interestingly enough, I know of two solutions so far, each based on a rather high-end concept involving the axiom of choice. One solution I came up with on my own, the other I heard as an immediate response from at least two people (though the immediate part was only the main idea, and not the complete solution - actually, I&#039;m not sure if it really works any more, read and find out).


First solution (warning: heavy set theory!):
This is a rather axiomatic approach, based on making some reasonable assumptions about the strategy and then living up to them. First, because of symmetry, it seems reasonable that each of them will have the same deterministic strategy, i.e. a function F from all infinite sequences of bits to the set {0,1} where output is the guess about the majority of the sequences in infinity. Now for some desired properties of F:
(a) F({a_n}) = c if {a_n} is the constant sequence a_n=c, for both c in {0,1} (reasonable)
(b) If sequences a_n and b_n differ only in finitely many places, then F({a_n})=F({b_n}). This is reasonable as what happens up to a finite time shouldn&#039;t matter, as it might differ from the behaviour at infinity.
(c) If sequences a_n and b_n complement each other, i.e. a_n+b_n=1 for all n (or for all but finitely many n, by (b)), then F({a_n})+F({b_n})=1, that is, they also complement. This is not only reasonable but necessary: Suppose the first person got sequence a_n, and the second got b_n. Now it could still be possible for the sum of the sequences to be constantly 1 or 2, the third person will just get the appropriate constant function. Hence for at least two people to guess the correct sum in both cases, the person who got {a_n} must guess differently from the person who got {b_n}.
(d) If a_n &lt;= b_n for all n, then F({a_n})  1/2 (else the total sum is &gt; 1) and the other two guess correctly; if the sum is 2, then at most one can have F less than 1/2 (else the sum is less than 2), and again the other two guess correctly.

It can be seen that the only cases where we do not clearly win is if the values of F are (1,1/2,1/2) or (0,1/2,1/2). As before, in such a case we must have the two people guess differently. Because there are three people, it can be seen that this is not doable by having different people react differently to the value 1/2, and so we must decide for each bit sequence with F = 1/2 whether to guess 0 or 1, in such a way that any two complementary sequences (or more accurately - complementary up to a sequence with F=0) are assigned different guesses.

I had thought earlier that this could be done easily, but now I realize that it might not be so, and I&#039;m not really sure if this can be finished with something simpler than the first proof. In any case it will most likely require AoC again, but of course, even the Hahn-Banach theorem requires some weaker form of the AoC to hold.



Anyway, I really liked this riddle. Fun and rewarding. I&#039;ll be glad to hear of any solutions simpler than ultrafilters or Hahn-Banach, as well as a finishing statement for the second proof, if there are any :)</description>
		<content:encoded><![CDATA[<p>Maybe it&#8217;s time to post some solutions.</p>
<p>Interestingly enough, I know of two solutions so far, each based on a rather high-end concept involving the axiom of choice. One solution I came up with on my own, the other I heard as an immediate response from at least two people (though the immediate part was only the main idea, and not the complete solution &#8211; actually, I&#8217;m not sure if it really works any more, read and find out).</p>
<p>First solution (warning: heavy set theory!):<br />
This is a rather axiomatic approach, based on making some reasonable assumptions about the strategy and then living up to them. First, because of symmetry, it seems reasonable that each of them will have the same deterministic strategy, i.e. a function F from all infinite sequences of bits to the set {0,1} where output is the guess about the majority of the sequences in infinity. Now for some desired properties of F:<br />
(a) F({a_n}) = c if {a_n} is the constant sequence a_n=c, for both c in {0,1} (reasonable)<br />
(b) If sequences a_n and b_n differ only in finitely many places, then F({a_n})=F({b_n}). This is reasonable as what happens up to a finite time shouldn&#8217;t matter, as it might differ from the behaviour at infinity.<br />
(c) If sequences a_n and b_n complement each other, i.e. a_n+b_n=1 for all n (or for all but finitely many n, by (b)), then F({a_n})+F({b_n})=1, that is, they also complement. This is not only reasonable but necessary: Suppose the first person got sequence a_n, and the second got b_n. Now it could still be possible for the sum of the sequences to be constantly 1 or 2, the third person will just get the appropriate constant function. Hence for at least two people to guess the correct sum in both cases, the person who got {a_n} must guess differently from the person who got {b_n}.<br />
(d) If a_n &lt;= b_n for all n, then F({a_n})  1/2 (else the total sum is &gt; 1) and the other two guess correctly; if the sum is 2, then at most one can have F less than 1/2 (else the sum is less than 2), and again the other two guess correctly.</p>
<p>It can be seen that the only cases where we do not clearly win is if the values of F are (1,1/2,1/2) or (0,1/2,1/2). As before, in such a case we must have the two people guess differently. Because there are three people, it can be seen that this is not doable by having different people react differently to the value 1/2, and so we must decide for each bit sequence with F = 1/2 whether to guess 0 or 1, in such a way that any two complementary sequences (or more accurately &#8211; complementary up to a sequence with F=0) are assigned different guesses.</p>
<p>I had thought earlier that this could be done easily, but now I realize that it might not be so, and I&#8217;m not really sure if this can be finished with something simpler than the first proof. In any case it will most likely require AoC again, but of course, even the Hahn-Banach theorem requires some weaker form of the AoC to hold.</p>
<p>Anyway, I really liked this riddle. Fun and rewarding. I&#8217;ll be glad to hear of any solutions simpler than ultrafilters or Hahn-Banach, as well as a finishing statement for the second proof, if there are any <img src='http://leviathanonline.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Seam Carving by Seam carving for content aware image resizing: MATLAB implementation &#38; tutorial &#171; Dan&#39;s Blog</title>
		<link>http://yaniv.leviathanonline.com/blog/math/seam-carving/comment-page-1/#comment-36479</link>
		<dc:creator>Seam carving for content aware image resizing: MATLAB implementation &#38; tutorial &#171; Dan&#39;s Blog</dc:creator>
		<pubDate>Mon, 31 May 2010 01:24:16 +0000</pubDate>
		<guid isPermaLink="false">http://yaniv.leviathanonline.com/blog/math/seam-carving/#comment-36479</guid>
		<description>[...] http://yaniv.leviathanonline.com/blog/math/seam-carving/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://yaniv.leviathanonline.com/blog/math/seam-carving/" rel="nofollow">http://yaniv.leviathanonline.com/blog/math/seam-carving/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Prisoners with Bit Sequences by rouli</title>
		<link>http://yaniv.leviathanonline.com/blog/riddles/prisoners-with-bit-sequences/comment-page-1/#comment-36249</link>
		<dc:creator>rouli</dc:creator>
		<pubDate>Sat, 29 May 2010 16:23:02 +0000</pubDate>
		<guid isPermaLink="false">http://yaniv.leviathanonline.com/blog/?p=185#comment-36249</guid>
		<description>hmm...are the prisoners allowed to read only a finite (though unbounded) number of bits from their sequence?</description>
		<content:encoded><![CDATA[<p>hmm&#8230;are the prisoners allowed to read only a finite (though unbounded) number of bits from their sequence?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Prisoners with Bit Sequences by Nadav</title>
		<link>http://yaniv.leviathanonline.com/blog/riddles/prisoners-with-bit-sequences/comment-page-1/#comment-36222</link>
		<dc:creator>Nadav</dc:creator>
		<pubDate>Sat, 29 May 2010 13:13:08 +0000</pubDate>
		<guid isPermaLink="false">http://yaniv.leviathanonline.com/blog/?p=185#comment-36222</guid>
		<description>Yaniv, you&#039;ve just ruined the riddle.
Rule number 1 of every riddle: There must be a funny story! Otherwise, it&#039;s terribly boring.

Three terrorists plan a terror attack on a power plant.
During the attack, they all got arrested, leaving a bomb with a timer at the crime scene.
They all got sent to lifetime in prison after not telling where the bomb is.
Since electricity is expensive nowadays, the prison can only afford turning the light on in 2 cells every night, leaving one prisoner in the darkness.
If the bomb will go off one day, electricity should become even more expensive, and the prison will afford only to turn one light on every night.

Infinite years later, the three terrorists met god. God said that if at least two of them will know what happen to the bomb, all three terrorists will earn their 72 virgins in heaven. However, if two or more will give a wrong answer, all three will suffer in hell for eternity.

Help the terrorists.</description>
		<content:encoded><![CDATA[<p>Yaniv, you&#8217;ve just ruined the riddle.<br />
Rule number 1 of every riddle: There must be a funny story! Otherwise, it&#8217;s terribly boring.</p>
<p>Three terrorists plan a terror attack on a power plant.<br />
During the attack, they all got arrested, leaving a bomb with a timer at the crime scene.<br />
They all got sent to lifetime in prison after not telling where the bomb is.<br />
Since electricity is expensive nowadays, the prison can only afford turning the light on in 2 cells every night, leaving one prisoner in the darkness.<br />
If the bomb will go off one day, electricity should become even more expensive, and the prison will afford only to turn one light on every night.</p>
<p>Infinite years later, the three terrorists met god. God said that if at least two of them will know what happen to the bomb, all three terrorists will earn their 72 virgins in heaven. However, if two or more will give a wrong answer, all three will suffer in hell for eternity.</p>
<p>Help the terrorists.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Prisoners with Bit Sequences by R.</title>
		<link>http://yaniv.leviathanonline.com/blog/riddles/prisoners-with-bit-sequences/comment-page-1/#comment-36087</link>
		<dc:creator>R.</dc:creator>
		<pubDate>Fri, 28 May 2010 20:12:29 +0000</pubDate>
		<guid isPermaLink="false">http://yaniv.leviathanonline.com/blog/?p=185#comment-36087</guid>
		<description>There are three types of hard riddles:
- those which require recursive logic reasoning (e.g., pirates sharing a treasure)
- those which require an awesome trick, usually a potential function (e.g., the peg solitaire one)
- those which require the axiom of choice (e.g., this one)</description>
		<content:encoded><![CDATA[<p>There are three types of hard riddles:<br />
- those which require recursive logic reasoning (e.g., pirates sharing a treasure)<br />
- those which require an awesome trick, usually a potential function (e.g., the peg solitaire one)<br />
- those which require the axiom of choice (e.g., this one)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Better Half by Dan</title>
		<link>http://yaniv.leviathanonline.com/blog/riddles/the-better-half/comment-page-1/#comment-35477</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Sat, 22 May 2010 07:26:30 +0000</pubDate>
		<guid isPermaLink="false">http://yaniv.leviathanonline.com/blog/?p=178#comment-35477</guid>
		<description>Nice solution! Some remarks:
A queue of size 7 is enough, because when we decrease 1 from all of the elements of the queue, we in effect &quot;remove&quot; 8 strings from the data base: Those that were tracked in the queue, and also the last string read. Then if some element appeared more than 1/8th of the time, he will still be there more than 1/8 of the time after removing 8 different elements from the base, so it will be in the queue at the end of the process.

The claim that the maximal counter belongs to a high-freq element is false: Consider the scenario where the data base has 101 appearances of string &#039;0&#039;, 100 appearances of strings &#039;1&#039;,...,&#039;8&#039;, and 2 appearances of string &#039;9&#039;, and they appear in lexicographical order. Then the queue at the end will have &#039;0&#039; with 1 appearance and &#039;9&#039; with 2. But &#039;0&#039; must still appear in the queue: So if we keep a register for each of the (at most) 8 elements in the final queue, and go over the list one more time, we will be able to determine which of them was really the most common.</description>
		<content:encoded><![CDATA[<p>Nice solution! Some remarks:<br />
A queue of size 7 is enough, because when we decrease 1 from all of the elements of the queue, we in effect &#8220;remove&#8221; 8 strings from the data base: Those that were tracked in the queue, and also the last string read. Then if some element appeared more than 1/8th of the time, he will still be there more than 1/8 of the time after removing 8 different elements from the base, so it will be in the queue at the end of the process.</p>
<p>The claim that the maximal counter belongs to a high-freq element is false: Consider the scenario where the data base has 101 appearances of string &#8217;0&#8242;, 100 appearances of strings &#8217;1&#8242;,&#8230;,&#8217;8&#8242;, and 2 appearances of string &#8217;9&#8242;, and they appear in lexicographical order. Then the queue at the end will have &#8217;0&#8242; with 1 appearance and &#8217;9&#8242; with 2. But &#8217;0&#8242; must still appear in the queue: So if we keep a register for each of the (at most) 8 elements in the final queue, and go over the list one more time, we will be able to determine which of them was really the most common.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
