You work for an insurance company. You have an obligation to pay $1 mln in exactly 1.5 years from today. Your goal is to provide the company with an immunized portfolio that would hedge the current obligation. The company is only interested in first-order immunization, so you do not have to deal with convexity.

There are two bonds in the market: the first bond has 1 year till maturity, pays 5% coupon rate and is traded at yield 4%. The second one has 2 years to maturity, 3% coupon and is traded at yield 4%. Assume all coupons are paid twice per year. Please provide the approximate quantities invested in every bond (in thousand dollars). Assume one can buy fractions of bonds.

To create an immunized portfolio, you need to ensure that the value of the portfolio matches the value of the liability at the end of the investment period, in this case, 1.5 years. To achieve this, you should construct a portfolio that has a duration equal to the duration of the liability.

Step 1: Calculate the duration of the liability:
The duration of a liability is the timeframe over which the payment is due, weighted by the present values of those payments. In this case, the liability is due in 1.5 years and the present value is $1 million.

Therefore, the duration of the liability can be calculated as:
Duration of Liability = 1.5 years

Step 2: Calculate the duration of the available bonds:
You have two bonds available, each with different maturities, coupon rates, and yields. To calculate the duration of each bond, you need to consider the cash flows and the present values of those cash flows.

For the first bond:
Maturity = 1 year
Coupon = 5% * $1,000 = $50 (paid twice per year)
Yield = 4%

Now, calculate the present value of the cash flows for each coupon payment:
Present Value of each coupon = $50 / (1 + (4% / 2))^2 = $47.54

To calculate the duration, consider the weighted average of the present value of the cash flows, where the weights are the proportions of the present values relative to the total present value.
Duration of the first bond = (1 * $47.54 + 1 * $47.54) / (2 * $47.54) = 1 year

For the second bond:
Maturity = 2 years
Coupon = 3% * $1,000 = $30 (paid twice per year)
Yield = 4%

Calculate the present value of the cash flows for each coupon payment:
Present Value of each coupon = $30 / (1 + (4% / 2))^4 = $25.93

Duration of the second bond = (2 * $25.93 + 2 * $25.93) / (4 * $25.93) = 2 years

Step 3: Solve for the quantities invested in each bond:
To immunize the portfolio, you need to match the duration of the liability, which is 1.5 years. Since you only have two bonds available, each with either a 1-year or 2-year duration, you'll need to find a combination of both bonds to achieve a duration of 1.5 years.

Let's assume you invest X dollars in the first bond and Y dollars in the second bond.

The total value of the portfolio is X + Y, and the weighted-average duration can be calculated as the sum of the durations of each bond multiplied by their respective proportions of the total value.

X = Quantity invested in the first bond (in thousand dollars)
Y = Quantity invested in the second bond (in thousand dollars)

Duration of the portfolio = (X * 1 year + Y * 2 years) / (X + Y) = 1.5 years

Solving this equation will give you the approximate quantities invested in each bond (in thousand dollars) to create an immunized portfolio that hedges the liability.

Additional information, such as the market prices of the two bonds, would be needed to calculate the specific quantities invested in each bond.