• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 13:28
CEST 19:28
KST 02:28
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun10[ASL21] Ro8 Preview Pt1: Inheritors16[ASL21] Ro16 Preview Pt2: All Star10Team Liquid Map Contest #22 - The Finalists21[ASL21] Ro16 Preview Pt1: Fresh Flow9
Community News
2026 GSL Season 1 Qualifiers25Maestros of the Game 2 announced92026 GSL Tour plans announced15Weekly Cups (April 6-12): herO doubles, "Villains" prevail1MaNa leaves Team Liquid25
StarCraft 2
General
Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun Team Liquid Map Contest #22 - The Finalists Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool MaNa leaves Team Liquid Maestros of the Game 2 announced
Tourneys
SC2 INu's Battles#15 <BO.9 2Matches> GSL Code S Season 1 (2026) WardiTV Spring Cup RSL Revival: Season 5 - Qualifiers and Main Event SEL Masters #6 - Solar vs Classic (SC: Evo)
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
The PondCast: SC2 News & Results Mutation # 523 Firewall Mutation # 522 Flip My Base Mutation # 521 Memorable Boss
Brood War
General
Pros React To: Leta vs Tulbo (ASL S21, Ro.8) ASL21 General Discussion [TOOL] Starcraft Chat Translator JaeDong's ASL S21 Ro16 Post-Review Missed out on ASL tickets - what are my options?
Tourneys
[ASL21] Ro8 Day 1 [ASL21] Ro16 Group D Small VOD Thread 2.0 [ASL21] Ro8 Day 2
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers What's the deal with APM & what's its true value Any training maps people recommend?
Other Games
General Games
Stormgate/Frost Giant Megathread Daigo vs Menard Best of 10 Nintendo Switch Thread Dawn of War IV Diablo IV
Dota 2
The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread European Politico-economics QA Mega-thread Russo-Ukrainian War Thread 3D technology/software discussion Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion McBoner: A hockey love story
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Sexual Health Of Gamers
TrAiDoS
lurker extra damage testi…
StaticNine
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Iranian anarchists: organize…
XenOsky
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2839 users

Harder Math/CS Problem

Blogs > Slithe
Post a Reply
1 2 Next All
Slithe
Profile Blog Joined February 2007
United States985 Posts
Last Edited: 2008-01-23 03:17:08
January 23 2008 03:16 GMT
#1
So this one is quite tough. If you haven't done my first one, I recommend trying that one out first as it's much easier. I actually was not able to solve this one, but several of the possible answers were revealed to me, and I'm confident I would not have been able to solve it even if I kept trying.

I don't expect anyone to get a correct answer, but I think it's a nice thinking exercise to try and figure it out. I recommend contributing whatever ideas you have and discussing it with others. If you do get this one on your own, then mad props.

OK so here's the problem.

You have a randomized 8x8 bit matrix, meaning that all entries of the matrix are either 0 or 1 with equal probability. You are required to flip exactly one entry in the matrix from either 0 to 1 or 1 to 0. The only flexibility you get is that you can choose which entry you get to flip. What you want to do with this matrix is communicate messages to your friend by sending this matrix to him.

The problem is, create a protocol such that you can send the maximum number of messages to your friend.

Now the description might have been confusing, so a few clarifications.
1) Your friend does not know the randomized matrix when you send a message, only you do.
2) You have to be able to send any message from any starting matrix.
3) It might be useful first to try and figure out how many possible messages you can send before trying to create the protocol.

To give an example with a simple 1x2 matrix case. Let's suppose we just want to send 2 messages, Hello, and Bye. The protocol I agree upon with my friend is that if the first index is "1", then the message is Hello. If the first index is "0", then the message is Bye.

[1 0], [1 1] = Hello
[0 0], [0 1] = Bye

It's pretty easy to prove with brute force that this protocol works no matter what random matrix we start with. Any matrix in the 1x2 bit matrix space can become either Hello or Bye with 1 bit flip.


*****
zdd
Profile Blog Joined October 2004
1463 Posts
Last Edited: 2008-01-23 03:45:31
January 23 2008 03:42 GMT
#2
I think the maximum possible number of messages is 2^64, since the matrix is 8x8 binary.
edit: I had a protocol, but it didn't follow specifications cuz I forgot you could only change one bit.
All you need in life is a strong will to succeed and unrelenting determination. If you meet these prerequisites, you can become anything you want with absolutely no luck, fortune or natural ability.
SonuvBob
Profile Blog Joined October 2006
Aiur21550 Posts
January 23 2008 04:01 GMT
#3
I came up with a brilliant solution it in my head, but then I had to go engage in some violence (I work as a bouncer), and now I've forgotten the whole thing.
Administrator
Dr.Dragoon
Profile Joined November 2007
United States1241 Posts
January 23 2008 04:07 GMT
#4
On January 23 2008 13:01 SonuvBob wrote:
I came up with a brilliant solution it in my head, but then I had to go engage in some violence (I work as a bouncer), and now I've forgotten the whole thing.
Yeah, I wrote my answer on a piece of paper, but I had to stop a fight (as a bouncer too), and the paper was missing when I returned.

