Session Ready
Exercise

Catching salmon example

Every fall the salmon run occurs -- this is the time when salmon swim back upriver from the ocean to spawn. While swimming back to the upper river (usually to the place where they were spawned), the fish may encounter grizzly bears. Some of these bears can eat 18 salmon in 3 hours, and they have a 0.0333 probability of success in their attempts to catch a fish.

Grizzly bears catching salmons

We can model a grizzly bear catching salmon with a geometric distribution.

For the following exercises, the geom object from scipy.stats has already been loaded for your convenience.

Instructions 1/4
undefined XP
  • 1

    Calculate and print the probability that the bear will catch a salmon on its third attempt, after failing two times.

    • 2

      Calculate and print the probability that the bear will get a salmon in less than 5 attempts.

    • 3

      Calculate and print the probability that the bear will get a salmon in less than 21 attempts.

    • 4

      Calculate and print how many attempts the bear has to make to have a 0.9 probability of catching a salmon.