9 ms·
Optimal Peanut Butter and Banana Sandwiches
- merciBien 6y agoThis might be my favorite post of the year. Powerful technology and years of experience focused on an important problem. Thanks making my day!
- greenie_beans 6y agowhere is the bacon? https://en.wikipedia.org/wiki/Peanut_butter,_banana_and_bacon_sandwich https://en.wikipedia.org/wiki/Peanut_butter,_banana_and_baco... aka the elvis sandwich
- zanussbaum 6y agoThis made my day
- hprotagonist 6y agoMy optimal is a tortilla, banana, peanut butter and honey tube wrapped in parchment paper or aluminum foil. it's one of the few sandwich formats that tastes better squished, and it stores very well, so it's kind of the ideal food for stuffing into your bike jersey or ski jacket and eating on the go.
- kyleee 6y agoDon't forget the butter
- lowbloodsugar 6y agoMine is banana, honey, vanilla ice-cream, dark rum, no bread or peanut butter, and a blender.
- hprotagonist 6y ago"i stopped for lunch halfway through my bike ride and i'm still here!"
- schwartzworld 6y agoPeanut butter would be nice in that though
- cwkoss 6y agoI got a bag of peanut protein which is quite nice to add to shakes, recommend it for peanut butter lovers.
- Balvarez 6y agoI love this post...I also love his wife's answer of cut the banana long ways
- legitster 6y agoI love this as an analogy for how most tech problems we solve. Just because a solution is advanced does not mean it's the best.
- protomyth 6y agoI think the urban legend version of this is "just wear gloves"[1]. I do not understand the whole bread and bananas thing. Do as the wife says and make a slice down the middle. add peanut butter and put the two halves back together, and slice in segments. No bread is best. 1) http://thedailywtf.com/articles/The_Complicator_0x27_s_Gloves http://thedailywtf.com/articles/The_Complicator_0x27_s_Glove...
- sdenton4 6y agoYeah, my grandmother would mash the PB and banana together into a delicious, homogenous mush and then spread that one the bread. Thanks to the magic of imprinting, I believe this is the Correct way to make a PBB, and if you disagree, I'll cut you. Despite its obvious optimality, the Homogenous Mush approach creates extra dishes. So, as a lazy undergrad, I used the circles method for a long time. Sometime in grad school I had the long-cut epiphany, and tend to do that most of the time now. (The other downside of the circular method is that they're more likely to try to jump out of the sandwich, since they have less contact area.) Oh, and one other solution, which is great for long bike rides: Switch out the bread for a flour tortilla, and throw some honey in the mix as well. Fits in an undersaddle bag and beats the hell out of a clif bar.
- batch12 6y agoSpeaking of Grandmothers-- my Grandmother didn't bother with the peanut butter. Instead we had banana and mayonnaise sandwiches. I remember loving them as a kid, but I haven't had the guts to try them again as an adult.
- saalweachter 6y agoI initially assumed the challenge was to fit the entire banana on the bread in a single layer; I am disappointed that problem was not solved, but it seems like it should be a relatively trivial extension of the package provided (produce a packing for [N, M] slices of banana, pick the number of slices which covers the bread without any left over pieces). (Of course, as someone who does not eat banana sandwiches, I have no idea of such an end is even desirable.)
- pipecork 6y agoIt'd be a very tall sandwich! The preferred solution is just eat the rest of the banana, or pawn it off onto a significant other.
- pliny 6y agoIf you want to make a PB&B that uses the entire banana, simply peel the banana, coat the flesh in PB, tear up your bread slices and adhere them to the banana. This method is not guaranteed to use all the bread.
- vermarish 6y agoThis method may also compromise the structural integrity of the banana after trying to spread PB on it.
- jholman 6y agoI agree, pliny hasn't thought it through. Smear peanut butter on the bread, NOW tear up the bread, and apply the peanut-butter-smeared shreds to the (peeled) banana. Still the same primary advantage as pliny's method, same primary drawback (may not exhaust the bread), but we've solved the structure problem that you raise. I feel the trend-line here is looking good; with a few more iterations, we may reach the true ideal PB&B sandwich.
- glxxyz 6y agoI thought this too- the solutions presented didn't feel 'optimal' for real word peanut butter and banana sandwiches.
- klyrs 6y ago> If you were a machine learning model (or my wife), then you would tell me to just cut long rectangular strips along the long axis of the banana, but I’m not a sociopath. Ignoring that you called your wife a sociopath for the moment... I'm one for peanut butter and pickle sandwiches, personally. I've made some danged optimal ones, too, slicing them lengthwise. Pickles are interesting because you can bend them and make a curved cut with a straight knife, and the slice lays flat. And then your packing problem has an added constraint because the slices are beveled. You need a smaller number of slices, so picking the proper thickness is actually the hardest part. Of course, I eat my mistakes, so the reinforcement phase is rather busted. Slice 1 in your final packing typifies my complaint with slicing on the round: it will fall out of the sandwich. This is especially true with pickles. Lengthwise slices result in a more structurally resilient sandwich. OTOH bananas do have an easy mode: smash and spread. If your wife was actually a sociopath, that's probably what she'd do. But maybe just don't badmouth your wife; our industry has a misogyny problem and that's an ugly pattern.
- cvs268 6y agoLooking at the snapshots in the article, in the middle of all this tech to optimally fit the banana slices, the dude forgot to apply peanut-butter!
- nickff 6y agoPeanut butter is visible in the last picture, which is the only one where he has actually placed the banana slices. I am not sure whether it is best to apply peanut butter to both slices or just one; I would suspect both, but we may not be seeing a finished product.
- jimbob21 6y agoThe last picture has both the peanut butter and banana slices.
- jasonv 6y agoI prefer jelly/jam for PB&J sandwiches on bread, but long-sliced bananas when I'm making rice-cake PB&banana snacks. Round rice cakes & curved bananas are a different issue.
- beervirus 6y ago> I also take the slices in the image above to represent the major axis of the banana slice ellipse, and assume that the minor axis is 85% the size of the major axis. I don’t think they’re really that elliptical in practice. Banana slices are nearly circular.
- chrisseldo 6y agoWhat about halved banana slices? The last image shows some prime real estate for a half of a slice!
- earthboundkid 6y agoI think subdividing the slices makes the problem trivial: cut each slice into a "banana pixel" and then tile the whole thing. That's no fun though.
- deleted 6y ago[deleted]
- sammorrowdrums 6y agoI always mash the banana on. I find it has a nicer texture than slices somehow. I also recommend toasted "wheaten bread". A form of wholemeal soda bread popular in Northern Ireland. https://www.thespruceeats.com/traditional-irish-wheaten-bread-recipe-435804 https://www.thespruceeats.com/traditional-irish-wheaten-brea... [Edit] add word toasted.
- silexia 6y agoI also mash the banana with peanut butter, but instead of putting it on bread, I put it on steel cut oats. Then add a small amount of milk and mix. Finally, top with honey.
- cmckn 6y agoAs long as there is no mayo involved, we're good ;)
- cperrine 6y agoI grew up making PB&B by mashing the banana and peanut butter together in a bowl, tuning the ratio to taste at that time, and then applying the mixture to the bread. I'm starting to think maybe this was not the usual way?
- sammorrowdrums 6y agoNever encountered that! Interesting approach.
- leche 6y agoFirst off, I love this project. I would modify the fitness function to do something like subtract from the score the area of the largest circle which could be drawn over a bread-only section. This would deal with your having a very unsatisfying empty bottom right corner in your last example.
- jpm_sd 6y agoWhile this is delightful, my favorite method is to make banana bread, and make peanut butter sandwiches out of it.
- cwkoss 6y agoWhy not slice the bananas longways? Could probably achieve more efficient stacking?
- TN1ck 6y agoHe just doesn't want to: > If you were a machine learning model (or my wife), then you would tell me to just cut long rectangular strips along the long axis of the banana, but I’m not a sociopath
- pipecork 6y agoAddressed in the fourth paragraph. Much like how sandwiches taste better when cut into triangles, circular banana slices are the way to go.
- bloomingeek 6y agoFor the ultimate PBB experience,after assembly into standard sandwich form,grill said sandwich like a grilled cheese. After removing from the pan, spoon spread a mixture of cinnamon and sugar (small amount is my preference)and consume with a fork. The PB and banana are slightly melted. You could become addicted!
- yakk0 6y agoI've never thought to add the cinnamon and sugar, but I'm a big fan of the grilled version.
- ericmcer 6y agoWow this guy can really see something through to the end. I have had some good ideas that I give up on once things become complex but he carefully saw this “meaningless” but super difficult project through from beginning to end. That alone is a sort of sacred skill, regardless of the task.
- thehappypm 6y agoThis is something I struggle the opposite of. When I dive into something, I get super focused, to the point of it severely disrupting my life. I had a few projects in grad school that kept me up for like 2 days straight even though they weren't due for a few weeks. I think the author has that same level of manic focus. It's honestly why I can't be a programmer, it's not that I can't write good code, it's my head space. I can't achieve a level of Zen that all the great programmers seem to have, I get super super focused, and then too emotional.
- 0-_-0 6y agoI think you just described genius. Hope you're using it for good.
- ericmcer 6y agoThat sounds like a gift haha. It would definitely not work well for most programming gigs (sprint style, kanban board, small estimated tasks with regularly reported progress), but in the right niche you could do stuff that most of us can only dream of.
- Gene_Parmesan 6y agoAs someone with ADHD, this sounds like an ADHD symptom called hyperfocus. Note I am not trying to e-diagnose you with something, I'm just comparing the similarity of your description to the description of an ADHD symptom, not saying I think you have ADHD. I make that comparison because if you do a search for hyperfocus, you may be able to find strategies to help you break out. For me, hyperfocusing can be so strong that hours will pass with me barely noticing. I often say that the house could burn down around me and if I am hyperfocusing, I'd be toast. I don't get it for multiple days as you describe, but it's not unheard of for others. My dad is a metallurgical engineer, and described something basically exactly the same to your experience with programming. He had some lab course involving programming freshman year and stayed in the lab for 24 hours straight obsessed with a project. When he broke out of the 'trance,' he realized that he could never be a programmer full time because it would completely take over his life. For others who maybe aren't familiar with this feeling, it is most definitely NOT a pleasant feeling. I always come out of that state feeling almost sick to my stomach, headachy, dissociated. Not something I enjoy, and not really something I can direct to be more productive. ---- (Note that it may sound odd to describe hyperfocusing as an ADHD symptom -- isn't ADHD about a deficit of attention? But actually ADHD is kind of a misnomer; a better name might be "Executive Functioning Disorder." ADHD is more about being unable to direct or control your focus, and this can work either way -- to make you appear less focused, or severely over-focused. In particular this symptom is not a side effect of medication, and in fact medication can help to break out or prevent you from being sucked in in the first place.)
- 6DM 6y agoYou could take the chef approach by picking straight banana's and squaring them off first. The sizing would be pretty consistent, the leftovers can go in a shake, or frozen for a smoothie later and you would have a higher percentage of perfect coverage :)
- glxxyz 6y ago+1 for freezing leftover bananas. Freezing ripe bananas just before they over-ripen is the greatest life hack I ever learned. I can't believe it took me so long to stumble on it. Slice ripe bananas into a reusable sandwich bag, pretty much in a layer (not a frozen clump) so you can break off a part of the layer, and freeze. Later semi-defrost and throw in a smoothie or protein shake. Never throw away an over-ripe banana again.
- davycro 6y agoI am an emergency physician without any formal software training and for the last three months I’ve been trying to build a program that segments the wall of the heart from an ultrasound video and then identifies regions that aren’t moving (an early sign of heart attack). There are many similarities between this man’s project and mine. And if I had his knowledge I may have cracked my problem by now and would have new way to detect heart attacks early.
- newsbinator 6y agoPlease post your contact info in your profile so that folks can reach you. Hopefully one of us can help.
- floatingatoll 6y agoOP is the author of the post, in case that helps any.
- davycro 6y agoDone. Appreciate it!
- TaylorAlexander 6y agoIn addition to posting your contact info please also check out this course designed for people from other fields who want to learn machine learning. https://www.fast.ai/ https://www.fast.ai/
- TaylorAlexander 6y agoWow I sometimes I understand the downvotes but this one doesn’t make any sense...
- tln 6y agoAgreed! Thanks for posting this
- 6y ago
- samatman 6y agoThough this be madness, yet there is method in 't. I'm impressed, but also, I really hope the author is doing ok. This has been a tough year for everyone.
- 131012 6y agoI hope you're doing ok too :)
- enobrev 6y agoExcellent project. Very well written and executed. Love it. I've found that I can get excellent consistency in coverage by slicing the banana vertically to get long rectangular slices and then laying the slices side-by-side - generally about 4-5 across.
- smith-kyle 6y agoYou're an animal
- nhoughto 6y agoHe addresses people like you: If you were a machine learning model (or my wife), then you would tell me to just cut long rectangular strips along the long axis of the banana, but I’m not a sociopath.
- munificent 6y agoOver many years, I have highly optimized my PB&B production process: 1. Apply peanut butter to bread. (Copious amounts. I prefer Adam's.) 1. Peel banana and cut length-wise. Place one half across top of bread where the loaf curves. Use curve of banana to match curve of bread. Cut off part of banana that hangs off. 2. Invert other half of banana and place it parallel to first piece, slightly tucked under. Cut overhang. 3. Take the two overhanging pieces, and place them next to each other on the remaining third of the bread. With a properly sized banana and loaf, this provides almost perfect uniform banana coverage, requires only three cuts, and dirties only one knife.
- grumple 6y agoLots of effort to arrive at the wrong answer! An optimal pb + b sandwich must contain not just circle pieces, but pie slices of circular slices at well. All those gaps left by the circles could be filled with little fractions of circles.
- h2odragon 6y agoBah. no 2 dimensional model can be taken seriously here, the problem is 3d and therefore much more complicated. insert $500k grant proposal
- amelius 6y agoThat's not optimal. Looks like the deep learning enthusiasts are now deflating the meaning of accepted mathematical terminology.
- alwayshumans 6y agoThe problem of finding the Centreline of the banana is similar to an issue you get in the GIS domain when rivers are captured as polygons. Although it's not a straightforward process a series of Vorononoi polygons makes a pretty good Centreline. I think it might work for bananas. https://gis.stackexchange.com/questions/318721/creating-centerline-of-river-in-qgis https://gis.stackexchange.com/questions/318721/creating-cent...
- m3kw9 6y agoAs expected scientists never talk about the actual taste. You probably want ripeness and the peanut butter/banana sugar ratio to make sure banana flavour doesn’t overwhelm the entire taste profile.
- pugworthy 6y agoI would suggest further optimization, in that one should choose from ALL slice segments for the optimal coverage. We all know if nobody eats the rest of the banana right away, it's just going to go bad. Sure you think you'll make banana bread later, but you won't.
- bluedino 6y agoSauté the banana slices in caramel, serve inside Cinnamon and sugar coated, lightly toasted and buttered brioche, with Sugary peanut butter like jiffy/skippy Dip in honey. Enjoy with a glass of milk or cup of coffee
- azinman2 6y agoHow do you sauté in caramel? Caramel isn't a fat. Boy that sounds like sugar on top of sugar on top of sugar.
- timbit42 6y agoMy father solved this problem before I was born in 1969. Peel the top of the banana as if you are going to eat it. Put peanut butter on the knife and wipe it on the top of the banana. Take a bite. Continue until the banana is gone. Ignore the bread. It more keto that way anyway. If you really want to use the bread, mash the banana and spread it on one slice, spread the peanut butter on the other and put them together.
- alanbernstein 6y agoThere's something just a bit different about the sensation of biting into a slice of banana, though.
- smegger001 6y agoOr most optimal spread peanut butter on slice of bread fold bread around banana like a hotdog bun.
- santoshalper 6y agoAs god is my witness, I really assumed this was going to be some kind of metaphor until I was a couple paragraphs into the story.
- deepGem 6y agoTotally unrelated but my current favorite breakfast is a peanut butter banana milkshake. < 2 mins prep, well balanced and doesn't ruin your tastebuds. Add some protein powder if needed. The bestest breakfast on earth.
- ianai 6y agoWait until they’re so ripe they can be spread like butter.
- Stratoscope 6y agoI love a good PB&B, but I'm with the other commenters who just smash the banana onto one of the slices of bread. Lately my go-to PB&* sandwich has been peanut butter and kale. Yes, PB&K. Toast the bread, spread peanut butter on each slice, pile up some baby kale in the middle and smash it together. No machine learning needed. Sometimes brute force algorithms are best! To make a really great PB&K or just about any sandwich, if you're in the Palo Alto area visit the downtown Palo Alto farmers' market on a Saturday morning and get either of: 1. The big fat sourdough English muffins from the bakers across Gilman from the produce vendors, or 2. Any loaf from the bakers on the Gilman sidewalk next to the produce vendors, or Better yet, just get both! Now a pro tip on peanut butter. We usually get the salted crunchy from Trader Joe's, but it is a pain to stir it up when you open it. The "microwave for 30-60 seconds before stirring" trick helps, but I found something even better. This was in one of those "71 weird tricks" listicles, but you won't believe what happened next: it turned out to actually work! Store the peanut butter jar upside down. Then for a few days before opening it, shake it up a few times each day and keep it upside down. After a few days of that, it will be easy to stir.
- waihtis 6y agoAnother PB&K fan here - but I drink them instead of eat them. Throw kale, pb, some mineral salt and a sweetener of choice (I use erythritol currently) into the blender and blend until texture is smooth. You can smash a pitcher full of kale leaves and balance it out with just a tablespoon of PB. Not that making everything taste divine is always the end goal, but it was surprisingly difficult to find an ingredient that balances out the taste of kale.
- memco 6y agoOne technique I've seen for tomatoes is that if you cut two slices in half you can make a square with the rounded edges facing in towards each other: I'm sure you could do the same with bananas. You could possibly extend your algorigthm to match similarly sized slices to get the most optimal pairings.
- zacharycohn 6y agoThis is absurd and I loved every word of it.
- Avshalom 6y agoOkay but if we're taking radial slices instead of parallel slices one side will be thicker than the other, an actual optimal sandwich would rotate the slices so that the sandwich was ~equal banana thickness for every bite.
- RickJWagner 6y agoThe mighty Peanut Butter and Banana sandwich. Elvis Presley used to rouse his crew in Memphis, herd them onto his private jet, and fly to Denver to get what he called the greatest PB&B in the world.
- felipemesquita 6y agoHaving a function that calculated a coverage score at the end would also make it easy to take a baseline measure of how effective people randomly placing the slices are. I think a comparison between those and the software solutions would add to the comedy of the project.
- defterGoose 6y agoOr just, you know, slice longitudinally.
- knicholes 6y agoThis is addressed in his writeup.
- knicholes 6y agoWhile this is technologically awesome, I want to propose an alternate method. What if one gets a sufficiently large/long enough banana that by cutting off the ends, it's essentially cylindrical? One could size the banana to the size of the bread, coat the bread in peanut butter, then wrap the bread around the banana burrito style. Maybe the banana ratio is too high in that case. I'll have to try it. Additionally, sometimes I'll take a slice, break it into smaller pieces, and put the smaller pieces in-between the gaps of the other slices. Or I'll be a monster and just layer the slices... My wife just came up with the idea of slicing the bananas sides off to make the slices square. That way you'd also be able to pack in that banana far more efficiently. Others also have mentioned mashing the banana and spreading it.
- zulfazli 6y agoSpread peanut butter on the bread. Then roll bread over the banana. 100% optimized. ;)