PS: Do two of the same joke make the joke lame? Or just mine?
~o~ I have returned
mikeymoo
Profile Blog Joined October 2006
Canada7170 Posts
January 23 2008 04:07 GMT
#5
I'm still kinda confused by the description. I can't really say where I'm confused, because I'm confused everywhere.

Could you give another example, maybe greater than a 1x2?
o_x | Ow. | 1003 ESPORTS dollars | If you have any questions about bans please PM Kennigit
zdd
Profile Blog Joined October 2004
1463 Posts
Last Edited: 2008-01-23 04:15:50
January 23 2008 04:14 GMT
#6
On January 23 2008 13:07 mikeymoo wrote:
I'm still kinda confused by the description. I can't really say where I'm confused, because I'm confused everywhere.

Could you give another example, maybe greater than a 1x2?

It's sort of like: "if the matrix has a 1 as the first bit, then it's hello, if 0, then it's bye."
then you get a _random_ matrix like this each time:
10101101
01010010
10101010
01010101
10111001
11010010
10110110
and you can only change one thing, since you've agreed with your friend to only pay attention to the first bit then,

10101101
01010010
10101010
01010101
10111001
11010010
10110110

is "hello"

and

00101101
01010010
10101010
01010101
10111001
11010010
10110110

is "bye"
All you need in life is a strong will to succeed and unrelenting determination. If you meet these prerequisites, you can become anything you want with absolutely no luck, fortune or natural ability.
mikeymoo
Profile Blog Joined October 2006
Canada7170 Posts
January 23 2008 04:23 GMT
#7
Thank you. I'll sleep on this one and get back.
o_x | Ow. | 1003 ESPORTS dollars | If you have any questions about bans please PM Kennigit
Slithe
Profile Blog Joined February 2007
United States985 Posts
January 23 2008 04:25 GMT
#8
OK let's see if this helps. We'll still work with the 1x2 matrix though.

The matrix is completely random, so it has 4 possibilities.
[0 0]
[0 1]
[1 0]
[1 1]

Now what happens is, you start with one of these matrices, and you switch 1 entry, and then send the result to your friend. Let's suppose the matrix we randomly started with was [0 0].

Now, let's use the protocol I mentioned earlier. If I want to say hello to my friend, I should flip the first bit, and make the matrix [1 0]. If I want to say bye, I should flip the second bit, and make the matrix [0 1].

Let's start with another matrix, [1 0].
To say Hello, I flip the second bit to get [1 1].
To say Bye, I flip the first bit to get [0 0].

Now, this is a very simple protocol that only has 2 messages, and it can trivially be used with bigger matrices, but the hope of course is that we can make a protocol that sends more than 2 messages.

Remember that you always have to flip exactly one bit. Also, you need to be able to send any message from any starting matrix.

