Sunday, 13 March 2022

The Coloured Barcode - Chapter 3 (Short story)

The group study session was in one of the study areas. Half the class was there already, as well as a few fourth years. Cassie's classmates, the third years, were busy studying. That was to be expected, as a lot of them were a bit stuck on a lot of things that would be in the exam. The fourth years, by the looks of it, were goofing off. The conversation about the advantages and disadvantages of MCQs with negative marking.

"Oh hello Cassie! did you already do these two problems?" asked Anna.

Cassie blinked twice. She had not seen those two particular questions in her life. Anna understood this right away.

"Nevermind, do it now. Lex, you told us you'll teach us about this."

"Hand me the book," said Cassie. It would be good practice if nothing else.

Lex, one of the fourth-years, sighed. "I already taught you this. Look, if you're that overworked, work on your project or something. It's due with the exam, right?"

"No, two days afterwards, plus it's not the same subject," said Jake, one of Cassie’s classmates.

Cassie jumped. "But I already submitted it! The deadline is tomorrow and I didn't want..."

"We got an extension," said Jake.

“You traitor! Why didn’t you tell me?”

Jake shrugged. “It wouldn’t matter to you anyway. What were going to do, run it through a spell check for a fiftieth time?”

Cassie bit back a retort. She could have checked her calculations again and maybe polished the conclusion.

"Wait, about the project, how did you wire the seven-segment display? Four digits is impossible, right?" asked Anna.

"Forget the project - we'll tackle that when we have to," said Jake, "First, Cassie, can you solve this?"

Cassie gave him her best death glare - she was working on the two problems that Anna gave her earlier. She was kept quite busy for some time, solving question after question. As expected, her friends pointed out things that she had almost overlooked. She had no time to think of the cipher, let alone work on it. 

The rest of the class also joined them one by one. Anna was forced to shut up about the project for the time being. The fourth years helped as well - they had an exam the next day, but apparently, it was easy, so they had time to spare.

Finally, they decided to break for dinner. As they got up, Anna turned to Cassie.

"Really, Cassie, how did you wire the seven-segment display?"

"Huh? Did you switch the anode or the cathode?"

"What's the anode and what's the cathode? Which one is connected to which number? Look, explain it to me over dinner. Please? Don't tell me to look it up on the internet - I tried, I honestly tried..."

Cassie rolled her eyes. "Of course you did. Get me a paper and a pen."

Cassie sketched it on the paper. She explained it as quickly as she could. Then she returned to her bag to pack her things. That was when she noticed the slip of paper containing the cipher in her bag. She pulled it out again and looked at what she had decoded.

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

It was definitely base 7. The seven-segment display was essentially seven digits, aka, base seven. This was too good to be a coincidence. She looked at the first entry - 01236. It was not repeated as is, but the same numbers, 0, 1, 2, 3, and 6, were present three times in the code. Not one entry had duplicate numbers. Her theory could be right. She took a piece of paper, and sketched the result, with the numbers 0-6 representing the segments a-g of a seven-segment display.

 Cassie sketched the first digit. It was the segment on top, then the one on the top right, then the bottom right, then the bottom segment, and finally, the middle segment. What emerged was, unmistakably, a 3.

That was better than nothing, but what was a number supposed to mean? She moved on to the next digit. Slowly, a set of numbers emerged.

A set of numbers, 3, 2, 5, 2, 6, 1, 4, 3, 5, 2, 6, 6, 4, 3, 1, 1, 2, 5, 1, 5

What Cassie noticed, instantly, was that the numbers were 1-6. Now there were six numbers instead of seven, she was back to where she started. She couldn't think of anything it could possibly mean. This set of numbers had to be the result – this cipher was incredibly inefficient in terms of the number of characters it took to represent a single digit. 

There were twenty digits – too much for a credit card number, even with the security code attached. If one number was a dummy, it was a possibility, but you’d have to know which number the dummy was. There were too many digits for it to be an account number. Perhaps it was an account number followed by a transaction code or amount.

But would any of them use just 0-6? That would be an insane coincidence.

It could also be a password. She didn't know the admin password in the department's computer labs, but this might be it. But then again, she thought, it was unsafe and ridiculously difficult to remember. It could also be the serial number of a SIM, but why would you even bother sending it to someone in such an obvious cipher? What could you use it for in the first place?

She could go dumpster diving again and find more papers written in the same code, but it was likely too late to do that now. She returned to the study room, still thinking about it.

As she settled down, Anna entered the room. She sat down next to Cassie and picked up a book. Cassie looked at her. She was rifling through the textbook with no real aim in mind. She decided to ask Anna.

"Anna, what kind of number has 20 digits?"

Anna looked at Cassie like she had grown another head. "Come again?"

"What king of number has twenty digits?"

"pi to twenty digits? I know only 3.14 though."

"Seriously, I meant a number that can actually mean something to someone. Our student ID is 8 digits, for example. What kind of number has 20 digits?"

"20 consecutive tosses of a die?" asked Anna.

It took a few seconds for that to sink in. That was it! It was the results from some gambling operation. It was probably run by some students. Then again, she deleted that thought immediately. No one would trust a gambling ring where the results were based on the result of a die if they didn't witness someone tossing the aforementioned die. If they were present, chances were, they'd write it down or take a video of it.

"Cassie, are you aright? I thought you were happy for a second, and then, immediately, you were like, oh, I'm out of battery, where is my charging port. Are your circuits actually fried?"

"Anna, I swear, if you call me a robot one more time, I will toss you out of that window over there."

"That's like, a metre off the ground."

"I'm not trying to murder you. I'm simply trying to be in a different room."

"What are you two arguing about?"

That was one of the fourth years, Bella.

"Cassie wants to know what a twenty-digit number could be," supplied Anna.

"A password created by a robot, a twenty-digit prime number used for encryption, like a key, but then 20 numerical digits is way too short," said Bella, "why?"

"Answers to an MCQ with 20 questions. Or would it be a, b, c, and d? Technically you could convert it to numbers." It sounded like a disembodied voice that sounded remarkably like one of their classmates, Jake. On closer inspection, it appeared to come from behind the bags.

"Yeah, then the numbers would have to be zero to four," said Cassie.

"Then show us the thing you're talking about," said Bella, "you obviously have a specific twenty-digit number in mind."

Anna was a simple airhead, Jake was a prankster, and Bella was a fairly normal nerd. None of them could be involved with the creation of a potentially criminal document. She showed them the paper.

"Hold on, I've seen these numbers before," said Bella, "I can't remember where, really, wait, what did you say, Jake, some time ago?"

"I have been silent for the past..." started Jake but was interrupted by Bella.

"MCQ! It's the answers for the freaking Econ MCQ! Where on earth did you find this, Cassie?"

"MCQ? Wait, what? It's not criminal? Are you sure?"

Anna chimed in. “Wait, you have six answers in an MCQ?”

Bella ignored her. "Where did you find it? Cassie, this could be serious. This could be serious academic misconduct. Where did you find it?"

"I - uh, I have a photo, give me a minute," said Cassie, quickly pulling it up on her phone. 

Was it just MCQ answers? No, that was not possible. She did not pour so much of her heart and soul into finding the answers to an MCQ. It was supposed to be something criminal. True, it was written on the back of a set of printed slides, which in hindsight, looked like econ notes. On the other hand, econ notes didn’t make something not criminal. There was hope yet.

"I knew it!" said Bella, "this is an econ note alright. Wait, where was this written?"

Cassie explained how she broke the code to her. Cassie's head was in a whirl. This could not be. As she was explaining this, Lex walked in. He listened in silence until the explanation finished.

"You actually broke the code? I thought that impossible. That's precisely why I threw it in the bin."

Bella turned and glared at him. Cassie’s heart sank. There was no way Lex would do anything criminal.

"Let me guess. You finished what you could of the paper, you were bored, you didn't want to submit the paper as it was, so you created a cipher just because you could to buy time to go over the paper with a fresh perspective before you handed it in," said Cassie.

"Great deduction," said Lex, "Well, done, detective Cassie."

