"Today's topic: 'encoding'"
Aoi wrote on the whiteboard.
"Encoding...?" Yuki tilted their head.
"It's not food," Riku laughed. "But it does sound tasty."
"In a way, technology for compressing information is 'delicious,'" Aoi smiled.
"Compression?"
"Representing information with fewer bits. Like zip files or mp3."
Yuki understood. "Ah, making file sizes smaller."
"Yes. But have you thought about how compression is possible?"
Riku and Yuki shook their heads.
Aoi opened their notebook. "Let's start with a simple example. Say we want to send the message 'AAABBC'"
"6 characters, so 6 bytes?" Riku said.
"If sending normally, yes. But what if we send '3 As, 2 Bs, 1 C'?"
"It gets shorter!" Yuki noticed.
"That's run-length encoding. Representing consecutive identical characters with counts."
Aoi wrote another example.
"There's an even smarter way. Assign short codes to frequent characters, long codes to rare ones."
"Decide by frequency?" Yuki asked.
"Yes. That's Huffman coding. The optimal way to assign code lengths."
Aoi showed a concrete example.
"In English text, E appears most frequently. So assign E a short code, like '01'. Z rarely appears, so a long code like '10111001'."
Riku thought. "But how do you determine separators? Is '0101' EE? Or another character?"
"Good question!" Aoi got excited. "That's the concept of prefix codes. No code can be the prefix of another code."
"Prefix-free," Yuki wrote in their notebook.
"Yes. For example, if A is '0', B is '10', C is '11', then '010011' clearly reads as A-B-A-A-C-C."
Riku tried it. "0, 10, 0, 0... oh, really. No confusion."
"That's the cleverness of Huffman codes. Uniquely decodable and with minimum average code length."
Yuki asked. "But some data can't be compressed, right?"
"Sharp. Completely random data has no patterns, so can't be compressed."
Aoi supplemented. "Actually, Shannon's entropy determines the compression limit."
"Can't compress below H(X) bits/symbol."
Riku asked curiously. "So if you compress an already compressed file again?"
"Barely gets smaller. Might even get larger."
"Larger?" Yuki was surprised.
"The compression algorithm itself adds header and structure information. Applying compression to nearly random data increases it by the overhead."
Riku laughed. "Encoding is deep."
"It's a practical application of information theory," Aoi said. "Encoding is used everywhere in communication and storage."
Yuki looked at their smartphone. "Is this message also compressed when sent?"
"In many cases, yes. Especially images and videos are heavily compressed."
"Like JPEG?" Riku asked.
"Yes. JPEG is lossy compression that removes parts human vision is less sensitive to."
"Lossy?"
"Compression that can't perfectly restore the original. But it looks almost the same."
Yuki was impressed. "Changing compression rate by information importance."
"Exactly. Judging which information matters is also part of encoding technology."
Riku's stomach growled. "Talking about encoding made me hungry."
"So it did sound delicious after all," Aoi laughed.
"I feel like information also gets more flavorful when compressed," Yuki joked.
"Good metaphor," Aoi acknowledged. "In the sense of extracting essence, it's similar."
Outside the window, the sunset was setting. Communicating efficiently. That's the essence of encoding.