If you need more clarification, feel free to ask.
jkillashark
Profile Blog Joined November 2005
United States5262 Posts
January 23 2008 04:29 GMT
#9
I have enough trouble with Evil level Sudoku as it is.
Do your best, God will do the rest.
SonuvBob
Profile Blog Joined October 2006
Aiur21550 Posts
January 23 2008 04:31 GMT
#10
Another example (though no more useful) would be to use the parity (whether there's an odd or even number of ones) of the matrix, since you can always change that with a single bit change. That still only gives you two possible messages (even or odd).


Seems like the best max you could possibly get is 64, since there's only 64 choices for a switch.

This reminds me a lot of that prisoner problem.
Administrator
Slithe
Profile Blog Joined February 2007
United States985 Posts
January 23 2008 04:46 GMT
#11
SonuvBob, I think your idea for odd and even parity is slightly flawed, because from a given matrix, you can only get an odd number of ones or only get an even number of ones. I think it's more like, if you have 4n or 4n+1 ones, then it's hello, and if you have 4n+2 or 4n+3 ones, then it's bye.

Your reasoning for the upper bound of 64 I believe is correct.
BottleAbuser
Profile Blog Joined December 2007
Korea (South)1888 Posts
Last Edited: 2008-01-23 04:50:21
January 23 2008 04:47 GMT
#12
SonuvBob, I think that does put an upper limit on the number of possible messages.

I'm guessing that the actual limit is a binary message. Even with only 2 bits, you have to assign 2 possibilities to mean 1 message.

You can't use parity, because you HAVE to flip one bit every message, so the result is random anyways.

And since the matrix is random, you might end up with n 1s to start with. What do you do if you want to say "bye" then?

Er, I misunderstood? It looks like (# of 1s) mod 4 is what you're proposing... hm.....
Compilers are like boyfriends, you miss a period and they go crazy on you.
zdd
Profile Blog Joined October 2004
1463 Posts
Last Edited: 2008-01-23 05:11:07
January 23 2008 04:49 GMT
#13
You could technically use this kind of protocol: "if the first bit is 0, wait for my next message; if the first bit is 1, then count the number of digits until the first instance of '00' "
then just keep generating matrices until you get one that has a an instance of 00 where you want it, and change the first bit to 1. terribly inefficient, but it works

illustration:
say I wanted to send message number 5. I would keep generating matrices and putting the first bit as 0 until I got something like this:
11011001
01010010
10101010
01010101
10111001
11010010
10110110

then I would change the first bit to 1, and counting from the first bit to the 00, you get 5, meaning message 5.
All you need in life is a strong will to succeed and unrelenting determination. If you meet these prerequisites, you can become anything you want with absolutely no luck, fortune or natural ability.
BottleAbuser
Profile Blog Joined December 2007
Korea (South)1888 Posts
January 23 2008 04:53 GMT
#14
If you can throw away a given matrix and randomly generate a new matrix until you get one you want, you could have 2^64 possible matrices, each with a unique meaning, and keep generating until you get the one you want. I don't think that's the problem we're dealing with.

Using (# of 1s) mod m might be the way to go.
Compilers are like boyfriends, you miss a period and they go crazy on you.
zdd
Profile Blog Joined October 2004
1463 Posts
January 23 2008 04:56 GMT
#15
Yeah, but you wouldn't be "throwing away" the matrix in my case, you'd still be sending it, it's just that the 0 as the first bit would translate to "wait for my next message" or something.
All you need in life is a strong will to succeed and unrelenting determination. If you meet these prerequisites, you can become anything you want with absolutely no luck, fortune or natural ability.
BottleAbuser
Profile Blog Joined December 2007
Korea (South)1888 Posts
January 23 2008 04:59 GMT
#16
If you're content with using multiple matrices, then you can make every one count by using the first bit as another bit in a string, with a predetermined byte length. Much better average throughput.
Compilers are like boyfriends, you miss a period and they go crazy on you.
SonuvBob
Profile Blog Joined October 2006
Aiur21550 Posts
Last Edited: 2008-01-23 05:09:25
January 23 2008 05:02 GMT
#17
On January 23 2008 13:46 Slithe wrote:
SonuvBob, I think your idea for odd and even parity is slightly flawed, because from a given matrix, you can only get an odd number of ones or only get an even number of ones. I think it's more like, if you have 4n or 4n+1 ones, then it's hello, and if you have 4n+2 or 4n+3 ones, then it's bye.

Ah yeah, in my head I was thinking of the parity of just one row of the matrix, leaving plenty of ignored bits to pick if you don't want to change the parity. Anyway, either way it's useless other than as just an example, since you only get 2 messages. (Honestly it's not even different from changing just the first bit, but mikey wanted another example :p)

To clarify the problem some more for mikey/zdd/whoever else is reading, you want to maximize the number of possible messages you can relay with one 8x8 matrix. You must be able to do this with any random 8x8 bit matrix.
Administrator
zdd
Profile Blog Joined October 2004
1463 Posts
January 23 2008 05:14 GMT
#18
Oh yeah, my protocol is breaking this rule:

2) You have to be able to send any message from any starting matrix

man I'm stumped.
All you need in life is a strong will to succeed and unrelenting determination. If you meet these prerequisites, you can become anything you want with absolutely no luck, fortune or natural ability.
BottleAbuser
Profile Blog Joined December 2007
Korea (South)1888 Posts
Last Edited: 2008-01-23 05:52:24
January 23 2008 05:42 GMT
#19
You can send at least 4 messages.

If we look at the parity of the first two lines, they will be {(0,0), (0,1), (1,0), (1,1)} for any given matrix.

Now, we can assign signal A = (0,1), signal B = (1,0), signal C = (1,1), and signal D = (0,0).

Also, signal A can be shown as Signal B with the parity of lines 3 and 4 being the same, and vice versa. So, given some matrix M,

x = (# of 1s in first line) mod 2
y = (# of 1s in second line) mod 2
z = (# of 1s in third line) mod 2 == (# of 1s in fourth line) mod 2

Then, the signals A, B, C, and D can be represented as follows:
A = {(0, 1, 0), (1, 0, 1)}
B = {(1, 0, 0), (0, 1, 1)}
C = {(0, 0, 0), (1, 1, 1)}
D = {(1, 1, 0), (0, 0, 1)}

Given any sequence of 3 bits, we can turn them into any of the 4 signals we wish to by flipping just one of these bits. Or if the sequence is one we already want, we can flip something on an ignored line.

I have a feeling that using the remaining 4 lines will be useful, too.
Compilers are like boyfriends, you miss a period and they go crazy on you.
BottleAbuser
Profile Blog Joined December 2007
Korea (South)1888 Posts
Last Edited: 2008-01-23 05:55:06
January 23 2008 05:52 GMT
#20
Huh, using the fourth line is redundant. We can just use the third line's parity for z.

If we map signals in this fashion, we can send 2^(# of lines) signals! Maybe. I dunno how to go about proving it

Given any sequence of 4 bits, we can change it into any of 8 signals we wish to by flipping one of these bits, right? Um... let me think more...

Well duh, 2^(# of lines) isn't right, because it breaks down at 2^3. We still only have 4 signals.
Compilers are like boyfriends, you miss a period and they go crazy on you.
1 2 Next All
Please log in or register to reply.
Live Events Refresh
Next event in 15h 32m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
LamboSC2 260
TKL 159
UpATreeSC 100
BRAT_OK 45
MindelVK 16
StarCraft: Brood War
GuemChi 4736
Larva 448
HiyA 445
Hyuk 183
Movie 105
firebathero 102
Sexy 95
Backho 78
yabsab 51
Sea.KH 49
[ Show more ]
Bale 29
Rock 24
Shine 20
soO 20
Sacsri 19
Counter-Strike
fl0m5098
byalli484
Heroes of the Storm
Liquid`Hasu161
Other Games
Grubby985
FrodaN901
B2W.Neo828
ceh9478
mouzStarbuck126
C9.Mang0113
KnowMe90
QueenE76
Trikslyr54
Fuzer 53
RotterdaM22
Organizations
Other Games
BasetradeTV256
Dota 2
PGL Dota 2 - Main Stream80
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 20 non-featured ]
StarCraft 2
• musti20045 121
• Shameless 7
• Adnapsc2 4
• Kozan
• Migwel
• sooper7s
• AfreecaTV YouTube
• intothetv
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• HerbMon 27
• blackmanpl 23
• Michael_bg 8
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
League of Legends
• Nemesis1975
• TFBlade1099
Counter-Strike
• Shiphtur169
Other Games
• imaqtpie443
Upcoming Events
Replay Cast
15h 32m
Escore
16h 32m
INu's Battles
17h 32m
Classic vs ByuN
SHIN vs ByuN
OSC
19h 32m
Big Brain Bouts
22h 32m
Replay Cast
1d 6h
Replay Cast
1d 15h
RSL Revival
1d 16h
Classic vs GgMaChine
Rogue vs Maru
WardiTV Invitational
1d 17h
IPSL
1d 22h
Ret vs Art_Of_Turtle
Radley vs TBD
[ Show More ]
BSL
2 days
Replay Cast
2 days
RSL Revival
2 days
herO vs TriGGeR
NightMare vs Solar
uThermal 2v2 Circuit
2 days
BSL
3 days
IPSL
3 days
eOnzErG vs TBD
G5 vs Nesh
Patches Events
3 days
Replay Cast
3 days
Wardi Open
3 days
Afreeca Starleague
3 days
Jaedong vs Light
Monday Night Weeklies
3 days
Replay Cast
4 days
Sparkling Tuna Cup
4 days
Afreeca Starleague
4 days
Snow vs Flash
WardiTV Invitational
4 days
GSL
5 days
Classic vs Cure
Maru vs Rogue
GSL
6 days
SHIN vs Zoun
ByuN vs herO
Liquipedia Results

Completed

Proleague 2026-04-29
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
StarCraft2 Community Team League 2026 Spring
2026 GSL S1
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026

Upcoming

Escore Tournament S2: W5
KK 2v2 League Season 1
Acropolis #4
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
2026 GSL S2
RSL Revival: Season 5
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 2026
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.