All problems

Finding the Decision Boundary

easyPythonLogistic Regression

Kestrel Freight's simplest late-delivery model reads one number about a job — how many minutes the driver is already running behind — and turns it into a probability through a weight and a starting amount. The depot manager does not want the probability. She wants the tipping point: the number of minutes at which the model stops leaning towards on-time and starts leaning towards late, so it can go on a wall chart the drivers can actually use. That is the value where the model is exactly evenly split, giving a probability of one half.

Task: Print the value of the job's number at which the model sits exactly on the fence.

Input

One line holding two numbers separated by a single space: the weight the model puts on the job's number, guaranteed not to be zero, and the starting amount that applies before the number is read. Either may be negative.

Output

One line holding the tipping point rounded to 4 decimal places, with no label. It may be negative.

Example:

Input:
2 -4

Output:
2.0000

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…