Step 1 :Given the profit function $P(a, p)=4 a p+50 p-9 p^{2}-\frac{1}{10} a^{2} p-90$, we need to find the maximum value of $P$ and the values of $a$ and $p$ at which it is attained.
Step 2 :To find the maximum value of the function $P(a, p)$, we need to find the critical points of the function. The critical points are the points where the derivative of the function is zero or undefined.
Step 3 :We find the partial derivatives of the function with respect to $a$ and $p$, set them equal to zero, and solve for $a$ and $p$. The partial derivative with respect to $a$ is $P_a = -0.2*a*p + 4*p$ and with respect to $p$ is $P_p = -0.1*a^2 + 4*a - 18*p + 50$.
Step 4 :Solving these equations, we find the critical points to be $(-10.0000000000000, 0.0)$, $(20.0000000000000, 5.00000000000000)$, and $(50.0000000000000, 0.0)$.
Step 5 :By evaluating the function $P(a, p)$ at these points, we find that the maximum value of $P$ is $135.000000000000$ million, which is attained when $a$ is $20$ million and $p$ is $5$.
Step 6 :Thus, the maximum value of $P$ is attained when $a$ is \(\boxed{20}\) million and $p$ is \(\boxed{5}\). The maximum value of $P$ is \(\boxed{135}\) million.