{ localUrl: '../page/fractional_bits_as_expected_cost.html', arbitalUrl: 'https://arbital.com/p/fractional_bits_as_expected_cost', rawJsonUrl: '../raw/3v2.json', likeableId: '2558', likeableType: 'page', myLikeValue: '0', likeCount: '3', dislikeCount: '0', likeScore: '3', individualLikes: [ 'EricBruylant', 'JaimeSevillaMolina', 'NateSoares' ], pageId: 'fractional_bits_as_expected_cost', edit: '6', editSummary: '', prevEdit: '5', currentEdit: '6', wasPublished: 'true', type: 'wiki', title: 'Fractional bits: Expected cost interpretation', clickbait: '', textLength: '6377', alias: 'fractional_bits_as_expected_cost', externalUrl: '', sortChildrenBy: 'likes', hasVote: 'false', voteType: '', votesAnonymous: 'false', editCreatorId: 'NateSoares', editCreatedAt: '2016-06-24 04:29:24', pageCreatorId: 'NateSoares', pageCreatedAt: '2016-05-27 01:09:51', seeDomainId: '0', editDomainId: 'AlexeiAndreev', submitToDomainId: '0', isAutosave: 'false', isSnapshot: 'false', isLiveEdit: 'true', isMinorEdit: 'false', indirectTeacher: 'false', todoCount: '0', isEditorComment: 'false', isApprovedComment: 'true', isResolved: 'false', snapshotText: '', anchorContext: '', anchorText: '', anchorOffset: '0', mergedInto: '', isDeleted: 'false', viewCount: '45', text: 'In the [3tz GalCom] thought experiment, you regularly have to send large volumes of information through deep space to your automated stock trader in the Vega star system, and every bit of information is very expensive. Imagine that a very important earnings report is coming up for Company X, and you want to transmit instructions to your automated trader in the Vega system the instant that the information becomes available. You've decided that you're capable of distinguishing between 7 different outcomes, which each appear equally likely to you. You label them -3, -2, -1, 0, +1, +2, and +3 (according to how the company performed compared to your median estimate). How many bits do you need to reserve on GalCom to ensure that you can send one of those 7 messages the moment that the earnings report comes out?\n\n$\\log_2(7)$ is about 2.807, which implies that two bits won't do — with two bits, you could only single out one message from a set of four. So you have to purchase at least 3 bits. (In general, if you want to send a message on GalCom that distinguishes between $n$ outcomes, you have to reserve at least [3vc $\\lceil \\log_2(n) \\rceil$] bits.)\n\nOnce you've purchased 3 bits, there are 8 different signals that you'll be able to send via GalCom to the Vega system: 000, 001, 010, 011, 100, 101, 110, and 111. You can program your automated trader to interpret these signals as -3, -2, -1, 0, +1, +2, and +3 respectively, and then you have one code — 111 — left over. Is there any way to make money off the fact that you have an extra code?\n\n(You're invited to pause and attempt to answer this question yourself. Is there any way to program the computer on Vega to use your 8 codes in such a way that you sometimes get to sell one bit back to GalCom?)\n\n<br>\n<br>\n<br>\n<br>\n<br>\n\nYou can recoup some of the losses as follows: Program your machine on Vega to recognize both 110 _and_ 111 as +3. Then, if the earnings report for company X comes out as "very good," you get to resell one bit to GalCom. Why? Because both 110 and 111 will be interpreted as +3, so you don't care which one gets sent. Therefore, you can choose to send 110 if the next GalCom bit was going to be a 0, and 111 if the next GalCom bit was going to be a 1, and thereby shave one bit off of the next person's message (assuming your automated trader is programmed to forward that one bit where it needs to go, which is the sort of thing you can set up ahead of time).\n\n![](http://i.imgur.com/mbJ4Apo.png)\n\n_3 bits are enough to single out a leaf in a [binary_tree binary tree] of depth 3. You only have seven messages you want to encode, which means one of the codes gets doubled up — in this case, both 110 and 111 are assigned to +3. Thus, your computer on Vega already knows that the answer is +3 by the time GalCom has transmitted 11, so if the earnings report comes up +3 you can repurpose the third bit._\n\nBecause you set up your codes such that you thought each outcome was equally likely, your [4b5 expected cost] of sending the message is 2.875 bits: 7/8ths of the time you pay for 3 bits, but 1/8th of the time you only pay for 2 bits. If you're sending one message from a set of 7, you have to set aside at least 3 bits at the beginning, but every so often you get to sell one of them back.\n\nIf you send many, many [3v9 7-messages] using the encoding above, then on average, each 7-message costs 2.875 bits.\n\nBut $\\log_2(7) \\neq 2.875,$ it's actually close to about 2.807. What gives?\n\nIn short, the above encoding is not the most efficient way to pack 7-messages. Or, rather, it's the most efficient way to pack one 7-message in isolation, but if we have lots of 7-messages, we can do better on average. Imagine two people teaming up to send two 7-messages. Two 7-messages is the same as one 49-message, where $(m, n)$ is encoded as $7m + n,$ i.e., 17 means "2" to the first person and "3" to the second. Sending a 49 message requires reserving $\\lceil \\log_2(49) \\rceil = 6$ bits on GalCom, thereby purchasing 64 different possible signals (000000 through 111111). $64 - 49 = 15$ of those signals will have a double meaning, which means that 15/49 of the time, one bit can be resold to GalCom. Thus, the expected cost to send two messages from two sets of seven is $6 - \\frac{15}{49} \\approx 5.694$ bits. When the two parties split the cost, they each pay only half that, or roughly 2.847 bits in expectation — slightly better than the 2.875 they would have paid sending one 7-message in isolation.\n\nIf you pack three 7-messages together, the expected cost comes out to $(9 - \\frac{169}{343})\\approx 8.507$ bits, for an average cost of $\\approx 2.836$ bits per 7-message: slightly closer still to the $2.807$ bound. In the limit, as you pack more and more 7-messages together, $\\log_2(7)$ is the smallest average cost you can get. For more on why this is the lower bound, see [trit_in_bits How many bits is a trit?], [427], and [44l].\n\nThus, we can interpret "a 7-message carries about 2.807 bits of information" as "sending lots of 7-messages costs about 2.807 bits on average, if you pack your message as cleverly as possible."\n\nMore generally, the fractional portion of the amount of information carried by a message can be interpreted as the lower bound for the expected cost of sending that message. If we have to send a single $n$-message across GalCom in isolation, then we have to reserve at least $\\lceil \\log_2(n) \\rceil$ bits. But if we append our message to a longer message, and pack our message carefully, then we can push our expected cost lower and lower. What's the lower bound on the expected cost? $\\log_2(n).$\n\nWhy is $\\log_2(n)$ the lower bound? The proof has two parts. First, we have to show that you can in fact get closer and closer to an average cost of $\\log_2(n)$ as you send more and more messages. Second, imagine you could send a $b$-message for $x < \\log_2(b)$ bits, on average. Then you could use $b$-messages to encode lots and lots of 2-messages, which (by the same method) would cost on average $\\log_b(2) \\cdot x$ bits per $2$-message — $\\log_b(2)$ $b$-messages per $2$-message, times $x$ bits per $b$-message. But $\\log_b(2) \\cdot \\log_2(b) = 1$ for all $b,$ which means that, if you could send a $b$-message for less than $\\log_2(b)$ bits, then you could use bits to send more than one 2-message per bit!', metaText: '', isTextLoaded: 'true', isSubscribedToDiscussion: 'false', isSubscribedToUser: 'false', isSubscribedAsMaintainer: 'false', discussionSubscriberCount: '1', maintainerCount: '1', userSubscriberCount: '0', lastVisit: '', hasDraft: 'false', votes: [], voteSummary: [ '0', '0', '0', '0', '0', '0', '0', '0', '0', '0' ], muVoteSummary: '0', voteScaling: '0', currentUserVote: '-2', voteCount: '0', lockedVoteType: '', maxEditEver: '0', redLinkCount: '0', lockedBy: '', lockedUntil: '', nextPageId: '', prevPageId: '', usedAsMastery: 'false', proposalEditNum: '0', permissions: { edit: { has: 'false', reason: 'You don't have domain permission to edit this page' }, proposeEdit: { has: 'true', reason: '' }, delete: { has: 'false', reason: 'You don't have domain permission to delete this page' }, comment: { has: 'false', reason: 'You can't comment in this domain because you are not a member' }, proposeComment: { has: 'true', reason: '' } }, summaries: {}, creatorIds: [ 'NateSoares' ], childIds: [], parentIds: [ 'fractional_bit' ], commentIds: [], questionIds: [], tagIds: [], relatedIds: [], markIds: [], explanations: [], learnMore: [], requirements: [], subjects: [], lenses: [], lensParentId: 'fractional_bit', pathPages: [], learnMoreTaughtMap: {}, learnMoreCoveredMap: {}, learnMoreRequiredMap: {}, editHistory: {}, domainSubmissions: {}, answers: [], answerCount: '0', commentCount: '0', newCommentCount: '0', linkedMarkCount: '0', changeLogs: [ { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '14548', pageId: 'fractional_bits_as_expected_cost', userId: 'NateSoares', edit: '6', type: 'newEdit', createdAt: '2016-06-24 04:29:24', auxPageId: '', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '11178', pageId: 'fractional_bits_as_expected_cost', userId: 'NateSoares', edit: '5', type: 'newEdit', createdAt: '2016-05-27 14:15:29', auxPageId: '', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '11177', pageId: 'fractional_bits_as_expected_cost', userId: 'NateSoares', edit: '0', type: 'deleteTag', createdAt: '2016-05-27 14:15:24', auxPageId: 'work_in_progress_meta_tag', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '11148', pageId: 'fractional_bits_as_expected_cost', userId: 'NateSoares', edit: '4', type: 'newEdit', createdAt: '2016-05-27 02:48:02', auxPageId: '', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '11147', pageId: 'fractional_bits_as_expected_cost', userId: 'NateSoares', edit: '3', type: 'newEdit', createdAt: '2016-05-27 02:46:40', auxPageId: '', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '11127', pageId: 'fractional_bits_as_expected_cost', userId: 'NateSoares', edit: '2', type: 'newEdit', createdAt: '2016-05-27 01:10:20', auxPageId: '', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '11125', pageId: 'fractional_bits_as_expected_cost', userId: 'NateSoares', edit: '1', type: 'newEdit', createdAt: '2016-05-27 01:09:51', auxPageId: '', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '11122', pageId: 'fractional_bits_as_expected_cost', userId: 'NateSoares', edit: '1', type: 'newTag', createdAt: '2016-05-27 01:09:34', auxPageId: 'work_in_progress_meta_tag', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '11121', pageId: 'fractional_bits_as_expected_cost', userId: 'NateSoares', edit: '1', type: 'newParent', createdAt: '2016-05-27 01:08:54', auxPageId: 'fractional_bit', oldSettingsValue: '', newSettingsValue: '' } ], feedSubmissions: [], searchStrings: {}, hasChildren: 'false', hasParents: 'true', redAliases: {}, improvementTagIds: [], nonMetaTagIds: [], todos: [], slowDownMap: 'null', speedUpMap: 'null', arcPageIds: 'null', contentRequests: {} }