Find the row/column of the $n^textth$ word in a list of words arranged in a grid
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Here is a list of twelve words arranged in a grid with four rows and three words per row
begingather
textalpha betta gamma
\textone two three
\textbetter faster stronger
\textmajor captain colonel
endgather
How can I find out which row and column the $11^textth$ word, the word "captain", is in? Like, knowing that it's the $11^textth$ word, how can I tell mathematically that it's the second word in the forth row? Or similarly how can I tell the position of the word "better" knowing only that it's the $7^textth$ word in the list?
elementary-number-theory modular-arithmetic
add a comment |Â
up vote
1
down vote
favorite
Here is a list of twelve words arranged in a grid with four rows and three words per row
begingather
textalpha betta gamma
\textone two three
\textbetter faster stronger
\textmajor captain colonel
endgather
How can I find out which row and column the $11^textth$ word, the word "captain", is in? Like, knowing that it's the $11^textth$ word, how can I tell mathematically that it's the second word in the forth row? Or similarly how can I tell the position of the word "better" knowing only that it's the $7^textth$ word in the list?
elementary-number-theory modular-arithmetic
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Here is a list of twelve words arranged in a grid with four rows and three words per row
begingather
textalpha betta gamma
\textone two three
\textbetter faster stronger
\textmajor captain colonel
endgather
How can I find out which row and column the $11^textth$ word, the word "captain", is in? Like, knowing that it's the $11^textth$ word, how can I tell mathematically that it's the second word in the forth row? Or similarly how can I tell the position of the word "better" knowing only that it's the $7^textth$ word in the list?
elementary-number-theory modular-arithmetic
Here is a list of twelve words arranged in a grid with four rows and three words per row
begingather
textalpha betta gamma
\textone two three
\textbetter faster stronger
\textmajor captain colonel
endgather
How can I find out which row and column the $11^textth$ word, the word "captain", is in? Like, knowing that it's the $11^textth$ word, how can I tell mathematically that it's the second word in the forth row? Or similarly how can I tell the position of the word "better" knowing only that it's the $7^textth$ word in the list?
elementary-number-theory modular-arithmetic
edited Jul 21 at 0:07
Mike Pierce
11k93574
11k93574
asked Jul 20 at 18:39
Robbie KN
83
83
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
To answer this, you need to be familiar with modular arithmetic and the floor function.
If your grid has $m$ words per row, then the $k^textth$ word will be the $(k bmod m)^textth$ word in the $(lfloor (k-1)/m rfloor +1)^textth$ row. I think the best way to realize why these formulas work is to try them on a few example words, so for a few specific cases of $k$, and see what happens. A quick point though, the $+1$ and $-1$ in the formula for the row only need to be there because we are indexing our rows and columns starting at $1$ instead of $0$ (i.e. in the above grid we're saying that the word alpha is the first word of the first row, and not the zeroth word of the zeroth row).
$(k bmod m)$ is the remainder when $k$ is divided by $m$. You can't really "replace" it. Instead, learn to love it.
â Mike Pierce
Jul 20 at 20:19
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
To answer this, you need to be familiar with modular arithmetic and the floor function.
If your grid has $m$ words per row, then the $k^textth$ word will be the $(k bmod m)^textth$ word in the $(lfloor (k-1)/m rfloor +1)^textth$ row. I think the best way to realize why these formulas work is to try them on a few example words, so for a few specific cases of $k$, and see what happens. A quick point though, the $+1$ and $-1$ in the formula for the row only need to be there because we are indexing our rows and columns starting at $1$ instead of $0$ (i.e. in the above grid we're saying that the word alpha is the first word of the first row, and not the zeroth word of the zeroth row).
$(k bmod m)$ is the remainder when $k$ is divided by $m$. You can't really "replace" it. Instead, learn to love it.
â Mike Pierce
Jul 20 at 20:19
add a comment |Â
up vote
1
down vote
accepted
To answer this, you need to be familiar with modular arithmetic and the floor function.
If your grid has $m$ words per row, then the $k^textth$ word will be the $(k bmod m)^textth$ word in the $(lfloor (k-1)/m rfloor +1)^textth$ row. I think the best way to realize why these formulas work is to try them on a few example words, so for a few specific cases of $k$, and see what happens. A quick point though, the $+1$ and $-1$ in the formula for the row only need to be there because we are indexing our rows and columns starting at $1$ instead of $0$ (i.e. in the above grid we're saying that the word alpha is the first word of the first row, and not the zeroth word of the zeroth row).
$(k bmod m)$ is the remainder when $k$ is divided by $m$. You can't really "replace" it. Instead, learn to love it.
â Mike Pierce
Jul 20 at 20:19
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
To answer this, you need to be familiar with modular arithmetic and the floor function.
If your grid has $m$ words per row, then the $k^textth$ word will be the $(k bmod m)^textth$ word in the $(lfloor (k-1)/m rfloor +1)^textth$ row. I think the best way to realize why these formulas work is to try them on a few example words, so for a few specific cases of $k$, and see what happens. A quick point though, the $+1$ and $-1$ in the formula for the row only need to be there because we are indexing our rows and columns starting at $1$ instead of $0$ (i.e. in the above grid we're saying that the word alpha is the first word of the first row, and not the zeroth word of the zeroth row).
To answer this, you need to be familiar with modular arithmetic and the floor function.
If your grid has $m$ words per row, then the $k^textth$ word will be the $(k bmod m)^textth$ word in the $(lfloor (k-1)/m rfloor +1)^textth$ row. I think the best way to realize why these formulas work is to try them on a few example words, so for a few specific cases of $k$, and see what happens. A quick point though, the $+1$ and $-1$ in the formula for the row only need to be there because we are indexing our rows and columns starting at $1$ instead of $0$ (i.e. in the above grid we're saying that the word alpha is the first word of the first row, and not the zeroth word of the zeroth row).
edited Jul 21 at 1:28
answered Jul 20 at 18:48
Mike Pierce
11k93574
11k93574
$(k bmod m)$ is the remainder when $k$ is divided by $m$. You can't really "replace" it. Instead, learn to love it.
â Mike Pierce
Jul 20 at 20:19
add a comment |Â
$(k bmod m)$ is the remainder when $k$ is divided by $m$. You can't really "replace" it. Instead, learn to love it.
â Mike Pierce
Jul 20 at 20:19
$(k bmod m)$ is the remainder when $k$ is divided by $m$. You can't really "replace" it. Instead, learn to love it.
â Mike Pierce
Jul 20 at 20:19
$(k bmod m)$ is the remainder when $k$ is divided by $m$. You can't really "replace" it. Instead, learn to love it.
â Mike Pierce
Jul 20 at 20:19
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2857919%2ffind-the-row-column-of-the-n-textth-word-in-a-list-of-words-arranged-in-a-g%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password