  Price discrimination, which refers to the strategy of setting different
prices for different customer groups, has been widely used in online retailing.
Although it helps boost the collected revenue for online retailers, it might
create serious concerns about fairness, which even violates the regulation and
laws. This paper studies the problem of dynamic discriminatory pricing under
fairness constraints. In particular, we consider a finite selling horizon of
length $T$ for a single product with two groups of customers. Each group of
customers has its unknown demand function that needs to be learned. For each
selling period, the seller determines the price for each group and observes
their purchase behavior. While existing literature mainly focuses on maximizing
revenue, ensuring fairness among different customers has not been fully
explored in the dynamic pricing literature. This work adopts the fairness
notion from Cohen et al. (2022). For price fairness, we propose an optimal
dynamic pricing policy regarding regret, which enforces the strict price
fairness constraint. In contrast to the standard $\sqrt{T}$-type regret in
online learning, we show that the optimal regret in our case is
$\tilde{O}(T^{4/5})$. We further extend our algorithm to a more general notion
of fairness, which includes demand fairness as a special case. To handle this
general class, we propose a soft fairness constraint and develop a dynamic
pricing policy that achieves $\tilde{O}(T^{4/5})$ regret. We also demonstrate
that our algorithmic techniques can be adapted to more general scenarios such
as fairness among multiple groups of customers.
