2

In the below code I want to indicate that the entry $(2n-1)+(n-1)^2+(n-2)(n-1)$ appears $n-1$ times in the following $2n\times 1$ vector.

For that I want to show it using an arrow or something similar.

$Q\textbf{w}=
\begin{bmatrix}
(2n-1)^2+(n-1)^2+n\\
(2n-1)+(n-1)^2+(n-2)(n-1)\\
(2n-1)+(n-1)^2+(n-2)(n-1)\\  
\dotso\\ \dotso \\
(2n-1)+(n-1)^2+(n-2)(n-1)\\
(2n-1)+1\\
(2n-1)+1\\ 
\dotso\\ \dotso\\ 
(2n-1)+1
\end{bmatrix}
$

Can somone kindly comment how to show this using an arrow?

I tried to use the command "\braces" but cant do it.

Please help.

Mico
  • 506,678
Charlotte
  • 963

1 Answers1

3

As was the case in my answer to your earlier query (which was about how to indicate the dimensions of the components of a row vector), I would not use arrows here. Instead, I would use vertical curly braces to the right of the column vector.

I would also like to suggest that you use \vdots ("vertical dots") instead of \dotso\\ \dotso.

The following answer assumes that it's a good idea to indicate the dimensions of the sub-vectors to the right of rather than inside the column vector.

Asides: (i) \mathstrut inserts a (typographic) strut: an object with zero width (hence making it invisible) and the height and depth of a parenthesis, i.e., ")". (ii) Do please make a habit of using \mathbf instead of \textbf in math environments.

enter image description here

\documentclass{article}
\usepackage{amsmath}    % for 'bmatrix' env.
\usepackage{mleftright} % for cramped versions of \left and \right
\usepackage{booktabs}   % for '\addlinespace' macro
\newcommand{\mathstrutx}{\vphantom{\vdots}} % extra-tall typographic strut
\begin{document}

\[
Q\mathbf{w}=
\begin{bmatrix}
    (2n-1)^2+(n-1)^2+n\\
    (2n-1)+(n-1)^2+(n-2)(n-1)\\ 
    \vdots \\
    (2n-1)+(n-1)^2+(n-2)(n-1)\\ \addlinespace
    (2n-1)+1\\ 
    \vdots\\ 
    (2n-1)+1
\end{bmatrix}\mkern-9mu % less horiz. separation
%% Now for the stuff to the right of the column vector:
\begin{array}{@{}l@{}}
    \mathstrut\\
    \mleft.\begin{array}{@{}l@{}}
        \mathstrut \\ \mathstrutx \\ \mathstrut
    \end{array}\mright\}\text{\footnotesize $n-1$ times}\\ \addlinespace
    \mleft.\begin{array}{@{}l@{}}
        \mathstrut \\ \mathstrutx \\ \mathstrut
    \end{array}\mright\}\text{\footnotesize $n$ times}
\end{array}
\]
\end{document}
Mico
  • 506,678
  • 2
    Remark: I'm aware of the powerful blkarray package; its machinery could quite likely be used to provide a different solution for the problem at hand. However, given the (IMHO) fairly simple use case we're faced with here, employing a bunch of nested arrays seems more straightforward. However, others may well disagree; I'd be curious to see a solution that employs the blkarray machinery. – Mico Jul 11 '19 at 04:39
  • Thats excellent ! – Charlotte Jul 12 '19 at 12:06