8
I can see that it is 101 'moving to the right' but I cannot think of a short way to generate it in R language.
\$\begin{bmatrix} 0 & 1 & 0 & 0 & 0 & 0 \\ 1 & 0 & 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 & 0 & 1 \\ 0 & 0 & 0 & 0 & 1 & 0 \\ \end{bmatrix}\$
3
Welcome to the site. Your title and your tags mention R, but the body of your question does not. This is a question in R right? If so this is a [tag:tips] question (you can learn about them here), It would be best if you included your own best try so that answerers can know what level you are currently at.
– Post Rock Garf Hunter – 2019-11-30T13:55:37.5332Am I right in assuming that there is a typo on the last row of your figure? Shouldn't the last
1
be at position [6,5] instead of [6,6]? – Robin Ryder – 2019-11-30T13:59:22.703That's right, many thanks! – Mattex – 2019-11-30T14:07:30.813
1Is this even a challenge for others or is it a legitimate question OP has? – Mark Jeronimus – 2019-12-02T07:01:56.940
@MarkJeronimus I would assume that the challenge writer knows how to write up a matrix in long form. I prefer to assume good faith until evidence appears otherwise, but even if this question was asked in bad faith I'm not sure this matters, it looks like this is an interesting enough question to warrant several answers so even if the OP is not interested in golfing techniques it can still teach others. – Post Rock Garf Hunter – 2019-12-02T14:23:40.463