Cassie blushed. Maybe it was worth it after all.

"Why, thank you!"

 


This is the final installment of this particular story. I hope you enjoyed it. Stay tuned for more of Cassie's adventures (hijinks?).

You can read Chapter 1 here and chapter 2 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!

Tuesday, 8 March 2022

Why daytime powercuts in Sri Lanka is nonsensical

 In short: we get more solar energy than we could possibly use. So why not make use of it?

Yes, there are problems with relying on solar. It's affected by weather. It's not available for half the day. The output is variable. But as a country, Sri Lanka is not affected by this as much as you'd think it is.

First of all  - the not available for half a day thing is consistent here. We don't have short winter days or extremely long summer days. Every day is roughly 12 hours of sunlight (except in super tropical thunderstorm season) and 12 hours of no sunlight. I'll get to the 12 hours of darkness issue later in the article.

The output variability can be an issue, but again, for most of the year, you have at least a few hours of unimpeded sunlight.

So, why aren't we using it?

Land looks like a major issue, but it really isn't. We have lots of open roof space, especially in suburban areas (standalone houses, mostly, whose energy consumption is much lower than what could be generated by solar panels). There's factories with lots of roof space. There is also an additional benefit to installing panels on roofs - temperature control. It would block a lot of heat that would get in through the roof otherwise.

In addition to that, there are streets. Sure, this is a bit more on the impractical side, but you could built slanting roofs over the sidewalk if you want to harness the energy off there as well. As an added bonus, your brain won't fry in the ten minutes it takes to walk to the bus stop.

