Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes, this can be modeled mathematically, but you need a lot more details/conditions to get to an answer you'd like.

If you know exactly the relations, you can simply write down the functions. If you're trying to guess or build a function from lots of data points, then you need to select a class of functions and optimize/minimize to get the best fitting one.

There is not in general a way to avoid divide by 0. If your function is f(x) = 1/x, then at x=0 you will divide by zero.

In some cases you can take limits (calculus) to "remove" divide by zero if there is a simple removable singularity. For example, if your functions looks like f(x) = x^2/x, then it has a 0/0 at x=0, which may trigger code crashes, but if you simplify that function to f(x)=x then the divide by zero is gone. Other issues may arise from floating point representations of real numbers. Note this problem is a huge, deep field with lots of nuance.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: