# Logistic regression as a special case of softmax regression [duplicate]

I was looking at logistic regression and softmax regression.

Based on this formula,

$P(y=j|\mathbf {x} )={\frac {e^{\mathbf {x} ^{\mathsf {T}}\mathbf {w} _{j}}}{\sum _{k=1}^{K}e^{\mathbf {x} ^{\mathsf {T}}\mathbf {w} _{k}}}}$

How does $k=2$ make it logistic regression? I cannot seem to derive this to this

$\sigma (t)={\frac {e^{t}}{e^{t}+1}}={\frac {1}{1+e^{-t}}}$

The soft-max function is a function with potentially a multi-dimensional input $x$ and potentially multiple outputs, indexed by $j$. The sigmoid function is in principle a 1-dimensional function with a single output. After setting $k=2$, we still need to reconcile those facts. One way to do that is the following way:
$x(t)=t$
$w=\binom{0}{1}$
$P(y=1|x(t))=\frac{e^{x^T w_1}}{\sum_{k=1}^{2}{e^{x^T w_k}}}=\frac{e^{t\cdot 1}}{e^{t \cdot0}+e^{t \cdot1}}=\frac{e^{t}}{1+e^{t}}=\sigma(t)$