tsorokina
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- title: svd_team_2, Chris Schmidt, Bryten Ives --- ***great work. 30/30*** **Section 1** > [no a's on the left in Example 1] Example 1: Fill in the gaps $\begin{bmatrix} 1&1&1&1&1&1\\1&1&1&1&1&1\\1&1&1&1&1&1\\1&1&1&1&1&1\\1&1&1&1&1&1\\1&1&1&1&1&1\\\end{bmatrix}=\begin{bmatrix}\\1\\1\\1\\1\\1\\1\end{bmatrix}[~\ 1~~\ 1~~\ 1~~\ 1~~\ 1 ~~\ 1 ~ ]$ Example 2: Fill in the gaps $\begin{bmatrix} a&a&c&c&e&e\\a&a&c&c&e&e\\a&a&c&c&e&e\\a&a&c&c&e&e\\a&a&c&c&e&e\\a&a&c&c&e&e\\\end{bmatrix}=\begin{bmatrix}\\a \\a \\c \\ c\\e \\e \end{bmatrix}[~\ 1~~\ 1~~\ 1 ~~\ 1~~\ 1~~\ 1 ~ ]$ Example 3(a): Fill in the gaps $\begin{bmatrix} 1&0\\1&1\\\end{bmatrix}=\begin{bmatrix}\ ? \\1 \end{bmatrix}[~\ 1~~\ ?~~ ]$ No solution is possible. This can not be solved because the rank of $A=2$. Since the outer product of $u_1v^T$ is a rank one matrix, this is insufficient to create a rank two matrix without adding one more rank one matrx. Example 3(b): Fill in the gaps $\begin{bmatrix} 1&0\\1&1\\\end{bmatrix}=\begin{bmatrix}\ 1\\1 \end{bmatrix}[~\ 1~~\ 1~~ ]+\begin{bmatrix}\ 1 \\ 0 \end{bmatrix}[~\ 0~~\ -1~~]$ Draw some conclusions. The rank of the matrix you are decomposing will be equal to the sum of the ranks of the decomposition pieces. For a matrix of rank two you have to use a combination of other rank one matrices. **Section 2** 1. Find rank one 2 by 2 matrix $\tilde A$ closest to $A$. Use Frobenius norm. To solve the arising system of equations use https://www.wolframalpha.com/input/?i=solve+system+of+equations The Frobenius norm of $||A - \tilde{A}||$ is found by solving the square root of the sum of the squared differences between $A$ and $\tilde{A}$. Here we solve for $\tilde{A}$ by setting $A$ to be a rank matrix of unknowns, such as $\begin{bmatrix} a&a\\cb&cb\\\end{bmatrix} where $c$ is a scalar of $b$ in the matrix $\tilde{A}$. First, we take the norm of the distance between $A$ and set each partial derivative equal to zero to get the minimal distance. We solve for the values a,b for the entries of $\tilde{A}$. This is also a rank one matrix. Solving this, we find that $a=29, b=29$. Then compute $E$= $A-\tilde{A}$, and write $A$ as a sum of $\tilde{A}$ and $E$. $$E = \text{ A is }\begin{bmatrix} 30&28\\28&30\\\end{bmatrix} - \tilde{A}\text{ is } \begin{bmatrix} 29&29\\29&29\\\end{bmatrix}$$ $$E = \begin{bmatrix} 1&-1\\-1&1\\\end{bmatrix}$$ 2. How are $\tilde A$ and $E$ are related to the eigenvalues and eigenvectors of $A?$ Try to compute $\tilde A$ using eigenvalues and eigenvectors. This is a famous kind of decomposition, called what? Spectral Decomposition Can this decomposition be obtained for any matrix? It can for any symmetric, square matrix. Eigenvalues of $A$ are $\lambda=58, \lambda=2$ Corresponding normalized eigenvectors are $$v_1 = \begin{bmatrix} 1/\sqrt{2}\\1/\sqrt{2}\\\end{bmatrix}, v_2 \begin{bmatrix} -1/\sqrt{2}\\1/\sqrt{2}\\\end{bmatrix}$$ respectively. The Frobenius norm of the matrix $A$ is $\sqrt{30^2 + 28^2 + 30^2 + 28^2} = 58.0344...$, which is also the largest eigenvalue.The diagonals of $\tilde{A}$ are the eigenvalue of $A$. The matrix $E$ is the eigenvectors of $A$. $$A= \lambda_1 v_1 v_1^T+\lambda_2 v_2 v_2^T$$ $$\text{ then } A= 58 \cdot \begin{bmatrix}1/\sqrt{2}\\ 1/\sqrt{2} \end{bmatrix}\begin{bmatrix} 1/\sqrt{2} & 1/\sqrt{2}\end{bmatrix} + 2\cdot\begin{bmatrix} -1/\sqrt{2}\\ 1/\sqrt{2}\end{bmatrix} \begin{bmatrix} -1/\sqrt{2}& 1/\sqrt{2}\end{bmatrix}$$ $$=58\cdot\begin{bmatrix} 1/2&1/2\\1/2&1/2\end{bmatrix} + 2\cdot\begin{bmatrix} 1/2&-1/2\\-1/2&1/2\end{bmatrix} = \begin{bmatrix} 30&28\\28&30\\\end{bmatrix}$$ **Section 3** **Here is a link to our Colab notebook with some of the computations used for this assignment: https://colab.research.google.com/drive/1qT4XihL0U-_Z00loFBceVQMQ_O5R5JTe?usp=sharing** Use Wolfram Alpha for all computations 1. Find rank one 2 by 2 matrix $\tilde A$ closest to $A$. Use Frobenius norm. To find $||A - \tilde{A}||$? $$A=\begin{bmatrix} 1&0\\1&1\\\end{bmatrix}$$ $||A||_F = \sqrt{1^2 + 0^2 + 1^2 + 1^2} = \sqrt{3} = 1.73205080757$ $||A - \tilde{A}||_F= ||\begin{bmatrix} 1&0\\1&1\\\end{bmatrix} - \begin{bmatrix} 0.7236068&0.4472136\\1.17082039&0.7236068\\\end{bmatrix}||_F = ||\begin{bmatrix} 0.2763932&-0.4472136\\-.17082039&0.2763932\\\end{bmatrix}||_F$ $=\sqrt{0.2763932^2 + (-0.4472136)^2 + (-.17082039)^2 + 0.2763932^2}=0.6180339887498948$ Eckhart-Young states that if $B$ is the SVD of $A$ then for any rank $k$ matrix $A_k$ we have $$\sqrt{\sum_{i=k+1}^n \sigma_i^2} = ||B - U_k\Sigma_kV_k^T||_F \leq ||B-A||_F$$. Solve $\tilde{A}=u_1 \cdot \sigma_1 \cdot v_1^T$ $$= \begin{bmatrix}\frac{1+\sqrt{5}}{2\sqrt{.25(1+\sqrt{5})^2 +(1+.5(1+\sqrt{5}))^2}} & \frac{1-\sqrt{5}}{2\sqrt{.25(1-\sqrt{5})^2 +(1+.5(1-\sqrt{5}))^2}}\\ \frac{1+.5(1+\sqrt{5})}{\sqrt{.25(1+\sqrt{5})^2+(1+.5(1+\sqrt{5}))^2}} & \frac{1+.5(1-\sqrt{5})}{\sqrt{.25(1-\sqrt{5})^2 +(1+.5(1-\sqrt{5}))^2}}\end{bmatrix} \begin{bmatrix}\sqrt{\frac{3+\sqrt{5}}{2}} & 0\\0 & 0 \end{bmatrix} \begin{bmatrix}\frac{1+\sqrt{5}}{2\sqrt{1+.25(1+\sqrt{5})^2}} & \frac{1-\sqrt{5}}{2\sqrt{1+.25(1-\sqrt{5})^2}}\\\frac{1}{\sqrt{1+.25(1+\sqrt{5})^2}} & \frac{1}{\sqrt{1+.25(1-\sqrt{5})^2}} \end{bmatrix}$$ This is a mess to solve and retain the solution in quotient form but using python we generated; $$\tilde{A} = \begin{bmatrix} 0.7236068&0.4472136\\1.17082039&0.7236068\\\end{bmatrix}$$ 2. Can you compute $\tilde A$ and $E$ using eigenvectors and eigenvalues of $A$? We can get $A$ from $\tilde{A}$ and $E$ by taking the eigenvector corresponding to the largest one. $A=\tilde{A}$ plus $E$ where $E$ is the error. We have that $E = A-\tilde{A}= \begin{bmatrix} 1&0\\1&1\\\end{bmatrix}- \begin{bmatrix} 0.7236068&0.4472136\\1.17082039&0.7236068\\\end{bmatrix} = \begin{bmatrix} 0.2763932&-0.4472136\\-.17082039&0.2763932\\\end{bmatrix}$ Eigenvalues of $A$ are $\lambda=1$ with multiplicity $2$. The eigenvector of $A$ corresponding to $\lambda=1$ is \begin{bmatrix} 0\\1\\ \end{bmatrix} We can compute $\tilde{A}$ and $E$ from these values using spectral decomposition but I am not sure how to get there although this looks like a pathway but it doesn't seem to make sense. $\lambda_1 v_1 v_1^T+\lambda_2 v_2 v_2^T = 1 \cdot \begin{bmatrix}0&0 \\1&0\end{bmatrix} +1 \cdot \begin{bmatrix}0&0 \\1&0\end{bmatrix}$ 2. Compute the eigenvalues and the unit eigenvectors of $AA^T$ and $A^TA$. What do you notice about the eigenvalues of $A^TA$ and $AA^T$? $AA^T$ $= \begin{bmatrix} 1&1\\1&2\\\end{bmatrix}$ $A^TA$ $= \begin{bmatrix} 1&1\\1&2\\\end{bmatrix}$ Eigenvalues of these matrices are $\lambda_1 = \frac{3+\sqrt{5}}{2}$, and $\lambda_2 = \frac{3-\sqrt{5}}{2}$. We notice that the eigenvalues of $AA^T$ and $A^TA$ are equal. Eigenvectors of this matrix are \begin{bmatrix} -1+ \sqrt{5}\\2\\\end{bmatrix} and \begin{bmatrix} -1- \sqrt{5}\\2\\\end{bmatrix} respectively. 3. Let $\lambda_1$ be the largest eigenvalue, and let ${\bf u_1}$ be the unit eigenvector of $AA^T$ corresponding to $\lambda_1$, let ${\bf v_1}$ be the unit eigenvector of $A^TA$ corresponding to $\lambda_1$. Let $\sigma_1$ be the square root of $\lambda_1$. Compute $$A_1=\sigma_1{\bf u_1}{\bf v_1}^T$$ We have a very messy set of computations to do: $$A_1=\sqrt{\frac{3+\sqrt{5}}{2}}\cdot \begin{bmatrix} -1+ \sqrt{5}\\2\\\end{bmatrix}\cdot \begin{bmatrix} -1+ \sqrt{5},&2\\\end{bmatrix} $$ $$= \begin{pmatrix}\sqrt{\frac{3+\sqrt{5}}{2}}\left(6-2\sqrt{5}\right)&\sqrt{\frac{3+\sqrt{5}}{2}}\left(\sqrt{5}-1\right)\cdot \:2\\ \sqrt{2}\left(\sqrt{5}-1\right)\sqrt{3+\sqrt{5}}&2\sqrt{2}\sqrt{3+\sqrt{5}}\end{pmatrix}$$ $$A_1 =\begin{bmatrix}0.7236068 & 0.44721359\\1.1708204 & 0.7236068\\ \end{bmatrix}$$ *Final matrix found using Python. largest eigenvalue for $AA^T$ and $A^TA$ are the same, use which one? Use singular values which equal the analog of the spectral decomposition of the matrix for a non square matrix 4. Compare $\tilde A$ and $A_1$ $$A_1 =\begin{bmatrix}0.7236068 & 0.44721359\\1.1708204 & 0.7236068\\ \end{bmatrix}$$ $$\tilde{A} = \begin{bmatrix} 0.7236068&0.4472136\\1.17082039&0.7236068\\\end{bmatrix}$$ $\tilde{A}$ = $A_1$ 5. Prove that for any non-zero vectors ${\bf u}$ and ${\bf v}$, the matrix ${\bf u}{\bf v}^T$ has rank 1. Let $u\in R^m$ and $v\in R^n$ and $u,v\neq 0$. Then, we have ${\bf u}{\bf v}^T$ is an $m$x$n$ matrix. This may be written as ${\bf u}{\bf v}^T$= $\begin{bmatrix} u_1\\u_2\\\cdots\\u_m\end{bmatrix}$$\cdot$ $\begin{bmatrix} v_1 & v_2 & \cdots & v_n\end{bmatrix}$ Then we can see that each column is linearly independent and thus $\text{rank}(uv^T)= \text{max(rank}(u), \text{rank}(v^T))$ which equals $1$, since we assumed that neither are a zero vector. 6. Suppose you have an $m\times n$ matrix $M$. Suggest a linear algebra procedure for obtaining the matrix $M_1$, which is the closest rank $1$ matrix to $M$ in Frobenius norm. We can use the matrix $M$'s singular value decomposition. We know that singular values of $M$ are the square roots of the eigenvalues of $M^TM$, denoted by ${\sigma_i}^2$ By definition, the Frobenius norm is equal to the square root of the sum of those eigenvalues, from $i=1$ to $r$, in this case, r$=1$.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully