# PDE of barrier and lookback options

In Shreve's book, he obtain the PDE of barrier option by

Payment function $$V(T) = (S(T) - K)^+\mathbb{II}_{\{S_{\textrm{max}}(T) > B\}}$$ Then use the risk neutral pricing formula and Markov property of $S(t),$ we have its value $$V(t) = v(t,S(t))$$ for some function $v(t,x),$ then we can have the PDE of barrier option respect to $v(t,x).$

But in lookback option, he regards $S_{\textrm{max}}(t)$ as a new variable $y$ and value function becomes $v(t,x,y),$ although finally $v(t,x,y)$ can be changed into one variable $u(t,z).$

So my question is, why there is one variable in barrier but two variables in lookback, or they are just equivalent?

In case of a knock-out barrier option, conditional on the option being alive at the pricing time you don't need to carry any additional state variables except for the current asset price. The payoff doesn't directly depend on the level of $S_{\text{max}}(0, T)$ except through the survival indicator. Given the current spot $S(t)$ and conditional on no prior knock-out you can compute the joint density of $\left( S(T), S_{\max}(t, T) \right)$. The information on $S_{\max}(0, t)$ is irrelevant for the payoff in that case.
In case of a lookback option, the payoff directly depends on $S_{\max}(0, T)$. You thus need to introduce a second state variable and obtain a two-dimensional PDE. It turns out that the dimension of the latter can be reduced in case of a lookback option since the price is homogeneous of degree one in the two state variables $S(t)$ and $S_{\max}(0, t)$.