---
title: "Reading argmax and argmin from data"
description: "Read argmax and argmin from tables and graphs, including ties and the difference between an optimizer and its value."
canonical_url: "https://fanout.sh/ml-math/lessons/sets-reading-argmax-and-argmin-from-data-t-1kn9xdk"
md_url: "https://fanout.sh/ml-math/lessons/sets-reading-argmax-and-argmin-from-data-t-1kn9xdk.md"
access: "public"
---

# Reading argmax and argmin from data

Read argmax and argmin from tables and graphs, including ties and the difference between an optimizer and its value.

## Public overview

Read extrema and all optimizing inputs from tables and graphs, accounting for ties, excluded points, and unattained limits.

Reading Extremes and Their Locations

Before using a table or graph, keep the distinction clear: \(\max\) and \(\min\) identify the largest and smallest function values, while \(\arg\max\) and \(\arg\min\) identify the input values where those extremes occur.

This lesson practices finding \(\max\), \(\arg\max\), \(\min\), and \(\arg\min\) from two common representations of a function: tables of values and graphs.

Reading Argmax and Argmin From a Table

When values are listed as input-output pairs \((x,f(x))\), with \(x\) drawn from a set \(S\), the maximum and argmax answer two different questions.

The expression \(\max {x\in S}f(x)\) is the largest output value shown in the table. The expression \(\arg\max {x\in S}f(x)\) is the input \(x\) whose row produces that largest output.

For minima, read the table the same way but look for the smallest output instead: \(\min\) gives the smallest value, while \(\arg\min\) gives the input where that smallest value occurs.

Table Example: Computing Argmax and Argmin

Suppose \(f\) is defined on the set \(S=\{-2,-1,0,1,2\}\) by these input-output pairs: \[(-2,3),\quad(-1,0),\quad(0,5),\quad(1,-1),\quad(2,2).\]

From this table, we want to find \[\max {x\in S}f(x),\qquad \arg\max {x\in S}f(x),\qquad \min {x\in S}f(x),\qquad \arg\min {x\in S}f(x).\] The maximum and minimum refer to output values of \(f\). The argmax and argmin refer to the input values in \(S\) where those outputs occur.

The outputs are \(3,0,5,-1\), and \(2\). The largest output is \(5\), and it occurs when \(x=0\). Therefore, \[\max {x\in S}f(x)=5\qquad\textrm{and}\qquad\arg\max {x\in S}f(x)=0.\]

The smallest output is \(-1\), and it occurs when \(x=1\). Therefore, \[\min {x\in S}f(x)=-1\qquad\textrm{and}\qquad\arg\min {x\in S}f(x)=1.\]

Reading Argmax and Argmin From a Graph

---
This representation contains public Fanout content only. Protected Pro lessons, account data, billing, checkout, and pricing are not included.

Browse the public content map: https://fanout.sh/sitemap.md
