Calculations of elements in matrix












0












$begingroup$


How do I calculate number of non zero elements of a strictly upper or lower triangular matrix of order (n x n)?










share|cite|improve this question









$endgroup$












  • $begingroup$
    Maybe simply $2S+n=n^2$ corresponding to upper + lower + diagonal = total matrix
    $endgroup$
    – Damien
    Dec 23 '18 at 11:03










  • $begingroup$
    Do you have any more assumptions about what the matrix could be?
    $endgroup$
    – Aniruddh Agarwal
    Dec 23 '18 at 11:12
















0












$begingroup$


How do I calculate number of non zero elements of a strictly upper or lower triangular matrix of order (n x n)?










share|cite|improve this question









$endgroup$












  • $begingroup$
    Maybe simply $2S+n=n^2$ corresponding to upper + lower + diagonal = total matrix
    $endgroup$
    – Damien
    Dec 23 '18 at 11:03










  • $begingroup$
    Do you have any more assumptions about what the matrix could be?
    $endgroup$
    – Aniruddh Agarwal
    Dec 23 '18 at 11:12














0












0








0





$begingroup$


How do I calculate number of non zero elements of a strictly upper or lower triangular matrix of order (n x n)?










share|cite|improve this question









$endgroup$




How do I calculate number of non zero elements of a strictly upper or lower triangular matrix of order (n x n)?







linear-algebra






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Dec 23 '18 at 11:00









user628653user628653

13




13












  • $begingroup$
    Maybe simply $2S+n=n^2$ corresponding to upper + lower + diagonal = total matrix
    $endgroup$
    – Damien
    Dec 23 '18 at 11:03










  • $begingroup$
    Do you have any more assumptions about what the matrix could be?
    $endgroup$
    – Aniruddh Agarwal
    Dec 23 '18 at 11:12


















  • $begingroup$
    Maybe simply $2S+n=n^2$ corresponding to upper + lower + diagonal = total matrix
    $endgroup$
    – Damien
    Dec 23 '18 at 11:03










  • $begingroup$
    Do you have any more assumptions about what the matrix could be?
    $endgroup$
    – Aniruddh Agarwal
    Dec 23 '18 at 11:12
















$begingroup$
Maybe simply $2S+n=n^2$ corresponding to upper + lower + diagonal = total matrix
$endgroup$
– Damien
Dec 23 '18 at 11:03




$begingroup$
Maybe simply $2S+n=n^2$ corresponding to upper + lower + diagonal = total matrix
$endgroup$
– Damien
Dec 23 '18 at 11:03












$begingroup$
Do you have any more assumptions about what the matrix could be?
$endgroup$
– Aniruddh Agarwal
Dec 23 '18 at 11:12




$begingroup$
Do you have any more assumptions about what the matrix could be?
$endgroup$
– Aniruddh Agarwal
Dec 23 '18 at 11:12










1 Answer
1






active

oldest

votes


















1












$begingroup$

For a strictly upper triangular matrix,



$$U=begin{bmatrix}0&a_{12}&ldots&0\0&0&ldots&0\vdots&vdots&ddots&vdots\0&0&ldots&0end{bmatrix}$$



we have $n$ zeroes on the diagonal, $n-1$ zeroes on the sub-diagonal and so on till we have only $1$ zero at the bottom left corner. The number of zero entries is at-least
$$
n + (n - 1) + ldots + 1
= frac{n (n + 1)}{2},
$$

at-least, because the entries above the diagonal can also be zero. The number of non-zero entries is at-most
$$
n^2 - frac{n (n + 1)}{2} = frac{n(n-1)}{2}.
$$



It is easy to see that the case of strictly lower triangular matrices is similar.






share|cite|improve this answer











$endgroup$














    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "69"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3050241%2fcalculations-of-elements-in-matrix%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1












    $begingroup$

    For a strictly upper triangular matrix,



    $$U=begin{bmatrix}0&a_{12}&ldots&0\0&0&ldots&0\vdots&vdots&ddots&vdots\0&0&ldots&0end{bmatrix}$$



    we have $n$ zeroes on the diagonal, $n-1$ zeroes on the sub-diagonal and so on till we have only $1$ zero at the bottom left corner. The number of zero entries is at-least
    $$
    n + (n - 1) + ldots + 1
    = frac{n (n + 1)}{2},
    $$

    at-least, because the entries above the diagonal can also be zero. The number of non-zero entries is at-most
    $$
    n^2 - frac{n (n + 1)}{2} = frac{n(n-1)}{2}.
    $$



    It is easy to see that the case of strictly lower triangular matrices is similar.






    share|cite|improve this answer











    $endgroup$


















      1












      $begingroup$

      For a strictly upper triangular matrix,



      $$U=begin{bmatrix}0&a_{12}&ldots&0\0&0&ldots&0\vdots&vdots&ddots&vdots\0&0&ldots&0end{bmatrix}$$



      we have $n$ zeroes on the diagonal, $n-1$ zeroes on the sub-diagonal and so on till we have only $1$ zero at the bottom left corner. The number of zero entries is at-least
      $$
      n + (n - 1) + ldots + 1
      = frac{n (n + 1)}{2},
      $$

      at-least, because the entries above the diagonal can also be zero. The number of non-zero entries is at-most
      $$
      n^2 - frac{n (n + 1)}{2} = frac{n(n-1)}{2}.
      $$



      It is easy to see that the case of strictly lower triangular matrices is similar.






      share|cite|improve this answer











      $endgroup$
















        1












        1








        1





        $begingroup$

        For a strictly upper triangular matrix,



        $$U=begin{bmatrix}0&a_{12}&ldots&0\0&0&ldots&0\vdots&vdots&ddots&vdots\0&0&ldots&0end{bmatrix}$$



        we have $n$ zeroes on the diagonal, $n-1$ zeroes on the sub-diagonal and so on till we have only $1$ zero at the bottom left corner. The number of zero entries is at-least
        $$
        n + (n - 1) + ldots + 1
        = frac{n (n + 1)}{2},
        $$

        at-least, because the entries above the diagonal can also be zero. The number of non-zero entries is at-most
        $$
        n^2 - frac{n (n + 1)}{2} = frac{n(n-1)}{2}.
        $$



        It is easy to see that the case of strictly lower triangular matrices is similar.






        share|cite|improve this answer











        $endgroup$



        For a strictly upper triangular matrix,



        $$U=begin{bmatrix}0&a_{12}&ldots&0\0&0&ldots&0\vdots&vdots&ddots&vdots\0&0&ldots&0end{bmatrix}$$



        we have $n$ zeroes on the diagonal, $n-1$ zeroes on the sub-diagonal and so on till we have only $1$ zero at the bottom left corner. The number of zero entries is at-least
        $$
        n + (n - 1) + ldots + 1
        = frac{n (n + 1)}{2},
        $$

        at-least, because the entries above the diagonal can also be zero. The number of non-zero entries is at-most
        $$
        n^2 - frac{n (n + 1)}{2} = frac{n(n-1)}{2}.
        $$



        It is easy to see that the case of strictly lower triangular matrices is similar.







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Dec 23 '18 at 12:05

























        answered Dec 23 '18 at 11:20









        Shubham JohriShubham Johri

        5,475818




        5,475818






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3050241%2fcalculations-of-elements-in-matrix%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Willebadessen

            Ida-Boy-Ed-Garten

            Residenzschloss Arolsen