{ "cells": [ { "cell_type": "raw", "metadata": {}, "source": [ "---\n", "title: Biostat 216 Homework 3\n", "subtitle: 'Due Oct 18 @ 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. Computational complexity of matrix multiplication\n", "\n", "Let $\\mathbf{A} \\in \\mathbb{R}^{m \\times n}$, $\\mathbf{B} \\in \\mathbb{R}^{n \\times p}$. Consider four ways of computing the matrix product $\\mathbf{C} = \\mathbf{A} \\mathbf{B}$. Calculate the flop count (leading term) in each of these four algorithms.\n", "\n", "1. (Inner products) Evaluate entries $c_{ij} = \\mathbf{a}_i' \\mathbf{b}_j$ for all $i, j$.\n", "\n", "2. (Matrix vector products) Evaluate columns $\\mathbf{c}_j = \\mathbf{A} \\mathbf{b}_j$ for all $j$.\n", "\n", "3. (Vector matrix products) Evaluate rows $\\mathbf{c}_i' = \\mathbf{a}_i' \\mathbf{B}$ for all $i$.\n", "\n", "4. (Vector outer products) Evaluate $\\mathbf{C}$ as the sum of outer prodcuts $\\mathbf{a}_1 \\mathbf{b}_1' + \\cdots + \\mathbf{a}_n \\mathbf{b}_n'$." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## BV exercises\n", "\n", "7.12, 7.13, 7.14, 8.4, 8.5, 8.6, 8.9, 10.9 (also describe $\\mathbf{C}=\\mathbf{A} \\mathbf{D}$), 10.11, 10.19, 10.23, 10.36, 10.42, 10.43, 10.44" ] } ], "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 }