Integrate a Two-Sided Exponential Density
Company: Goldman Sachs
Role: Data Scientist
Category: Statistics & Math
Difficulty: easy
Interview Round: Online Assessment
# Integrate a Two-Sided Exponential Density
A continuous random variable has probability density `f(x) = 0.5 * exp(-abs(x))` for every real `x`. Compute `P(1 <= X <= 3)` and show the integral used.
### Constraints & Assumptions
- Endpoint inclusion does not change the probability for a continuous distribution.
- The density is already normalized over the real line.
### Clarifying Questions to Ask
- Is an exact expression, a decimal approximation, or both desired?
- Should normalization of the density also be verified?
```hint Remove the absolute value on the interval
Every `x` between 1 and 3 is positive, so the density has one simple exponential form there.
```
### What a Strong Answer Covers
- The correct definite integral and antiderivative.
- Correct handling of `abs(x)` on a positive interval.
- An exact result and a sensible numerical check.
### Follow-up Questions
- What is `P(abs(X) <= a)` for nonnegative `a`?
- What are the mean and variance of this distribution?
Quick Answer: For a random variable with density 0.5 times exp(-abs(x)), compute the probability that it lies between 1 and 3.