{ "cells": [ { "cell_type": "raw", "metadata": {}, "source": [ "---\n", "title: Biostat 216 Homework 1\n", "subtitle: 'Due Oct 4 @ 11:59pm'\n", "format:\n", " html:\n", " theme: cosmo\n", " embed-resources: true\n", " number-sections: true\n", " toc: true\n", " toc-depth: 4\n", " toc-location: left\n", " code-fold: false\n", "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Submit a PDF (scanned/photographed from handwritten solutions, or converted from RMarkdown or Jupyter Notebook or Quarto) to Gradescope in BruinLearn. \n", "\n", "## Q1. Average and norm\n", "\n", "Use the Cauchy-Schwarz inequality to prove that\n", "$$\n", "- \\frac{1}{\\sqrt{n}} \\|\\mathbf{x}\\| \\le \\frac{1}{n} \\sum_{i=1}^n x_i \\le \\frac{1}{\\sqrt{n}} \\|\\mathbf{x}\\|\n", "$$\n", "for any $\\mathbf{x} \\in \\mathbb{R}^n$. In other words, $-\\operatorname{rms}(\\mathbf{x}) \\le \\operatorname{avg}(\\mathbf{x}) \\le \\operatorname{rms}(\\mathbf{x})$.\n", "\n", "What are the conditions on $\\mathbf{x}$ to have equality in the upper bound? When do we have equality in the lower bound?\n", "\n", "## Q2. AM-HM inequality\n", "\n", "Use the Cauchy-Schwartz inequality to prove that\n", "$$\n", "\\frac{1}{n} \\sum_{i=1}^n x_i \\ge \\left( \\frac{1}{n} \\sum_{i=1}^n \\frac{1}{x_i} \\right)^{-1}\n", "$$\n", "for any $\\mathbf{x} \\in \\mathbb{R}^n$ with positive entries $x_i$. \n", "\n", "The left hand side is called the arithmetic mean (AM) and the right hand side is called the harmonic mean (HM). You may wonder what can be a practical use of such a simple inequality. See this [paper](http://hua-zhou.github.io/media/pdf/LangeZhou14GP.pdf), which uses the AM-HM inequality to derive a class of optimization algorithms for geometric and signomial programming.\n", "\n", "## Q3. Bias-variance tradeoff\n", "\n", "Prove the formula \n", "$$\n", "\\operatorname{avg}(\\mathbf{x})^2 + \\operatorname{std}(\\mathbf{x})^2 = \\operatorname{rms}(\\mathbf{x})^2\n", "$$\n", "using the vector notation and do BV 3.15.\n", "\n", "## BV exercises\n", "\n", "1.7, 1.9, 1.13, 1.16, 1.20, 3.4, 3.5, 3.12." ] } ], "metadata": { "@webio": { "lastCommId": null, "lastKernelId": null }, "hide_input": false, "jupytext": { "formats": "ipynb,qmd" }, "kernelspec": { "display_name": "Julia 1.10.5", "language": "julia", "name": "julia-1.10" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", "version": "1.10.5" }, "toc": { "colors": { "hover_highlight": "#DAA520", "running_highlight": "#FF0000", "selected_highlight": "#FFD700" }, "moveMenuLeft": true, "nav_menu": { "height": "87px", "width": "252px" }, "navigate_menu": true, "number_sections": true, "sideBar": true, "skip_h1_title": true, "threshold": 4, "toc_cell": false, "toc_section_display": "block", "toc_window_display": false, "widenNotebook": false } }, "nbformat": 4, "nbformat_minor": 4 }