this post was submitted on 30 Aug 2026
872 points (98.4% liked)

Programmer Humor

33086 readers
1834 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] ThatGuy46475@lemmy.world 233 points 4 days ago (4 children)

A group of researchers was studying how different people solve problems. They gathered a physicist, a mathematician, and an engineer and gave them each a problem: find the volume of a red sphere. The mathematician solves it first. Asked how, he explains that he used a simple formula. The physicist solves it next. Asked how, he explains that he submerged the sphere in water and measured the rise in water level. Hours later, they find the engineer buried in paperwork. Asked about his progress, he says “I can only find a table of values for the volume of blue spheres.”

[–] NaibofTabr@infosec.pub 157 points 4 days ago* (last edited 4 days ago) (2 children)

On further inspection, it was found that the mathematician had assumed an ideal sphere of constant radius, while the real object was in fact oblate. The mathematician had neglected to take any measurements, leading to an incorrect value. The physicist's answer was correct, but only at sea level at nominal temperature.

The engineer is currently using calipers to measure the diameter of the object at many different angles in order to build a CAD model. He said we could expect results next year.

[–] tyler@programming.dev 76 points 4 days ago (3 children)

The physicist’s answer would be correct anywhere, no matter the temperature or density of the fluid.

[–] montechristo@feddit.org 32 points 4 days ago

Supposing that the measurements with and without the sphere are taken under identical circumstances. But you deserve the upvote either way.

[–] OwOarchist@pawb.social 20 points 4 days ago* (last edited 4 days ago)

Interestingly, the physicist's answer would always be correct, but not always consistent.

If the sphere is compressible, then air pressure will slightly affect its volume. And unless the thermal expansion rate of the sphere is zero, the amount of fluid displaced will also vary with temperature.

However, even if the physicist gets different answers in different environments, it's always still a correct answer, because they correctly measured the volume of the sphere at that time.

[–] untorquer@quokk.au 14 points 4 days ago* (last edited 4 days ago) (3 children)

Assuming the time between submersion and observation is greater than zero, increasing temperatures above boiling would give increasing error.

Conversely the physicist may get other error at/near freezing.

And yet another option is the fluid being above the Ball's melting and/or boiling point, assuming changes in density with phase change.

[–] cloudshouter@lemmy.zip 14 points 4 days ago (1 children)

They just said the ball was red, they didn’t say why…

[–] untorquer@quokk.au 1 points 2 days ago

Responded to inline comment saying any temp would be fine

[–] Aqivex@fedinsfw.app 11 points 4 days ago (1 children)

All of which the physicist can trivially account for, control and variable test around, should the requested question be updated to require it.

The requested question did not include "In all possible scenarios", thus determining the volume of the sphere via physics calculation at the most average of conditions, is the most correct valid solution, absent further requirement parameters.

[–] untorquer@quokk.au 7 points 4 days ago* (last edited 4 days ago) (1 children)

You're right in terms of grading a student's homework or whatever.

In research/publication/career these assumptions must be stated unless given.

But I was responding to:

The physicist’s answer would be correct anywhere, no matter the temperature or density of the fluid.

Which includes non-standard conditions.

[–] Aqivex@fedinsfw.app 2 points 2 days ago

But I was responding to: The physicist’s answer would be correct anywhere, no matter the temperature or density of the fluid. Which includes non-standard conditions.

[–] tyler@programming.dev 2 points 2 days ago (1 children)

This is like saying “the physicist’s answer would have errors because they measured the ball and then stuck it in an oven. The volume of the ball in the oven is different than what they measured.”

[–] untorquer@quokk.au 0 points 2 days ago (1 children)

No it's more like the physicist tried to use boiling water to measure it

[–] tyler@programming.dev 1 points 2 days ago (1 children)

Using boiling water is still fine, the measurement will work, your comment literally only is a problem if they don’t measure in time. So yes, it’s exactly like sticking it in an oven and not measuring at the same time

