{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "5f8724a1",
   "metadata": {},
   "source": [
    "\n",
    "File: 01-revenue_maximization.py\n",
    "\n",
    "\n",
    "Michel Bierlaire\n",
    "\n",
    "Sat Aug 02 2025, 18:40:19\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c3d0f805",
   "metadata": {},
   "source": [
    "# Revenue maximization"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6ee869de",
   "metadata": {},
   "source": [
    "The objective of this exercise is to investigate the use of choice models for revenue maximization."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "50694f1b",
   "metadata": {},
   "source": [
    "Consider the simple example of a binary logit model described in the lecture, where\n",
    "the utility of the two competing alternatives $i$ and $j$ are defined as\n",
    "\\begin{eqnarray*}\n",
    "V_{in} &=&  \\beta_{pn}p_{i} - 0.5, \\\\\n",
    "V_{jn} &=&  \\beta_{pn}p_{j},\n",
    "\\end{eqnarray*}\n",
    "where $p_{i}$ and $p_{j}$ are the prices of each alternative, and $\\beta_{pn}$ is the price coefficient for\n",
    "individual $n$.\n",
    "Assume that you are in control of alternative $i$, and have to decide\n",
    "its price.\n",
    "We also assume that the price for the competing alternative $j$ is\n",
    "fixed: $p_{j} = 2$. Note that the absence  of an index $n$ on the\n",
    "price variable indicates that the prices are the same for each individual.\n",
    "\n",
    "The population, composed of 1000 individuals, is heterogeneous in its preferences, and composed of\n",
    "three groups. For each group, the value of the price coefficient $\\beta_{pn}$ and the\n",
    "number of individuals have been determined to be:\n",
    "\n",
    "- $\\beta_{pn} = -1$, $N_{1} = 300$,\n",
    "- $\\beta_{pn} = -0.5$, $N_{2} = 300$, and\n",
    "- $\\beta_{pn} = -0.1$, $N_{3} = 400$.\n",
    "\n",
    "The price levels that can be considered for $p_i$ are $\\{1,3,5,7,9,11,13\\}$. Answer the following questions:\n",
    "\n",
    "- What is the price  that maximizes your expected revenues?\n",
    "- What is the price  that maximizes the expected market share of alternative $i$?\n",
    "- What is the price  that maximizes your expected revenues obtained from individuals in group 1?\n",
    "- What is the price  that maximizes your expected revenues obtained from individuals in group 2?\n",
    "- What is the price that maximizes your expected revenues obtained from individuals in group 3?"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e699ecd3",
   "metadata": {},
   "source": [
    "Hint: You do not need Biogeme to perform this analysis. We recommend to use a Pandas data frame where each row\n",
    "corresponds to a price level, and each column corresponds to\n",
    "a relevant indicator:\n",
    "* the market shares,\n",
    "* the expected revenues of group 1,\n",
    "* the expected revenues of group 2,\n",
    "* the expected revenues of group 3,\n",
    "* the total expected revenues."
   ]
  }
 ],
 "metadata": {},
 "nbformat": 4,
 "nbformat_minor": 5
}
