Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 22 08:16:32 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAMGGW34002669 for ; Sat, 22 Nov 2008 08:16:32 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAMGENkS011538 for ; Sat, 22 Nov 2008 08:14:23 -0800 Message-Id: <200811221614.mAMGENkS011538@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: BitVector Date: Sat, 22 Nov 2008 08:14:23 -0800 From: Bill Cheng Someone wrote: > If thats the case I guess something is wrong with my code. > I was getting correct bitvector for all the cases except this > one. Just wanted to verify the rite answer. > Sorry for any confusion and inconvinience. Well, let's take the first word "desc" as an example. echo -n "desc" | openssl md5 returns 1dee80c7d5ab2c1c90aa8d2f7dd47256. The last 9 bits is 0x056. 0x056 equals 86. Each character in the bit-vector represents 4 bits. So, 86 = 4*21 + 2. So, if you count from the right, you need to skip 21 characters. Now, if the remainder was zero, then the corresponding character in the bit-vector would be have the "1" position set. You have a "1" there. Since the remainer is 2, the corresponding character in the bit-vector should have the "4" position set (1 shifted to the left by 2 bit positions). I have a "c" there. So, the "4" bit is set. -- Bill Cheng // bill.cheng@usc.edu ________________________________ From: Bill Cheng To: cs551@merlot.usc.edu Sent: Friday, November 21, 2008 9:58:47 PM Subject: Re: BitVector Someone wrote:   > For file v.gif with keywords : desc viterbi usc gif we get bitvector   >   > Bit-vector=00000000000000000000000000200000000000000000000000000000000000000000000000000000   > 2008000000000000000000000000000000040000000000000000000000000000000000000000000000000000000   > 0400008000000000000000000000000000000000000000000000000000000001000000000000000000000   >   >   > while the grading guidelines says   >   > Bit-vector= \   >  0000000000000000000000002000000000000000000000 \   >  0000000000000000000000000000002008000000000000 \   >  0000000000000000040000000000000000000000000000 \   >  0000000000000000000000000040000800000000000000 \   >  0000000000000000000000000000000000000000c00000 \   >  00000000000000   >   > Kindly confirm which one is correct.   > Ref: test case A 3 If you think my solution is incorrect, please provide some evidence! -- Bill Cheng // bill.cheng@usc.edu