Then there are train tracks and train stations. As a regular commuter, train stations clearly need more roof to cover the length of those platforms (so that we aren't drenched getting on/off a train in the rain), so why not use it as a side business and generate some electricity at the same time?

The tracks could be used too, as trains are usually a standard size, height-wise, which means you could install panels above the tracks in some clear areas where they don't impede signal visibility. Keeping the vines off them might be a problem though.

So basically, we don't necessarily need more land for this. Use those roofs. They're everywhere.

But the problem here is, even if you wanted to use the roof and install a solar unit for your house, it is pretty expensive and inconvenient. Panels and all that are expensive. Even if you prepared to bear the cost, the approval process for net metering is a pain and takes way too long. If they could reduce this to a couple of weeks at least, people might be more willing to make that investment. And if better loan schemes were available, that would help too.

The night time issue

As you are aware, we don't get any sunlight for approximately 12 hours a day. Can we generate enough power for those 12 h during the day? I don't have the figures, but it's likely. Whether we can store that power is another issue entirely.

Batteries would be way too expensive and polluting. However, we might be able to use our hydroelectric infrastructure to our advantage here and build a sort of water battery. Basically, pump the water upstream during the day, generate electricity as is flows down again at night. It will be lossy, but it's likely to be less expensive and polluting than batteries.

But regardless, it will be a project you would have to give a lot of thought to, so I'll leave this issue there. I might elaborate on this later.

In conclusion

Nighttime electricity generation or storage may be an issue, but for most days, you can generate a frankly ridiculous amount of electricity during the daylight hours using solar power. Therefore, there should be no reason we should be having electricity shortages during the day. 

I am aware that this is a very surface level article, but I needed to vent my frustration about this situation. That's it for now, I might come back and write a more detailed article on this later. 

You can follow me on Facebook here.

See you next time!

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!


Tuesday, 1 March 2022

The Coloured Barcode - Chapter 1 (Short story)

Cassie had always considered herself a budding detective. She certainly researched the subject whenever she could. The problem, however, was that she never encountered anything that would require the use of her deductive skills.  It could be because she chose engineering instead of something at least peripherally related – say, forensics or law or at least psychology – but engineering was the only subject she really liked.

At this rate, that chance would never come, she told herself as she walked out of the exam hall. It was the end semester exams. There was only one exam left, and that was two days away. The previous exam had been okay, but it was formulaic. Some lecturers knew how to make the most boring subject interesting, but this one apparently knew how to make an interesting subject boring. Cassie's mind craved stimulation, and above all, variety. The next exam was two days away, so she would have little time for that.

As she left the building, she stopped to discard the bottle of the juice she had been drinking. As she opened the bin, she noticed a crumpled-up paper there, on top of the PET bottles. She was slightly disgusted, but she decided she didn't want to touch a suspicious piece of paper. She had almost closed the bin when her mind finished processing what was on the piece of paper. She opened the bin again and took another look at it.

It looked like a sheet from a set of printed lecture slides. The subject was probably environmental studies or something to do with biodiversity. That meant that the slides were from a different faculty, or that it belonged to a final year student, who had to take some subjects like that. 

What interested Cassie wasn't the printed content of the slides. The paper had been crumpled hurriedly, so it stood partially open. The edges of the reverse side of the sheet were clearly visible. On it was a set of neatly drawn, thin, rectangular boxes, perhaps 5 mm wide, and about 1.5 cm tall. These boxes were all coloured with what looked like a coloured pencil.

Cassie's curiosity got the better of her. She reached in, took the paper out, and flattened it out. there were almost three lines of these sketched near the top of the reverse side.

A set of coloured bars in black, brown, red, orange, blue, breen, grey, yellow. 109 bars total.

She stared at it a little. She could think of a few benign explanations for this. Someone could have finished the paper really early and doodled on the back of their notes - most exams were open book after all. The neatness could be accounted for by the person in question being a neat freak. Or really bored because they finished the paper two hours ahead of time and the invigilator didn’t let them leave. Still, if that was the case, would they just abandon it half-way, like this person seems to have done? 

The other explanation was that this was a code. Cassie didn't dare take it with her. Was this a plan for some major crime? On her campus? She had to know. Perhaps, it was her calling. Her time had finally come. If she cracked this, she could potentially save a life. Perhaps she could uncover a plan for a theft. It could be something more complicated - like a financial crime. She had to find out.

There was only one thing she could do. She took a photograph of it, and then took another to be sure. She placed the paper back in the bin carefully. She looked around. A couple of students were looking at her. That was no surprise - it looked like she was dumpster diving in a bin that mostly contained discarded notes and food wrappers. She didn't recognize any of them, and they likely didn't know who she was. That was a good thing.

She walked off rapidly. She decided to stop at the canteen for lunch. As she entered, someone called to her. It was a few of her classmates, and a few others from the senior batch. The seniors seemed busy - their test was likely in the afternoon. 

"How was the test?" asked Anna, one of her classmates.

"Easy enough," said Lex, one of the seniors, "right?"

"No, it was quite hellish," replied Cassie, "just let me get my lunch first."

"Let's leave now, Lex," said Rick, another senior, "we need to study in peace. The MCQ will be fine, but we still have to get a few points off the rest of the questions."

"I see, ‘in peace’ and the first person plural in the same sentence," said Bella, another senior.

"Are you being sarcastic? I am not sure I can tell the difference," said Lex, getting up, "alright, guys, enjoy the peace while it lasts. bye!"

This was typical, thought Cassie. Chances were, they were going to keep up the verbal sniping until the exam actually started. She focused on getting her lunch.

After lunch, she returned to her dorm. The next exam was relatively easy. She had studied for it in advance, so she had some time to spare. She started on the colour code she had found.

There was no visible pattern there, as far as she was concerned. Colours were reused, sure, but they were not reused at a regular frequency. 

She counted the number of individual colours used in the sketch. There were 109 coloured bands overall - 14 black, 13 brown, 16 red, 14 orange, 16 blue, 20 grey, 7 yellow, and 9 green. There were eight distinct colours used.

That was highly unusual. First of all, nobody sold coloured pencils in boxes of eight. It was 6, 12, 18, 24, 36, or 48 as far as she knew. The second was the number of lines - 109, a prime number. Either each line stood for a single symbol, or the number of lines in a symbol were variable.

Cassie thought the latter more likely, since there were more grey lines. It could also be a space. Perhaps the symbols were in pairs. Were they octal numbers? Did it translate to the alphabet if taken in pairs? 

There was no other way to find out - she had to try to decode it by hand.

 


Chapter 2 : https://falcon15xc.blogspot.com/2022/03/the-coloured-barcode-chapter-2-short.html

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

You can also follow me on Facebook here.

Until next time!


Saturday, 12 February 2022

Universal translators in fiction - the possibilities

This is yet again another worldbuilding related ramble, this time on how one could implement translator devices in one's sci-fi / fantasy story. This is just my thoughts on the matter, but I hope you find interesting ideas here that you can write about.

You see, I did consider using these in a series I'm working on, but then, I sort of got stuck on the specifics. How would they work? What would be the limitations? 

There are several possible options I could think of, and that's basically what's in this article.

Option 1: Translating between known languages

This is actually available to us right now, which you definitely know if you've tried Google translate in one way or the other. However, there are some interesting questions you can consider with this.

Interpretation

So, this issue happens because generally, languages don't map one-to-one. You probably know this first hand if you speak two or more languages. Example scenarios:

  • Sometimes, the target language just lacks a specific word. 
  • Maybe, the entire concept doesn't quite exist. 
  • Sometimes, one word in one language maps to several words in another. 
  • The meaning of a word could change through context. 
  • Certain grammatical concepts exist in some languages and not in others. For example, you might not look at time the same way in two different languages. 
  • Then there's languages that leave out stuff that's implied, either through grammar (the subject in, say, Spanish) or through context (anyone learning Japanese here?).
  • Some information will have to be conveyed in some languages, but not so much in others (gender in romance languages)

These are definitely not all the possible scenarios, but basically, translating languages is hard. This is partially why you can run stuff through a translator multiple times and get a hilarious result (though to be fair, a group of human translators might produce something equally hilarious in that situation).

The point I'm getting to is that you absolutely can build this into your translator machines. Another option would be to have them point out other possible interpretations when ambiguities exist, which could be ridiculous or ridiculously tense depending on how you play it.

Speech / text / images?

Is your translator device limited to just text? Does the text have to be typed? Can it scan images? Do the scanned images have to be printed or is it successful with handwriting? Does it depend on language?

Another interesting possibility with a translator scanning images is what happens if it reads just part of the image or misreads part of it. What sort of errors will result from it? And, depending on your story, would you be able to twist it into a diplomatic incident?

Speech adds yet another layer of complication. Accents maybe difficult for a translator which can lead to funny or not so funny mistranslations. Homonyms complicate things further. How much of it would be affected by background noise? How good is noise filtration in your translator device? Can it lip read? Would it be able to infer what the missing words are if it can make out only part of what's being said?

Other things to consider would be whether it can read sign languages and other visual languages and produce them in response. Is there a limit to the number of signs it can read? How likely is it to mix up signs? There's the issue of signs that resemble each other here as well. What if your translator robot takes some physical damage? How would that affect its ability it communicate?

All this can result in translation errors again, which can add an interesting dimension to your writing.

Option 2: Translating a language your translator hasn't seen

This is the kind of thing that tends to happen if your characters crash land into a new planet, or if they got blown into an alternate dimension - you can work out the specifics of how your characters got here. What I want to talk about is the interesting implications of this.

For starters, this is the place your universal translator can potentially outshine your human / otherwise sentient translators you have with you, as they'd have to learn the language. On the other hand, you have to figure out how these translators are going to acquire the new language in the first place. Provided you want to deal with it, of course.

Observe and learn

This is the most obvious thing to do in this situation. Your translator listens to / otherwise acquires the new language for a while, and then starts translating stuff that's being said. This raises some interesting questions.

How much language does it need to acquire in order to produce a decent translation? 

This is entirely up to you, but you can approach it in a few ways. You can have it learn more words as the translator is exposed to the target language. You can expedite the process by making the translator capable of tuning into and analyzing several conversations at once. Is it able to infer words that it doesn't know? Does it come up with nonsense attempted compound words in this scenario? Does it just give up? 

How does the translator understand what's being said in the first place?

Extent of translation

There are a surprising number of places on earth named desert desert or mountain mountain or river river. When does your universal translator stop? What are the implications of this? Sure, it could be funny, but what if understanding the other language immediately marks you as the enemy?

The convenient Rosetta stone

This is another possible strategy - have your characters find a sample of the language containing a  known language. Again, you'd have to deal with the vast gaps in your translators knowledge of the language unless you find a lot of text, but at least it'll be a useful starting point and your translator can learn quickly from there.

Magic?

This is one way out of the problem. You could say your translator picks stuff up magically and get over the whole language learning issue. However, this still leaves you with the same issues that you get with translating between known languages, if you want to deal with them.

Some other points

All this is based on the assumption that your translator can capture the type of language that's being spoken in the first place. You can definitely push this - for example, in sci-fi, nothing is stopping you creating a group of aliens who speak in radio waves. This would be very difficult to build a translator for, not because we can't capture the radio waves but because it would be nearly impossible to establish any communication with them until someone figures out they're actually using radio waves. 

Another possibility is these aliens use visual communication, such a a form of sign language which you can't use with human hands, so you would need a translator robot that looks like them. 

The possibilities are endless. You can expand it further if you get magic involved (your imagination really will be the limit here).

In conclusion

Basically, the point I'm trying to make here is, you can make your ridiculously useful / convenient universal translators a bit more complicated / interesting if you want to. These are definitely not the only questions you can ask about these, at all. You'll probably be able to come up with more interesting ways in which a universal translator can fail or cause a scene. 

On top of that, please don't feel any pressure to have to include these issues in your writing, because frankly, a lot of stories don't need them. For some stories, you can just ignore these issues as out of scope / irrelevant to the story / adds nothing to it. For some, suspension of disbelief will allow you to ignore these. Most readers won't think about the specifics of how a translator works unless they're prompted to (unless they're theorizing about how the translators work which is a very specific situation that you probably don't need to concern yourself about).

So, that's all I have to say about this topic for now. If you have anything else to add, or if you just want to discuss this further, please do comment below. 

You can also follow me on Facebook here.

Until next time!


Thursday, 13 January 2022

Worldbuilding – how much of it do you need, and when?

 I've talked about worldbuilding here before, but one thing we should discuss before any of that is the amount of worldbuilding needed for your story.

A disclaimer before we get started: This article is based on my experience writing a fantasy series, and what I've discussed here won't necessarily apply to every writer or every story. 

This article was inspired by this image which was shared in several writing communities:

Image containing text, posted by dontbotherwiththisblogthanks: I am sick and tired of fantasy worldbuilding tips making writing inaccessible your story is valid if you don't know about the classic literature of eastern city folk. Your story is valid despite you not knowing how the garbage disposal of medieval cities work. Stop. Telling. Writers. They can't/shouldn't write until they have everything figured out. Figuring out the world, and knowing what you need, partially comes from writing the story. Not everyone is Tolkien. Not everyone can or NEEDS to know every single detail about the world. JUST WRITE YOU WORLD.

And I basically agree with what this says. 

The problem

In my opinion, the issue mainly comes with many those who give writing advise putting the cart before the horse. Sometimes, they're just telling you how to do the worldbuilding, expecting you to figure out the context and apply it appropriately, which can come off as putting too much pressure on writers. Sometimes, it's just worldbuilding tips being shared, or ideas, which can also intimidate someone considering getting into worldbuilding for the first time.

The thing is, worldbuilding simply can't happen in a vacuum. At least, I know I can't do it. It simply becomes super tedious extremely fast if I have nothing to anchor me to in the world I'm writing about.

For example, say you decide you need a language (one of my favourite aspects to tackle, you may have noticed already). 

How do you create it? You could go ahead and create a language in a vacuum, but the thing is, you will inevitably end up with a language that has a certain character in terms of sound. Then you have to think of the kind of thing these people talk about. You could go with basic phrases that you assume everyone will need to use, but if you have no context to ground you, you'll start floundering fairly quickly, because you simply don't know which words you need to create.

If you succeed and create a workable conlang, good for you, but you've already added a constraint to your story before you've written any of it. You've already decided a lot about how these people view the world, and now, your story will have to adhere to it.

Especially if you've decided to finish your worldbuilding before you start.

This applies to any aspect of a world that you decide to build. For example:

  • Their economy tells you a lot about other aspects of their culture as well, such as relations with neighbouring countries, diets, the level of atmospheric pollution, etc. 
  • Their religion tells you a lot about how they view morality. 
  • How their sewage system works tells you their general attitudes to cleanliness. 
  • Their ancient literature tells you the type of story telling they enjoy. 

You can try this yourself with any other aspect of worldbuilding. Go ahead and try it, it's a fun exercise. Everything – and by that I mean everything you create, every detail you specify, adds another constraint to the story that you want to tell.

It may reach a point where trying to fit a story into this world just becomes impossible.

I'm not saying this isn't possible. It's definitely possible to start writing with some worldbuilding to create an interesting setting. Some genres practically demand early worldbuilding. What I'm advising against is doing too much worldbuilding, or forcing yourself to do too much worldbuilding at the start. 

The possible solution?

My recommended solution: don't try to do it all at once, and you don't need to figure out everything.

Once you start writing, you can do a lot of worldbuilding on the fly. You don't have to know everything about the world you're writing about, because 

  1. Some of it doesn't affect the story in any way, 
  2. Your POV character knows only so much about the world they inhabit
  3. They will only ever know so much about it,
  4. Only so much of it will every affect the story in any way, even if you're using an omniscient POV,
    and most importantly,
  5. You're definitely going to have to edit that first draft.

For example, when I started writing my fantasy series, I knew I'd be using a conlang, I knew I wanted it set in a fantasy setting, and I had a basic idea of the general story themes and the sort of magic system I needed. Everything else  the cultures, the maps, all the calculations about the planet's orbit, the languages  all of that came  afterwards. 

I mean, if I had tried to do it all at once, I would have been bored and abandoned it halfway.

The best part is that the first book is basically finished, but I'm still worldbuilding. I'm adding more details on their religion, specifics of their diet, etc. I'm still expanding vocabulary in my conlang, stuff I didn't need to know the words for in the first book. Neither of these played an important role in the first book, so despite all the extra worldbuilding I've done between books 1 and 2, I haven't had to edit a thing related to worldbuilding.

You see, the biggest advantage in fantasy as a genre is just how much of the world is under your control, at least in my opinion. You control how strong the gravity is. You control the animals that exist in your universe. Perhaps more relevant to storytelling, you control social norms. You design the systems that your MC may have to fight. If you do your worldbuilding as you go, you can adjust your world to suit the story you want to tell. It's also possible to tweak both the story and the world until you end up with a story that you like. 

This process can also be iterative. It certainly was for me. I went three to four rewrites with placeholder names for my characters. While I don't recommend you doing the same (it was probably a stupid idea and I probably need to learn how to plan), iterative worldbuilding gives you the chance to figure out how the elements work together and work on the elements that you really need for your story.

Another advantage to this approach is you don't force yourself to do more worldbuilding than necessary, so you can save some time and effort that way. Or you can do the extra worldbuilding because you enjoy it. At least, the choice is yours.

Also, worldbuilding is a really good cure for writer's block for me. Might not work for everyone. Please follow your muse's advice.

In short, it all boils down to:

  • Start writing your story first. 
  • Start with a few elements of worldbuilding that you need, flesh out the rest between writing
  • Don't make it a chore. Worldbuilding is supposed to be fun.

Please let me know what you think in the comments. I would love to discuss this topic further.

You can also follow me on Facebook here.

Happy Writing, and see you next time!

Wednesday, 10 March 2021

The Playfair cipher


Ciphers are an indispensable tool for mystery, detective, and crime writers.

Most of the ciphers we've talked about here are monoalphabetic ciphers, ciphers where one letter maps to exactly one other letter (The one exception being the Vigenere cipher).

A major problem with monoalphabetic ciphers is that they are very easy to break, especially if you have a lot of text to work with. So, if you have a few short sentences (like in the adventure of the dancing men), it can be quite challenging to the detective, but if the message is a few paragraphs, your detective can probably break it in their sleep.

 With polyalphabetic ciphers, one letter maps to more than one other letter. What this does is it hides the distribution of letters in the text, making statistical analysis difficult (not impossible) and it hides common, short words that give the cipher away, such as ‘the’, ‘a’, ‘on’ ‘in’, ‘is’ and so on. This makes the cipher significantly harder to crack. Of course, a lot of these can be broken by a computer bruteforcing it given enough time, but again, a lot of people aren’t very clear on how to get a computer to bruteforce something.

The Playfair cipher

This is a cipher that has been used for military applications for real in world war 1 and world war II. Of course, with modern computers breaking it in a fraction of a second, it is no longer secure enough for that purpose.

What's interesting about this cipher is that it encrypts pairs of letters, or bigrams rather than single letters. This means, instead of trying to find statistical data for the usual 26 letters, you’d be looking for statistical data for 600 combinations of letters. This makes it impossible to break without a considerable amount of text to start with.

At the heart of the Playfair cipher is a five by five square grid. You’re going to need a key for this cipher to work, so let’s go with cipher because why not? The first thing to do is to fill the grid with the cipher. If there are any repeated letters in your keyword or phrase, skip them the second or third time they appear.



Once that is done, fill the table with the rest of the letters of the alphabet. There are only 25 places in the grid, so you can write only 25 letters. Some people drop Q, or some such uncommon letter, and let the person who deciphers the cipher figure out that the letter is missing (or you can communicate that to them which is probably the better option). I prefer to combine I and J, because that’s what was done with the Latin alphabet in the early days. 

Incidentally, that is why you have 600 pairs – the combinations possible are non-repeated letter pairs as you will see, so you will have 25 choices in your first choice and 24 the second time. This gives 25x24 combinations.


Ciphering

To see how the cipher works, let’s take the following phrase: hello world.

The first thing to do would be to break it into pairs of letters, and separate any double letters. You can use X for the purpose. You can also use it to form a bigram for any letters that are left over like D in this case. You can also use any letter that isn’t common in repeated pairs, like Q, instead of X.

HE LX LO WO RL DX

Now, we cipher it bigram by bigram. The first bigram is HE. Both are on the first row. When we’re dealing with a single row, we replace each letter with the one to the right, wrapping left. That gives EC.

The next pair, LX, is on the same column. This is similar to the last one, as in, we replace each letter with the one below it, again, wrapping up if we have to. Here, that gives us SP.

The next pair is LO. Here, the two are one different rows and columns. In that case, we form a rectangle with the two letters, and each letter is replaced by the letter in the same row as it and in the same column as the other in the pair. This gives GS.


WO is another rectangle, so we follow the same procedure as the previous one: same row, opposite column. That gives VQ (try is out yourself, or look at the video to see how it's done).

RL is another rectangle, using the same process, we get BG.

DX is another rectangle, and again we using the same process to get BY.

So our ciphered message is EC SP GS VQ BG BY.

Deciphering

Once you've ciphered the message, someone has to decipher it in order to read it. To decipher it, we do the same in reverse.

Our first pair is EC.  They’re on the same row, so we replace each letter by the one to left, wrapping to the right if necessary. That gives HE.

The second pair, SP is on the same column, so replace each letter by the one above it, wrapping down if necessary. That gives LX.

The third, GS, is a rectangle, so it’s same column opposite row again. That gives LO.

The fourth, VQ is another rectangle, and with the same process, we get WO.

BG is another rectangle, and again we get RL.

BY is another rectangle, and deciphering gives DX.

The deciphered message is 'HE LX LO WO RL DX'. You can get rid of the X's, and rearrange the spacing, in order to get our original message, ‘HELLO WORLD’.

That is the basics of how the Playfair cipher works. Have fun with it (Maybe try different keys, longer keyphrases, and try enciphering paragraphs for practice). 

That’s it on the playfair cipher for now. If you have any questions of comments, well, mention it in the comments below.

You can follow me on Facebook here or on YouTube here.

See you next time!


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...