Monday 7 March 2022

The Coloured Barcode - chapter 2 (Short Story)

 

There were eight distinct colours in the code. The number 8 had to have a meaning. The first thing that popped into Cassie’s mind was octal numbers – numbers which were base 8 instead of base 10 like normal denary numbers. She had learned these in school and university – well, they had focused more on binary and hexadecimal – but she had learned them. They fit right in, because each digit in octal numbers could only go from zero to seven, so only eight distinct symbols – colours in this case – were needed to represent any number.

Now that she had decided that it was octal, Cassie had a new problem. How was she to convert these randomly coloured lines to octal?

The first and most obvious step was to try statistical analysis. That was the standard approach to cracking any code as far as she knew. She looked at the  number of lines – 14 black, 13 brown, 16 red, 14 orange, 16 blue, 20 grey and 7 yellow and 9 green.

This did not look good. If the roman alphabet was used, the letters would go from A-Z, which would be 0-25 numerically. In octal, it would be 0-31. If this were true, she’d see much more of three colours – the colours that represented 0, 1 and 2 respectively. It wasn’t like it ruled it out, but it didn’t look good.

Cassie decided to test it regardless. Each letter would have to be represented by 2 digits to represent numbers 0-31, or there would have to be a break between characters. The latter seemed unlikely as that would result in about 40 lines in one colour, so Cassie decided to go with the former.

If that were true, the first digit would be the eights place. If the code really went from A-Z, the odd numbered lines could be only four colours - the colours corresponding to 0, 1, 2, and 3. That clearly wasn't the case. Cassie looked at every other line. It was black, red, blue, brown, blue – good so far – then, orange. Nope. That clearly wasn’t the case.

A set of coloured lines divided into three rows, containing 8 colours between them.


If it wasn't just, A-Z, she could try to include numbers, thought Cassie. That would raise the total number of characters to 35, which would be 43 in octal. Cassie looked at the lines after the orange one in the same way, and the very next was green. That was a no again.

Was it the full, alphanumeric character set? That would be 52 letters + 10 numbers, including both upper-case and lower-case letters, which would be 62 characters in total. That would be 76 in octal. If that were true, the second character would be limited to seven values. She counted it. Brown, orange, grey, black, yellow, grey, black, blue, grey, blue, brown, grey, green – that was eight colours, and that theory was down the drain as well.

Anyway, the two characters per letter thing didn’t make sense. The total number of characters was 109, a prime number. If the grey lines were considered dividers between words, that would make the character total 99. Now that was divisible by 3. 

But then, Cassie realized that this was completely impossible. First, If all colours were to have a uniform distribution, this would translate to something close to 777 in octal - or 512 characters. No one would use this many characters in day-to-day writing. Unless it was a language like Chinese, in which case she wasn’t likely to solve it anyway.

Also, if the grey lines were removed, the total number of colours would be down to 7, which would make octal extremely unlikely. Who on earth used base 7 numbers? It wouldn’t matter so much because this person clearly wasn’t trying to run it on a binary system like a computer, but converting it would be a pain.

She tried holding the paper far away, to see whether it looked like anything. Nope, it just looked like a bunch of lines. She tried turning it sideways, still nothing. Was it something wrong with the picture on her phone? She spent the next half an hour carefully sketching it, and then comparing it to the original several times. 

There was no flash of inspiration. Was there something that she missed? Was there something else on the paper she returned so dutifully to the bin? Cassie simple couldn't afford to spend too time on this. She had work to do - the next paper was only two days away anyway. She took her notes out and started studying.

Soon, the words blurred together in her mind. She started seeing the coloured strips in her head, mixed in with the circuit diagrams in her book. That didn't help her with either task.

Finally, she was about to go forage for a snack or something when her phone rang. It was Anna.

"Hey, Cassie, did you do question number 5 on chapter 6? Like seriously?"

"Let me check that - yeah, I think I did. Do you want me to send you the answer?"

"Sure but explain it to me. I don't understand your shorthand."

"Rude. That's not shorthand, that's perfectly acceptable notation you pleb."

"Whatever, just explain it to me. There are two loops..."

"Three, there's three," said Cassie, trying not to sigh, "you forgot the outer one. Look, this resister, the 5.6 k one..."

"Yeah, sure, that's like the proverbial 50 watermelons in maths questions in school," said Anna, "Does anyone even make 5.6 k resistors? What's even the colour code for that?"

"It's green, blue, red, right?" said Cassie, absently, "besides, a) it actually exists, which you would know if you read the textbook, b) they're not going to ask you about resistor codes or the existence of particular resistors, and c) it's an open book test so you can have the notes with you if you're paranoid. Resistor colour codes.... Anna, you're a genius!"

"I am? how?"

"Look, I'll send you the answer, figure it out for yourself."

"About how I'm a genius?"

"Nah, that's irrelevant. I'll explain it to you later - the question, I mean, once you've had a go at it. Bye, I'm busy."

With that, Cassie cut the call and returned to the code. Sure, all eight colours were part of the resistor code. The cipher was found outside the electronics department after all, so chances were, the resistor colour code was the key.

She was so close to cracking this code. What secrets would this discarded piece of paper hold? Would this be her debut as a genius amateur detective?

No, she told herself. Crack the code first, rejoice later. This was still only a possibility. Likelier than octal, but still, just a possibility.

The conversion was easy enough. In resistor code, each colour corresponds to a digit: black translates to 0, brown to 1, red to 2, orange to 3, yellow to 4, green to 5, blue to 6, violet to 7, grey to 8, and white to 9. She converted the code to the corresponding numbers and wrote it down.

The result was:

0123681064385026384631080564328128216583620185203681034682465308325062851268630128128218604318502368218023568

It was still 109 characters, but now it was numerical. It was definitely getting warmer. Unless she was getting carried away.

But no, she was onto something. There were seven numbers alright, but there wasn’t a single violet line. The numbers went from 0-6 and then skipped to 8. If it was resistor code, the code clearly wasn't octal.

The grey lines stood for 8, and there were 20 of them. What if her theory about them had been right about them being a divider? That could explain why a number was skipped and the frequency.

She wrote the numbers again, breaking them by number 8, which was the divider.

01236 10643 50263 46310 056432 12 2165 36201 52036 10346 246530 325062 5126 63012 12 21 60431 50236 21 02356 

The numbers were in groups of 2-6. There were 11 groups of 5, 3 groups of 6, 2 groups of four, and 4 groups of 2. This, again, was highly irregular. It didn’t look like the regular distribution of the lengths on words in English. The numbers all being 0-6 probably meant something as well. 

Cassie was at a loss. Could it be a language other than English?

A text from Anna shook her out of her reverie. It was a reminder to send the answer that she promised to send. Cassie found the question, photographed her answer, sent it, and returned to her studies. She didn't really have to study, but she didn't want to forget what she learned before she actually sat for the exam. 

The code could wait a couple of hours, she decided. She continued studying, mostly uninterrupted, until she received an invitation for a group study session at 6 pm. She decided to go. She was about to leave the code behind, but then, as an afterthought, she stuck it into her bag, before setting off for the library.

 


You can read Chapter 1 here.

The final chapter of this story (chapter 3) is available here.

This is the second edition of the story, the first is on Wattpad :)

You can also follow me on Facebook here.

Until next time!


No comments:

Post a Comment

How to write a character who is smarter than you

We all have that one character (or few) who is significantly smarter than the writer. So, as a writer, how do you write such a character con...