TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator

930 pointsby filiphabout 1 month ago

54 comments

roughlyabout 1 month ago
I like this!<p>In the grand HN tradition of being triggered by a word in the post and going off on a not-quite-but-basically-totally-tangential rant:<p>There’s (at least) three areas here that are footguns with these kinds of calculations:<p>1) 95% is usually a lot wider than people think - people take 95% as “I’m pretty sure it’s this,” whereas it’s really closer to “it’d be really surprising if it were not this” - by and large people keep their mental error bars too close.<p>2) probability is rarely truly uncorrelated - call this the “Mortgage Derivatives” maxim. In the family example, rent is very likely to be correlated with food costs - so, if rent is high, food costs are also likely to be high. This skews the distribution - modeling with an unweighted uniform distribution will lead to you being surprised at how improbable the actual outcome was.<p>3) In general normal distributions are rarer than people think - they tend to require some kind of constraining factor on the values to enforce. We see them a bunch in nature because there tends to be negative feedback loops all over the place, but once you leave the relatively tidy garden of Mother Nature for the chaos of human affairs, normal distributions get pretty abnormal.<p>I like this as a tool, and I like the implementation, I’ve just seen a lot of people pick up statistics for the first time and lose a finger.
评论 #43699943 未加载
评论 #43700742 未加载
评论 #43701353 未加载
评论 #43708801 未加载
评论 #43699834 未加载
评论 #43704499 未加载
评论 #43704419 未加载
评论 #43706521 未加载
评论 #43703386 未加载
评论 #43706305 未加载
NunoSempereabout 1 month ago
I have written similar tools<p>- for command line, fermi: <a href="https:&#x2F;&#x2F;git.nunosempere.com&#x2F;NunoSempere&#x2F;fermi" rel="nofollow">https:&#x2F;&#x2F;git.nunosempere.com&#x2F;NunoSempere&#x2F;fermi</a><p>- for android, a distribution calculator: <a href="https:&#x2F;&#x2F;f-droid.org&#x2F;en&#x2F;packages&#x2F;com.nunosempere.distributioncalculator&#x2F;" rel="nofollow">https:&#x2F;&#x2F;f-droid.org&#x2F;en&#x2F;packages&#x2F;com.nunosempere.distribution...</a><p>People might also be interested in <a href="https:&#x2F;&#x2F;www.squiggle-language.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.squiggle-language.com&#x2F;</a>, which is a more complex version (or possibly &lt;<a href="https:&#x2F;&#x2F;git.nunosempere.com&#x2F;personal&#x2F;squiggle.c" rel="nofollow">https:&#x2F;&#x2F;git.nunosempere.com&#x2F;personal&#x2F;squiggle.c</a>&gt;, which is a faster but much more verbose version in C)
评论 #43699684 未加载
评论 #43700083 未加载
评论 #43700801 未加载
评论 #43699970 未加载
OisinMoranabout 1 month ago
This is neat! If you enjoy the write up, you might be interested in the paper “Dissolving the Fermi Paradox” which goes even more on-depth into actually multiplying the probability density functions instead of the common point estimates. It has the somewhat surprising result that we may just be alone.<p><a href="https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;1806.02404" rel="nofollow">https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;1806.02404</a>
评论 #43700286 未加载
评论 #43704154 未加载
kqrabout 1 month ago
I have made a similar tool but for the command line[1] with similar but slightly more ambitious motivation[2].<p>I really like that more people are thinking in these terms. Reasoning about sources of variation is a capability not all people are trained in or develop, but it is increasingly important.[3]<p>[1]: <a href="https:&#x2F;&#x2F;git.sr.ht&#x2F;~kqr&#x2F;precel" rel="nofollow">https:&#x2F;&#x2F;git.sr.ht&#x2F;~kqr&#x2F;precel</a><p>[2]: <a href="https:&#x2F;&#x2F;entropicthoughts.com&#x2F;precel-like-excel-for-uncertain-values" rel="nofollow">https:&#x2F;&#x2F;entropicthoughts.com&#x2F;precel-like-excel-for-uncertain...</a><p>[3]: <a href="https:&#x2F;&#x2F;entropicthoughts.com&#x2F;statistical-literacy" rel="nofollow">https:&#x2F;&#x2F;entropicthoughts.com&#x2F;statistical-literacy</a>
gregschlomabout 1 month ago
The ASCII art (well technically ANSI art) histogram is neat. Cool hack to get something done quickly. I&#x27;d have spent 5x the time trying various chart libraries and giving up.
评论 #43699746 未加载
评论 #43702226 未加载
trieloffabout 1 month ago
<a href="https:&#x2F;&#x2F;www.getguesstimate.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.getguesstimate.com&#x2F;</a> is this, as a spreadsheet
peetersabout 1 month ago
Is there a way to do non-scalar multiplication? E.g if I want to say &quot;what is the sum of three dice rolls&quot; (ignoring the fact that that&#x27;s not a normal distro) I want to do 1~6 * 3 = 1~6 + 1~6 + 1~6 = 6~15. But instead it does 1~6 * 3 = 3~18. It makes it really difficult to do something like &quot;how long will it take to complete 1000 tasks that each take 10-100 days?&quot;
ttoinouabout 1 month ago
Would be nice to retransform the output into an interval &#x2F; gaussian distribution<p><pre><code> Note: If you&#x27;re curious why there is a negative number (-5) in the histogram, that&#x27;s just an inevitable downside of the simplicity of the Unsure Calculator. Without further knowledge, the calculator cannot know that a negative number is impossible </code></pre> Drake Equation or equation multiplying probabilities can also be seen in log space, where the uncertainty is on the scale of each probability, and the final probability is the product of exponential of the log probabilities. And we wouldnt have this negative issue
评论 #43699485 未加载
krickabout 1 month ago
It sounds like a gimmick at first, but looks surprisingly useful. I&#x27;d surely install it if it was available as an app to use alongside my usual calculator, and while I cannot quite recall a situation when I needed it, it seems very plausible that I&#x27;ll start finding use cases once I have it bound to some hotkey on my keyboard.
评论 #43714097 未加载
评论 #43700034 未加载
评论 #43700031 未加载
评论 #43710885 未加载
thih9about 1 month ago
Feature request: allow specifying the probability distribution. E.g.: ‘~’: normal, ‘_’: uniform, etc.
评论 #43703484 未加载
评论 #43700430 未加载
djoldmanabout 1 month ago
I perused the codebase but I&#x27;m unfamiliar with dart:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;filiph&#x2F;unsure&#x2F;blob&#x2F;master&#x2F;lib&#x2F;src&#x2F;calculation.dart">https:&#x2F;&#x2F;github.com&#x2F;filiph&#x2F;unsure&#x2F;blob&#x2F;master&#x2F;lib&#x2F;src&#x2F;calcula...</a><p>I assume this is a montecarlo approach? (Not to start a flamewar, at least for us data scientists :) ).
评论 #43697503 未加载
nritchieabout 1 month ago
Here (<a href="https:&#x2F;&#x2F;uncertainty.nist.gov&#x2F;" rel="nofollow">https:&#x2F;&#x2F;uncertainty.nist.gov&#x2F;</a>) is another similar Monte Carlo-style calculator designed by the statisticians at NIST. It is intended for propagating uncertainties in measurements and can handle various different assumed input distributions.
评论 #43703746 未加载
pvgabout 1 month ago
Smol Show HN thread a few years ago <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22630600">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22630600</a>
henryajabout 1 month ago
Also very very good is Guesstimate - <a href="https:&#x2F;&#x2F;www.getguesstimate.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.getguesstimate.com&#x2F;</a>.
marcodiegoabout 1 month ago
I put &quot;1 &#x2F; (-1~1)&quot; and expected something around - to + infinty. It instead gave me -35~35.<p>I really don&#x27;t known how good it is.
评论 #43700060 未加载
usgroupabout 1 month ago
Interval&#x2F;affine arithmetic are alternatives which do not make use of probabilities for this these kinds of calculations.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Interval_arithmetic" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Interval_arithmetic</a><p>I think arbitrary distribution choice is dangerous. You&#x27;re bound to end up using lots of quantities that are integers, or positive only (for example). &quot;Confidence&quot; will be very difficult to interpret.<p>Does it support constraints on solutions? E.g. A = 3~10, B = 4 - A, B &gt; 0
Aachenabout 1 month ago
<a href="https:&#x2F;&#x2F;qalculate.github.io" rel="nofollow">https:&#x2F;&#x2F;qalculate.github.io</a> can do this also for as long as I&#x27;ve used it (only a couple years to be fair). I&#x27;ve got it on my phone, my laptop, even my server with apt install qalc. Super convenient, supports everything from unit conversion to uncertainty tracking<p>The histogram is neat, I don&#x27;t think qalc has that. On the other hand, it took 8 seconds to calculate the default (exceedingly trivial) example. Is that JavaScript, or is the server currently very busy?
评论 #43703703 未加载
评论 #43704671 未加载
kccqzyabout 1 month ago
I actually stumbled upon this a while ago from social media and the web version has a somewhat annoying latency, so I wrote my own version in Python. It uses numpy so it&#x27;s faster. <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;kccqzy&#x2F;d3fa7cdb064e03b16acfbefb76645744" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;kccqzy&#x2F;d3fa7cdb064e03b16acfbefb76645...</a> Thank you filiph for this brilliant idea!
评论 #43703772 未加载
评论 #43698045 未加载
ralferooabout 1 month ago
On the whole it seems like a nice idea, but there&#x27;s a couple of weird things, such as:<p>&gt; Note: If you&#x27;re curious why there is a negative number (-5) in the histogram, that&#x27;s just an inevitable downside of the simplicity of the Unsure Calculator. Without further knowledge, the calculator cannot know that a negative number is impossible (in other words, you can&#x27;t have -5 civilizations, for example).<p>The input to this was &quot;1.5~3 x 0.9~1.0 x 0.1~0.4 x 0.1~1.0 x 0.1~1.0 x 0.1~0.2 x 304~10000&quot; - every single range was positive, so regardless of what this represents, it should be impossible to get a negative result.<p>I guess this is a consequence of &quot;I am not sure about the exact number here, but I am 95% sure it&#x27;s somewhere in this range&quot; so it&#x27;s actually considering values outside of the specified range. In this case, 10% either side of all the ranges is positive except the large &quot;304~10000&quot;.<p>Trying with a simpler example: &quot;1~2 x 1~2&quot; produces &quot;1.3~3.4&quot; as a result, even though &quot;1~4&quot; seems more intuitive. I assume this is because the confidence of 1 or 4 is now only 90% if 1~2 was at 95%, but it still feels off.<p>I wonder if the 95% thing actually makes sense, but I&#x27;m not especially good at stats, certainly not enough to be sure how viable this kind of calculator is with a tighter range. But just personally, I&#x27;d expect &quot;1~2&quot; to mean &quot;I&#x27;m obviously not 100% sure, or else I wouldn&#x27;t be using this calculator, but for this experiment assume that the range is definitely within 1~2, I just don&#x27;t know where exactly&quot;.
评论 #43704185 未加载
评论 #43703226 未加载
评论 #43703516 未加载
danpalmerabout 1 month ago
This is awesome. I used Causal years ago to do something similar, with perhaps slightly more complex modelling, and it was great. Unfortunately the product was targeted at high paying enterprise customers and seems to have pivoted into finance now, I&#x27;ve been looking for something similar ever since. This probably solves at least, err... 40~60% of my needs ;)
timothylaurentabout 1 month ago
This reminds me of <a href="https:&#x2F;&#x2F;www.getguesstimate.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.getguesstimate.com&#x2F;</a> , a probabilistic spreadsheet.
评论 #43697819 未加载
评论 #43697827 未加载
评论 #43698693 未加载
omoikaneabout 1 month ago
If I am reading this right, a range is expressed as a distance between the minimum and maximum values, and in the Monte Carlo part a number is generated from a uniform distribution within that range[1].<p>But if I just ask the calculator &quot;1~2&quot; (i.e. just a range without any operators), the histogram shows what looks like a normal distribution centered around 1.5[2].<p>Shouldn&#x27;t the histogram be flat if the distribution is uniform?<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;filiph&#x2F;unsure&#x2F;blob&#x2F;123712482b7053974cbef9ffa7ba46c1cdfb765f&#x2F;lib&#x2F;src&#x2F;range.dart#L27">https:&#x2F;&#x2F;github.com&#x2F;filiph&#x2F;unsure&#x2F;blob&#x2F;123712482b7053974cbef9...</a><p>[2] <a href="https:&#x2F;&#x2F;filiph.github.io&#x2F;unsure&#x2F;#f=1~2" rel="nofollow">https:&#x2F;&#x2F;filiph.github.io&#x2F;unsure&#x2F;#f=1~2</a>
评论 #43699469 未加载
your_challengerabout 1 month ago
Very cool. This can also be used for LLM cost estimation. Basically any cost estimation I suppose. I use cloudflare workers a lot and have a few workers running for a variable amount of time. This could be useful to calculate a ball park figure of my infra cost. Thank you!
constantcryingabout 1 month ago
An alternative approach is using fuzzy-numbers. If evaluated with interval arithmetic you can do very long calculations involving uncertain numbers very fast and with strong mathematical guarantees.<p>It would especially outperform the Monte-Carlo approach drastically.
评论 #43699387 未加载
dmos62about 1 month ago
Love it! I too have been toying with reasoning about uncertainty. I took a much less creative approach though and just ran a bunch of geometric brownian motion simulations for my personal finances [0]. My approach has some similarity to yours, though much less general. It displays the (un)certainty over time (using percentile curves), which was my main interest. Also, man, the UI, presentation, explanations: you did a great job, pretty inspiring.<p>[0] <a href="https:&#x2F;&#x2F;dmos62.github.io&#x2F;personal-financial-growth-simulator&#x2F;" rel="nofollow">https:&#x2F;&#x2F;dmos62.github.io&#x2F;personal-financial-growth-simulator...</a>
97-109-107about 1 month ago
The histogram is great, nice work;<p>I want to ask about adjacent projects - user interface libraries that provide input elements for providing ranges and approximate values. I&#x27;m starting my search around <a href="https:&#x2F;&#x2F;www.inkandswitch.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.inkandswitch.com&#x2F;</a> and <a href="https:&#x2F;&#x2F;malleable.systems&#x2F;catalog&#x2F;" rel="nofollow">https:&#x2F;&#x2F;malleable.systems&#x2F;catalog&#x2F;</a> but I think our collective memory has seen more examples.
chris_wotabout 1 month ago
There&#x27;s an amazing scene in &quot;This is Spinal Tap&quot; where Nigel Tufnel had been brainstorming a scene where Stonehenge would be lowered from above onto the stage during their performance, and he does some back of the envelope calculations which he gives to the set designer. Unfortunately, he mixes the symbol for feet with the symbol for inches. Leading to the following:<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Pyh1Va_mYWI" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Pyh1Va_mYWI</a>
vorticoabout 1 month ago
Cool! Some random requests to consider: Could the range x~y be uniform instead of 2 std dev normal (95.4%ile)? Sometimes the range of quantities is known. 95%ile is probably fine as a default though. Also, could a symbolic JS package be used instead of Monte-Carlo? This would improve speed and precision, especially for many variables (high dimensions). Could the result be shown in a line plot instead of ASCII bar chart?
dejonghabout 1 month ago
Cool. It would be great to extend with a confidence operator. Something like:<p>Without default confidence: 0~9<p>With confidence: 0%100~9%95<p>We are sure it is 0 or more and we are %95 certain it is 9 or less.<p>Would that work?
explosion-sabout 1 month ago
I made one that&#x27;s much faster because it instead modifies the normal distribution instead of sending thousands of samples: <a href="https:&#x2F;&#x2F;gistpreview.github.io&#x2F;?757869a716cfa1560d6ea0286ee1b56b" rel="nofollow">https:&#x2F;&#x2F;gistpreview.github.io&#x2F;?757869a716cfa1560d6ea0286ee1b...</a>
评论 #43701169 未加载
elia_42about 1 month ago
Interesting. I like the notation and the histogram that comes out with the output. I also like the practical examples you gave (e.g. the application of the calculator to business and marketing cases). I will try it out with simple estimates in my marketing campaigns.
chacha21about 1 month ago
Chalk also supports uncertainty : <a href="https:&#x2F;&#x2F;chachatelier.fr&#x2F;chalk&#x2F;chalk-features.php" rel="nofollow">https:&#x2F;&#x2F;chachatelier.fr&#x2F;chalk&#x2F;chalk-features.php</a> (combined with arbitrary long numbers and interval arithmetic)
spzzzabout 1 month ago
This is really useful, but is this correct?<p>persons = 10~15 &#x2F;&#x2F; → 10~15<p>budget = persons * 1~2 &#x2F;&#x2F; → 12~27<p>Should it not say 10-30?
评论 #43705806 未加载
alexmolasabout 1 month ago
is this the same as error propagation? I used to do a lot of that during my physics degree
评论 #43698945 未加载
cluckindanabout 1 month ago
”Without further knowledge, the calculator cannot know that a negative number is impossible (in other words, you can&#x27;t have -5 civilizations, for example).”<p>Not true. If there are no negative terms, the equation cannot have negative values.
评论 #43703245 未加载
评论 #43703247 未加载
nkronabout 1 month ago
Really cool! On iOS there&#x27;s a noticeable delay when clicking the buttons and clicking the backspace button quickly zooms the page so it&#x27;s very hard to use. Would love it in mobile friendly form!
thomascountzabout 1 month ago
This reminded me of this submission a few days ago: Napkin Math Tool[1].<p>[1]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=43389455">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=43389455</a>
godDLLabout 1 month ago
So is it like plugging in a normal distribution into some arithmetic?<p>Consider maybe 1 + 1 ~ +-2 like Q factor, if you know what I mean.<p>That would help to filter out more probabilistic noise in using it to help reason with.
评论 #43704203 未加载
ashu1461about 1 month ago
So is it 250k calculations for every approximation window ? So i guess it will only be able to calculate upto 3-4 approximations comfortably ?<p>Any reason why we kept it 250k and now a lower number like 10k
throwanemabout 1 month ago
I love this! As a tool for helping folks with a good base in arithmetic develop statistical intuition, I can&#x27;t think offhand of what I&#x27;ve seen that&#x27;s better.
alex-moonabout 1 month ago
&gt; The UI is ugly, to say the least.<p>I actually quite like it. Really clean, easy to see all the important elements. Lovely clear legible monospace serif font.
frugalmailabout 1 month ago
Great implementation. I would love to see this syntax added to spreadsheet software. Far less complicated than current functions.
bionhowardabout 1 month ago
Yooo I already installed this on my Home Screen and used it like 20 times, great job, it’s so simple and genius!
rao-vabout 1 month ago
This is terrific and it’s tempting to turn into a little python package. +1 for notation to say it’s ~20,2 to mean 18~22
lorenzowoodabout 1 month ago
See also Guesstimate <a href="https:&#x2F;&#x2F;getguesstimate.com" rel="nofollow">https:&#x2F;&#x2F;getguesstimate.com</a>. Strengths include treating label and data as a unit, a space for examining the reasoning for a result, and the ability to replace an estimated distribution with sample data =&gt; you can build a model and then refine it over time. I&#x27;m amazed Excel and Google Sheets still haven&#x27;t incorporated these things, years later.
评论 #43701130 未加载
NotAnOtterabout 1 month ago
This is super cool.<p>It seems to break for ranges including 0 though<p>100 &#x2F; -1~1 = -3550~3500<p>I think the most correct answer here is -inf~inf
评论 #43703933 未加载
ThouYSabout 1 month ago
similar to guesstimate, which does the same but for spreadsheets: <a href="https:&#x2F;&#x2F;www.getguesstimate.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.getguesstimate.com&#x2F;</a>
usgroupabout 1 month ago
I think the SWI Prolog clpBNR package is the most complete interval arithmetic system. It also supports arbitrary constraints.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;ridgeworks&#x2F;clpBNR">https:&#x2F;&#x2F;github.com&#x2F;ridgeworks&#x2F;clpBNR</a>
croisillonabout 1 month ago
i like it and i skimmed the post but i don&#x27;t understand why the default example 100 &#x2F; 4~6 has a median of 20? there is no way of knowing why the range is between 4 and 6
评论 #43698922 未加载
评论 #43699000 未加载
vessenesabout 1 month ago
cool! are all ranges considered poisson distributions?
评论 #43698958 未加载
rogueptrabout 1 month ago
brilliant work, polished ui. although sometimes give wrong ranges for equations like 100&#x2F;1~(200~2000)
评论 #43697453 未加载
评论 #43697549 未加载
shubhamintechabout 1 month ago
love it! gonna use this instead of calculating my own extremes now
po1ntabout 1 month ago
I love it! Now I need it in every calculator
BOOSTERHIDROGENabout 1 month ago
awesome