# Weird differentation of probabilities, please explain?

I'm taking a course on machine learning and came across a model answer which I can't wrap my head around.

The part I'm specifically having trouble understanding is the last 2 lines of the 2nd page, ie this: http://i.stack.imgur.com/SZEPC.png

How does the left side of the upper equation become just the sum of indicator variables? How does the right side simplify to just lambda*p_i?

Any help is appreciated.

-

I say there be typos. Particular the suddenly appearing subscript $k$ does not make sense.
Straightforward differentiation gives: $${\partial \over {\partial p_i}} L(p|X)={1 \over p_i}\sum_{t=1}^N x^t_i + \lambda$$ Setting this equal to zero gives us: $$\sum_{t=1}^N x^t_i + \lambda p_i=0$$ Proceeding from which and reading the subscript $k$ in your text as $i$ leads to the same ultimate answer.
$\partial \log p_j/\partial p_i=0$ when $j \neq i$, so all terms other than the i-th disappear. –  Jyotirmoy Bhattacharya Oct 15 '10 at 12:46
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7192551493644714, "perplexity": 283.1323051765933}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-35/segments/1440644065241.14/warc/CC-MAIN-20150827025425-00278-ip-10-171-96-226.ec2.internal.warc.gz"}