# Dynamic Programming problem of affecting equipment with budget constraint

I have a problem that I must formulate as a DP problem and solve.

A hospital is split up into 4 sections, each section has 1 or 2 or 3 backup generators. We have to maximize the likelihood that no section of the hospital fails but we cannot buy as many generators as we want since we have a 10,000 € maximum budget.

The number of generators and the likelihood of NOT losing power:

Generator Section 1 Section 2 Section 3 Section 4
1 0.5 0.6 0.7 0.5
2 0.6 0.7 0.8 0.7
3 0.8 0.8 0.9 0.9

And the cost of having the generators

Generator Section 1 Section 2 Section 3 Section 4
1 1,000€ 2,000€ 1,000€ 2,000€
2 2,000€ 4,000€ 3,000€ 3,000€
3 3,000€ 5,000€ 4,000€ 4,000€

So far I have identified:

n: is the section of the hospital

Xn: Generators for a section n

Pn(Xn): Likelihood of not losing power to section n if we have Xn generators

I cannot identify my Sn and any other important variables. I also do not know how to proceed with the calculations, if someone can explain how one calculation affects the next one it could be great for an in-depth explanation