[–] untorquer@quokk.au 1 points 2 days ago

Fair, if you do account for the change in water volume over time then you could maintain accuracy, but also good luck reading the meniscus.

[–] BartyDeCanter@piefed.social 5 points 3 days ago

Anywhere with gravity sufficient to overcome the surface tension of the water from forming around the object or clinging to the container.

They later added an Anthropologist, who understood that more questions needed to be asked. His first question was "do you want fries with that?"

[–] k0e3@lemmy.ca 8 points 3 days ago* (last edited 3 days ago) (6 children)

Sorry for the stupid question, but doesn't the rise in water level show the density of an object? Can you measure volume too? What if the sphere floated?

Edit: thanks everyone for helping me understand. I was totally misremembering the story about Archimedes and the crown.

[–] kuberoot@discuss.tchncs.de 16 points 3 days ago

Nope, the rise in water shows exclusively the volume. Density is derived using volume and mass, with mass being measurable by weighing. The only factor density plays directly is indeed floating, but you can just push the sphere under with a thin rod without significantly impacting the measurement.

It's generally simple - water has some volume, sphere has some volume. Assuming a cylindrical container, the base of the cylinder is known, and the volume of it is equal to the volume of water, which means you can derive the height (or vice versa). If you now add the sphere, the sphere pushes out the water, which means you add the volume of the sphere to the water - and if you measure the height, you can calculate the total volume of water+sphere, and subtract the initial volume of water to isolate the volume of the sphere.

[–] froh42@lemmy.world 4 points 3 days ago* (last edited 3 days ago)

If you fully submerge an object, you displace its VOLUME of water. It will always be the same amount (imagine a bowling ball and a soccer ball). You might need to push it.

When you relate that to its weight, you get the density.

Imagine you have two 1kg lumps of steel. Out of one you make a bowl with thin walls the out of the other a metal ball. Afterwards they still have (about) the same weight, volume and density - as it's still steel.

But put the bowl onto the basin and with a little luck it will float like a boat *, put in the steel ball it will sink.

But when you put in the bowl sideways without splashing it will displace about the same amount of water than the ball. And it will still weigh 1kg.

*= The thing with floating people remember from school: The floating bowl will displace as much water as it weighs - that's the thing Archimedes found out. So our 1kg bowl will displace 1kg of water - which is incidentally about 1 liter, because the density of water is about 1kg/l (it was intentionally defined that way, some guys in the French revolution used water to define mass by volume)

[–] Jako302@feddit.org 3 points 3 days ago

It shows volume, not density.

The amount of displaced water is the same for a lead sphere and a balloon of the same size.

You can the also calculate the density if you measure how mich of the object is submerged

[–] Shanmugha@lemmy.world 2 points 3 days ago* (last edited 3 days ago)

attach something to the bottom, pull, fix position

Edit: I am late. kudos for everyone who was faster :)

[–] Kazumara@discuss.tchncs.de 2 points 3 days ago* (last edited 3 days ago)

Density comes into it if we are measuring buoyancy. The weight of the displaced water is equal to the weight of the buoyant object, and the ratio of volume submerged vs above water should give a way to determine density, but I don't have the precise method in my head right now.

However assuming all you want is the volume, you simply need to fully submerge the object (by applying enough downward force if its density is too low), and the displaced volume is equal to the objects volume. The displaced water will have to flow to the top of the container, so by measuring the rise in water level and multiplying with the base area of your container you can get it easily.

Just make sure you don't accidentally also measure your hand if you're pushing down the sphere.

[–] blamster19@programming.dev 2 points 3 days ago

Submerging the sphere gives you the volume. You're thinking of the legend of Archimedes who measured volume this way and measured mass with an ordinary scale and deduced the density from those two values.

[–] HeHoXa@lemmy.zip 4 points 3 days ago

This entire post is a deep catharsis, and this comment is the pinnacle.