All problems

Expected Free Throws Made

easyPythonDistributionsBinomial

You're the analyst for the Northgate Rockets, a college basketball team. The shooting coach is printing practice sheets for tomorrow: each sheet names a drill and the number the player should expect to hit if she shoots the way she normally shoots. One sheet is Jordan's 20-shot free-throw drill — her record across the season says she sinks 70% of her attempts. Every player gets a sheet, and no two drills are the same length or belong to the same shooter.

Within a drill, makes and misses look independent from one shot to the next, and the shooter's season rate applies to every attempt.

Task: Print the long-run average number of shots the player makes in the drill, as a single number with no rounding applied.

Input

The first line holds one integer, the number of attempts in the drill (at least 1). The second line holds the shooter's season success rate, a decimal number between 0 and 1.

Output

One line holding the average, printed the way Python prints a float — 14.0, never 14.

Example:

Input:
20
0.7

Output:
14.0

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…