tag:blogger.com,1999:blog-786333285568106173.post8163701754913469211..comments2024-01-25T01:05:59.968-05:00Comments on WebDiarios de Motocicleta: MidtermMihaihttp://www.blogger.com/profile/11599372864611039927noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-786333285568106173.post-76225572796798544202009-03-23T17:11:00.000-04:002009-03-23T17:11:00.000-04:00Anon, your proof certainly works. What I had in mi...Anon, your proof certainly works. What I had in mind was a bit simpler: a sequential version of what you wrote.<BR/><BR/>In class, I taught them the linear-time algorithm for finding a majority in an array:<BR/><BR/>cnt=0;<BR/>for(i=0; i<n; i++) {<BR/> if(!cnt) maj=a[i], cnt=1;<BR/> else if(maj == a[i]) cnt++;<BR/> else cnt--;<BR/>}<BR/><BR/>This same algorithm can be used by Socrates.Mihaihttps://www.blogger.com/profile/11599372864611039927noreply@blogger.comtag:blogger.com,1999:blog-786333285568106173.post-12665013332912049252009-03-23T01:35:00.000-04:002009-03-23T01:35:00.000-04:00Hi Mihai.I like a lot your Socrates problem, with ...Hi Mihai.<BR/><BR/>I like a lot your Socrates problem, with O(n) debates, provided one insists on DETERMINISTIC solution. I solved it after 5 minutes of thinking, but my solution is a bit "tricky". Not too tricky, but I suspect something simpler is possible. I put my solution below, but did I miss a simpler solution that you had in mind?<BR/>======================================<BR/><BR/>Solution: proceeds in log n rounds. In each round, split people in pairs (if odd, the "odd" guys goes to the next round). Get mutual opinions (A,B) for each pair. If A=B=honest, one guy in the pair (chosen arbitrarily) goes to the next round, the other does not. If either A or B is "lier", none of the members of the pair goes to the next round.<BR/><BR/>Claim 1: the number of people going to the next round is at most ceiling of n/2.<BR/><BR/>Proof: easy, since in each pair at most one guy goes to the next round.<BR/><BR/>Claim 2: after each round, the majority is still honest.<BR/><BR/>Proof. induction. true at the beginning. inductive step. if we get A=B=honest, either both guys are honest or both are liers. Thus, selecting one of them arbitrarily will maintain the fact that majority is honest, since number of honest-honest pair must be greater than lier-lier pairs. Similarly, whenever we drop BOTH guys, at least one of them is the lier, so majority remains honest after we drop both guys as well. QED.<BR/><BR/>Claim 3: a round cannot finish with eliminating everybody.<BR/><BR/>Proof: easy, since at least one pair must be honest-honest due to majority (if you count odd guy as a pair), and one guy survives from this pair.<BR/><BR/>Together, Claims 1-3 establish the following:<BR/><BR/>Corollary: at the end of the process, exactly one guy is left, and this guy is honest. Moreover, it took O(n) debates to get him.<BR/><BR/>The complexity follows from T(n) = T(n/2) + O(n).<BR/><BR/>Finally, one you get this one honest guy, just have him debate everybody and tell his honest opinion, which is another n-1 debates. So total is O(n).<BR/>======================================<BR/><BR/>Is this what you had in mind?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-786333285568106173.post-51106829518604040152009-03-20T11:26:00.000-04:002009-03-20T11:26:00.000-04:00Ah, just noticed that Mihai actually mentions regu...Ah, just noticed that Mihai actually mentions regular languages :p giving the answer to point (8c).rgrighttps://www.blogger.com/profile/02991214367108471744noreply@blogger.comtag:blogger.com,1999:blog-786333285568106173.post-33441254122424017782009-03-20T11:24:00.000-04:002009-03-20T11:24:00.000-04:00Jelani,Thanks. I don't see how to use that result ...Jelani,<BR/><BR/>Thanks. I don't see how to use that result though so the problem is still too hard for me. I know it can be solved obviously with O(n lg n) bits by just keeping all the n numbers in memory. Also, any approach that tries to keep track of the set of seen numbers requires Omega(n lg n).<BR/><BR/>But that's not very useful (or interesting). Since it's a lower bound I tried to transform somehow an instance of indexing into an instance of the given problem, but I can't even figure out what the basic setup could be.<BR/><BR/>I also looked at Q8 a little. Point (a) seems easy: Copy the input one cell to the right and then use only the locations with even "addresses". The answer to (c) seems to be regular languages and the proof idea I had in mind is some sort of explorations of the paths in the Turing machine to build an equivalent finite automaton. Point (b) is tricky. You need to show that the Inca machine is not stronger than a RO TM and there isn't any algorithm for transforming an Inca machine into a RO TM. So the proof has to be an existence proof (that will also do the path exploration thing). Is this right?rgrighttps://www.blogger.com/profile/02991214367108471744noreply@blogger.comtag:blogger.com,1999:blog-786333285568106173.post-18194562115648483812009-03-19T16:02:00.000-04:002009-03-19T16:02:00.000-04:00rgrig,In indexing, alice receives an n-bit vector ...rgrig,<BR/><BR/>In indexing, alice receives an n-bit vector x, and bob receives an index i in {1,...,n}. After some communication with alice, bob outputs a bit, and we say he succeeds if his output is x_i. The relevant theorem is that if the communication consists of only one message, in the alice --> bob direction, and bob succeeds with probability at least 2/3, then sometimes alice must be sending messages that are Omega(n) bits long.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-786333285568106173.post-58322240208660783322009-03-19T14:00:00.000-04:002009-03-19T14:00:00.000-04:001. What is INDEXING?2. It's a bit strange to say l...1. What is INDEXING?<BR/><BR/>2. It's a bit strange to say left/right associative for ternary operators.<BR/><BR/>3. The time seems quite tight to me. Perhaps that's why nobody did Q8.rgrighttps://www.blogger.com/profile/02991214367108471744noreply@blogger.comtag:blogger.com,1999:blog-786333285568106173.post-44190581296006049702009-03-17T20:45:00.000-04:002009-03-17T20:45:00.000-04:00Nobody did, unfortunately. On the other hand, I am...Nobody did, unfortunately. On the other hand, I am quite sure some people would have solved it at MIT .Mihaihttps://www.blogger.com/profile/11599372864611039927noreply@blogger.comtag:blogger.com,1999:blog-786333285568106173.post-85298806906750929522009-03-17T20:39:00.000-04:002009-03-17T20:39:00.000-04:00I'm curious as to whether anyone completely answer...I'm curious as to whether anyone completely answered #8, or if you expected they would? I recall working through a similar problem in Sipser, and a) it took me a long time to work out the details, and b) my write-up was not very concise; it was kind of longish and cobbled together several pieces.<BR/><BR/>On the other hand, I am not exactly MIT material...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-786333285568106173.post-4174246183482751282009-03-17T16:08:00.000-04:002009-03-17T16:08:00.000-04:00Oh. 6 is there twice... that is the problem with 7...Oh. 6 is there twice... that is the problem with 7.Alex McFerronhttps://www.blogger.com/profile/05613697088155278546noreply@blogger.comtag:blogger.com,1999:blog-786333285568106173.post-85180337303791538812009-03-17T16:02:00.000-04:002009-03-17T16:02:00.000-04:00I think 7 is missing from the midterm?I think 7 is missing from the midterm?Alex McFerronhttps://www.blogger.com/profile/05613697088155278546noreply@blogger.com