The Inventory Problem
| 11 | 11 | 11 | 11 | 11 | 11 | 11 | 11 | 11 | 11 | 11 | 11 | 11 | 11 |
Melinda threw the clipboard back at Zack. “You expect me to buy this horseshit?” She stormed passed him and through the freestanding double doors that separated front of house from back. Zack grabbed the board, then hustled to catch up.
He found her growling at a stack of oatmeal boxes. “Are you calling me a liar?” he demanded.
She muttered a few seconds more, before whirling on him. “That’s exactly what I’m calling you. There’s 14 boxes here, you didn’t count shit.” Melinda gestured at the storeroom. “Inventory this crap, and get the real counts to me by closing. And say goodbye to your timesheet today, too. I’m not paying you for this.” With that she stormed back toward the front, leaving Zack fuming over his clipboard.
It wasn’t the loss of pay that stung — Zack had tens of millions of dollars, most of it squirreled away in anonymous crypto wallets, all of it earning him millions more each year. This job was just a cover story, a meditative exercise, a false identity. What really maddened Zack was the idea that he was supposed to sit around and count — literally, physically count — boxes of inventory every single day. To use a mind like his, capable of rotating 40 dimensional vectors and intuitively picking cubic plane curves out of bipartite decision space datasets, for computing the counts of big cardboard boxes — it was like using _Joyeuse d_e Charlemagne to chop carrots. Physical labor he didn’t mind — he’d rather scrub toilets than count.
He turned in the clipboard an hour later, ego bruised once again. Melinda smirked at him as she deleted the record of him clocking in from the PoS system. Zack frowned, but then smiled — so she was checking the record personally? Looking for data that matched her expectations? Zack was going to give her exactly what she wanted.
| 7 | 19 | 9 | 9 | 43 | 23 | 29 | 4 | 9 | 11 | 12 | 20 | 17 | 6 | 13 | 12 | 11 |
Zack was sweeping when Melinda came by and threw the clipboard at him again.
“What the fuck was that for?” he demanded.
“June 7th,” she replied.
Zack didn’t respond.
“Don’t play coy, asshole, I checked. You copied the numbers from June 7th as today’s numbers. You did it yesterday too, September 14th. I figured once, it might be coincidence, but twice… well, you just lost another day’s wages. Now go do it properly.” She threw the pen at him as well, then left.
Zack stood stock still, one hand unconsciously spinning the broom on its head. How had she known? She must have a photographic memory to have her suspicions raised like that — he’d tried to pick the most nondescript days possible. He’d bought himself one day free of demeaning tally work, only one day and then he was caught. Was Melinda smarter than she let on? Impossible — why would she waste her time in a dead end job like store manager? For Zack it was one thing, his job didn’t take any real work, but she had to interact with people all the time, nobody would choose that willingly.
Zack spent so much time thinking about Melinda he almost didn’t notice inventorying go by. He got to the end of the daily row and stared at the page, thinking. Beating photographic memory was a trivial task. A normal human might be cowed by such a talent, but to him it was a mere party trick. Fundamentally, it changed nothing. He wouldn’t count again.
| 8 | 17 | 10| 8 | 43 | 21 | 28 | 5 | 9 | 13 | 10 | 21 | 15 | 4 | 12 | 12 | 9 |
Zack was watching her approach, and this time he was in control. He flexed the fingers in his right hand, loosening his extensor pollicis longus, clenching and releasing his tricep to stimulate blood flow. Her arm came up holding the clipboard, and he shifted his weight in preparation to snatch it out of the air. Their hands moved at the same time — his snapping up like a released spring to the space in front of his head, hers twisting at the last second in a wicked arc to curve the clipboard down and to his left instead. It hit him in the shins, and he yelped in surprise. Somehow she’d predicted his movement, or else seen it coming and adjusted on the fly. He wasn’t sure which was more impressive.
“What?” he yelled at her.
“You faked the numbers again, asshole, is what,” she said.
“How do you know,” Zack said, rubbing his bruised shin, “did you count them yourself?”
Melinda pulled out a piece of paper, an old inventory sheet. She picked up the clipboard and put the old one under the new one, so that she could compare row-by-row. She folded the new one at the most recent entry, the record Zack had just filled out, and slid the old sheet until she had it at the row she wanted.
Zack didn’t even look at it. “They don’t match. You’re losing it.”
Melinda snorted. “Look at this:”
| 7 | 19 | 9 | 9 | 43 | 23 | 29 | 4 | 9 | 11 |...
| 8 | 17 | 10| 8 | 43 | 21 | 28 | 5 | 9 | 13 |...
“You even used the same June 7th data.”
“No idea what you’re talking about,” said Zack.
Melinda rolled her eyes, then folded down another row of the new sheet, so there was a blank row between the new and the old. Then she scribbled with the pen, filling out each cell. Finally she showed him the new configuration, which looked like this:
| 7 | 19 | 9 | 9 | 43 | 23 | 29 | 4 | 9 | 11 |...
| 1 | (2)| 1 |(1)| 0 | (2)| (1)| 1 | 0 | 2 |...
| 8 | 17 | 10| 8 | 43 | 21 | 28 | 5 | 9 | 13 |...
“A random 2-shift? That’s your big idea to pull one over on me? This is trivial, Zack. You should be embarrassed.”
Zack stared at the rows. How had she seen it? This was beyond mere photographic recall. “How…”
Melinda sniffed. “I scripted multiple listeners to compare new data to old rows with varying tolerances for noise — one which only flagged exact row matches, one which flagged matches in plus-or-minus one, one for plus-or-minus two, so on and so on. I ran them on verified historical data to establish a baseline for the number of false positives to expect for each noise level — it’s not very high. Inventory is a high variance thing around here. Then every day I took the numbers you wrote down and fed them into my script. You were tripping my four-, three- and two-tolerance listeners every day. I let you run with it for a week, just to collect enough data to be certain I got you. I got you. Now go take inventory for real.” She shoved the clipboard back at him.
Zack was flabbergasted. He didn’t know what to think. Was that true? And if so, why? “Why?” he asked. “Why not just spot check me? Random audits would be far less work than…whatever this is.”
Melinda narrowed her eyes. “Because I see the way you look at the rest of us every day. You think we’re all impossibly stupid, too stupid to do anything but a shit hourly job. You look at us like a cat looks at flies. You think you’re so fucking clever that you’re better than everyone else. Well, you’re not. I’m not just going to make you do your job — I’m going to prove that you deserve it. You’re just as much in the shit as the rest of us. You think I’m a washed out loser? You think I wanted to be a fucking store manager at 33? If you can’t outsmart me then all you’re good for is counting boxes.”
Melinda left — Zack barely noticed her going. He thought for a long, long time.
| 6| 12 | 2 | 13 | 23 | 48 | 25 | 6 | 9 | 17 | 11 | 11 | 12 | 13 | 9 | 17 | 10 |
The next week Zack redoubled his assault, beginning with EDA. He could see that the data was complex, involving subtle nuances of demand surge, seasonality, correlated purchases and random, unpredictable factors, but he didn’t have time to analyze all of that right away, so he started by simply modelling each item quantity as a random variable. That lasted about four days until Melinda caught him, pointing out that pallets of baked beans were up despite no shipment arriving that day. Once he had the shipment schedule accounted for she got him with time series dependencies — a feature that was obvious, but that he hadn’t had time to encode yet. Two days later she pointed out a weekend demand for beer that his model didn’t replicate well. Her next victory over him was via a timeshifted correlation between banana and flour purchases — people making banana bread once the fruit they bought started to blacken. However, the intervening time had allowed him to build a generative model that accounted for variable correlations, and that allowed him to go undetected a few more days, until she threw the clipboard at him again, with a newspaper clipping on it. The story was about a lettuce recall due to salmonella — the entry he’d faked claimed they bought and had delivered 8 boxes of fresh salad.
“There’s not a head of iceberg anywhere in the tri-state, jackass. Go count.”
They went on like this — him improving his data forging methods, her improving her forgery-spotting methods. Whenever she won he would have to endure the inventorying process again. Whenever he successfully tricked her he would be able to spend the day on more Zen tasks, like cart return. They quickly ran out of easy gotchas — figuring out how to incorporate outside information like news reports into his model had been tricky, and he still occasionally got burned by unforeseen circumstances, but soon their contest became one of subtle improvements, new generative methods, more sophisticated statistical analysis.
Several times he went on such a winning streak that his patently fake numbers completely diverged from the real tally, and they would run out of something, or order so much that it went bad. Melinda didn’t seem to mind this. She would make orders based on the numbers Zack gave her, and only when she caught him in a mathematical mistake would she reset and get the correct tallies. Their battle of wits went further, into information theory — Zack’s models were still too regular, and Melinda would throw papers with entropy values and Fisher calculus at him, crowing with delight. His models were based on complex permutations of random numbers, but there had to be regularity as well — pure randomness was too predictable, she could spot that a mile off, he needed to be less predictable than random, and the problem was driving him insane.
The battle consumed him. He forgot about his investments, and they languished in mere double digit returns. The question of how much inventory was in the storeroom — a deceptively simple one — quickly unfolded into one of incomprehensible complexity. Inventory was determined by two factors, purchasing and sales. Purchasing was done based on inventory itself — trivial — and corporate directives — interceptible. That left sales. But sales was impossible to model completely — thousands of people walked into the store every day, and purchased tens of thousands of items. They would buy habitually, but sometimes they would change plans, or have a special dinner, or go to a restaurant instead, or have a cook-out, or go out of town. That happened with somewhat-predictable frequency, sure, but then what if there was a sale on olives? Not only would it change demand, but it would change entirely differently than a sale on ground beef, or a sale on bread. Correlated products would change in value as well, making the problem even worse. A pizza shop opened next door, and Zack struggled to catch up with the new dynamic in soda sales. A local plumber put up a billboard with a picture of a turkey on it, and Zack was caught flatfooted by the increased demand for deli sandwiches. The tides turned when he correctly predicted that the release of a critically-panned fat comedy would have people dropping chips for salad, but then he was on the back foot again once the same movie released to streaming, and people redoubled their popcorn purchases to eat shamefully in the privacy of their own homes.
Every single element of the outside world, from the daily weather to the war in the Middle East, could all influence the sales of products inside the store. If it was a small change he could sometimes outlast it, but often small changes snowballed into big ones, and somehow Melinda seemed able to predict them before him.
She began to return rejected inventory rows to him with her own predictions for the correct values next to them. Then, when he went to do the tally, he had to suffer the combined indignity of not only counting, but finding that she had correctly predicted the final number more often than he. She was not only beating him at detection, she was beating him at his own game of falsifying records. Zack ran himself ragged — he rented out a full time supercomputer for 24/7 compute to attack the problem of building a better model, then another supercomputer to run the actual model on. He had no idea how she was beating him — it was insane. It was impossible. How was she noticing things he didn’t? What did her model look like?
| 9| 15 | 21 | 18 | 33 | 43 | 28 | 8 | 9 | 11 | 17 | 15 | 24 | 5 | 15 | 7 | 14 |
Melinda threw the clipboard. Zack casually snatched it out of the air and threw it back at her.
She stared at him, indignant. “Excuse you?”
Zack remained perfectly calm — his breathing was light, his heartrate a cool 71. “Those numbers are correct. You can double check them, if you’d like, but there’s no way they’re wrong. Whatever feature you think I missed, whatever quirk you came up with, you’re mistaken. My numbers are 100%, mathematically guaranteed to be accurate. It’s impossible for me to be wrong.”
Melinda picked up the clipboard. She left to the back room.
Zack waited. His heartrate rose to 72.
Melinda came back. She seemed subdued. The clipboard with the inventory sheet on it was in her hand — Zack couldn’t see any additional marks on it. “You’re right,” she said. “Your generative model was right. You got every single inventory count correct without looking. Amazing.”
Zack allowed himself to grin. He closed his eyes, and turned his face toward the drop ceiling. Finally, after so many months of pitched warfare, scientifically proven victory. He felt giddy. The air tasted sweet on his tongue. He felt the weight of mania slide off his shoulders like a heavy mantle. He was free. He had done it.
“Can you send me your model?” Melinda was asking him. “I’d like to compare.”
“If you show me yours,” Zack murmured, barely paying attention. His world was unfolding into infinite possibilities again.
“Let’s do it now,” said Melinda. She had her phone out.
Zack came back to himself, and pulled out his own phone. They established a mutual handoff on-chain in a matter of seconds. The next minute, on the minute, the transaction went off — Zack’s model code was forwarded to Melinda’s server, and her code was copied to his.
“Thanks,” she said, putting her phone away. “I guess this means you don’t have to count inventory any more.”
Zack laughed. Then he laughed some more. “No, no I do not. I never will.”
“No,” she agreed, “you never will.”
Zack spent the rest of the day in a state of rapture, drifting between aisles, daydreaming about all of the brilliant encodings he’d devised over the months, breathing in the sweet scent of epsilon-tolerances set daringly low. He was so happy he forgot to clock out. He just stole a bottle of blueberry-kale smoothie from the refrigerator aisle and walked out the door. The day was still young when his shift ended, a bright sun burning merrily in between light fluffy clouds. The seasons were changing, leaves just beginning to turn, but most of the trees were still vibrant greens, and the world popped with color. Traffic on the road was light — Zack rolled down his windows and let the wind play with his hair. He arrived home tousled, but satisfied. He let himself into the house, then out his back door onto his patio. There, he pulled up an outdoor chair, cracked open the smoothie, and began to read the latest issue of IEEE Transactions, which he’d not had time to get to until winning the inventory war.
Several hours later, Zack was lying in bed, thinking about what the next day would bring. Would Melinda dare challenge him again? Would she take his model and try to beat it now that she had the source code? Zack found it unlikely — his model was damn near perfect, and he’d only given her the final product, not the method he’d used to build it. Still, he wondered how she would move next, or if she would finally admit that he was the smartest. Suddenly curious, he hopped out of bed and woke his home computer.
He SSHed into the standalone server he’d told Melinda to send her model to, and opened the main directory. He thought she might send him a virus instead, or maybe a bunch of junk, but only one folder sat on the server. He opened it to reveal nothing but a text document titled “README.mel”. Unsure of what to expect, he opened the file.
zack,
apologies in advance that i can't give you my full predictive model.
see, i am the model - i wasn't really outpredicting you on the
inventory, i just did that to motivate you to do better. i was counting
inventory myself. sometimes i would really have a statistical problem
you'd missed, other times i just compared your numbers to the real
thing, found a discrepancy, and then made up a reason why the two might
be different. half of the times i caught you were like that - just
making up reasons after the fact. like when that pizza shop came in? i
had no idea how that was changing soda sales, or whether it was at
all - i just said that to get you to work it in to your own predictive
model. it was a bitch for you i'm sure, but you did it. you did it
all. every single factor that can possibly influence sales, or supply,
all without ever touching store data on sales made or inventory
purchased, so corporate will never know.
basically i made you design a super sophisticated machine to calculate
inventory without any employee having to touch it or know about it. it
will just run forever, doing the job perfectly. nobody has to know
about it but us. you just engineered yourself out of a job. what was it
they say? work smarter, not harder?
i'll be collecting your paycheck from corporate on the model's
behalf, god knows half of it is going to server costs anyway. thanks
for the raise, zack. don't bother coming in to work tomorrow.