Saturday, February 10, 2024

Axe's Japanese Grammar Reference


中止法

Information in English is sparse. The 連用形 can be used in the middle of a sentence, with a meaning similar to the te-form. When it is used this way, it's called 中止法. Note: いる gets replaced with おる since the stem is nicer. [imabi] [mit] [stack exchange]

Form 中止形
Verb (affirmative) 食べる→食べ
いる→おり
Verb (negative) 食べる→食べず(に)
いない→おらず(に)
しない→せず(に)
いる auxiliary 食べている→食べており
食べていない→食べておらず
I-adj 高い→高く
寒くない→寒くなく

Examples:

  • 店に入り、本を買う
  • 崖から落ち、命を失った
  • 街中は人も少なく、たまに車が通り過ぎるだけだった
  • 木村は現在、外出しており、明日戻ってくる予定です
  • 会議に間に合わず、困った

~を~に

Can be thought of as having a verb omitted after に. [wasabi] [stack exchange]

Either 〜を〜にして (in English, "with ... as ..."):

  • ビーチを会場にコンサートをした
  • 体格を理由に夢を諦めた
  • 本をお土産に友達の家に行った

or 〜を〜に持って ("with ... in ..."):

  • 大きな決意を胸に試合に参加した
  • 友達がお酒を両手に遊びに来た

な and の as Attributive Forms of the Copula

な and の may be seen as attributive (pre-nominal) forms of the copula. To see this, you can replace them with である in the following sentences. Explanatory なんだ can also be seen as an example of this phenomenon. [stack exchange]

  • 日本語が上手な人
  • 明日が雨の場合
  • 治療費が未納の方はお断りしています

Short Causative

The short causative form uses 〜す instead of 〜せる. It can be seen in combination with the passive form, as in 書かされる (instead of 書かせられる). [imabi]

An example in combination with the volitional:

  • 俺がてめーを手放すと思ってんのか⁉︎甘えんだよ?せっかくこれからそのカオと体でかせがそうって時によぉ⁉︎ [reference]

されたし

Keigo, used perhaps within companies. The meaning is 〜をしてほしい. Has a literary flavor. [mayonez] [goo]

  • 今月末までに上京されたし
  • 参考にされたし
  • 支部長室に来られたし
  • 至急されたし

詠嘆の「も」

Used to express emotion (詠嘆), rather than the usual meaning of "too; also". 詠嘆 means "exclamation; admiration," but notably, 嘆 has the meanings "lament" and "sigh of admiration". [stack exchange]

  • 巨人も弱くなったねえ
  • 俺も年をとったなあ
  • あんたも馬鹿だねえ
  • 秋もようやく深まって…

お/ご〜(なさい)

Ever wondered about the auxiliary 〜ておくれ? The pattern お/ご〜なさい forms a command in 尊敬語, but sometimes なさい is omitted. For example, お帰り is short for お帰りなさい. Another familiar example is おやすみ. Some others are お食べ and お上がり. This pattern can explain the auxiliaries 〜ておくれ and 〜てごらん. [chiebukuro]


が as a Case Particle Expressing Contrast

Bears resemblance to the conjunctive particle が meaning "but". Often seen with the formal nouns つもり or はず. Apparently not recognized by dictionaries. [stack exchange]

  • 今日は休む予定が、急な仕事が入ってしまった
  • 大切にしまっておいたはずが、いつのまにかなくなっていた
  • できないと思っていたのが、案外あっさり解決した

Less-Common Contractions

〜らぁ is a contraction of 〜るわ. I believe this わ is the Kansai sentence-ending particle. You can also see 〜てやる contract to 〜たる; combine this with わ and you get 〜たらぁ. [stack exchange]

  • ヤキ入れて追放に決まってんだろ!ハリ倒したらァ!
  • 酒がまずくならあ!

〜たかない is a contraction of 〜たくはない

  • その十一人目も死にたかないだろう [reference]

ところ

There are some unexpected ways ところ can be used.

One usage seems to have developed from 漢文. Goo gives the following definition: 事柄。内容。こと。「思う—あって辞任する」「自分の信じる—を貫く」 [stack exchange] [goo]

  • 法律の定めるところにより処罰する
  • それこそ私の望むところだ
  • 聞くところによると…

Some miscellaneous examples:

  • 2時間10万円のところを、特別価格で9万円にしてやる! [reference]

Sound Alternations

Examples of alternation between り and し:

  • やっぱり・やっぱし
  • ちょっとばかり・ちいとばかし
  • おもいきり・おもっきし

Examples with "b" and "m":

  • さびしい・さみしい
  • さぶい・さむい
  • つぶる・つむる

Emphatic Gemination

Gemination can add emphasis to certain words, such as:

  • 大っ嫌い
  • 一人っきり
  • めっちゃ

I suspect some familiar words were created this way:

  • ばかり→ばっかり
  • やはり→やっぱり
  • よほど→よっぽど
  • あまり→あんまり
  • みな→みんな

Many i-adjectives support emphatic gemination, even before consonants that don't usually allow it:

  • すごい→すっごい・すんごい
  • こわい→こっわ
  • はやい→はっや

It can sometimes be seen in onomatopoeia (さんっざん、びっしょびしょ), and the prefix 真 usually occurs with gemination (真ん丸、真ん中、真っ黒、真っ直ぐ). [stack exchange]

It can also occur with the te-form:

  • まだ住む家が見つかってなくって困ってる
  • こう離れてるとひとり寝は寂しくってたまらねえだろう

Sometimes, gemination before たって is optional, as in the example below. Not clear whether this is emphatic, or due to other reasons.

  • 私は少しくらい高くったって、質のいいものを買うことにしている

べし and ごとし

These words still retain old conjugation, to some extent. [goo] [hjg(1)] [hjg(2)] [hjg(3)] [dojg]

連体形 終止形 連用形
べき べし べく
ごとき ごとし ごとく

連体形 is used before a noun, or to nominalize.

  • 話すべきことは全部話しました
  • 夢のごとき新婚生活の後に悲劇が訪れた
  • お前ごときが魔王に勝てると思うな

終止形 is used to end a sentence. Usually, べきだ is used over べし.

  • 明日は八時までに出勤すべし
  • この件については君が責任をとるべきだ
  • 人生は旅のごとし

連用形 is used to continue a sentence.

  • 大学に進むべく上京した
  • 課長は当然のごとく女性の職員にお茶くみをさせている

Lengthening of Monomoraic Nouns

When monomoraic nouns have a dropped particle, the vowel is lengthened and they become closer to 2 moras in length. You can sometimes see this reflected in the spelling. Some examples from the Fullmetal Alchemist subtitles:

  • 茶ぁ飲んでんじゃねぇ
  • 血ぃ出しすぎだ
  • なんでそんなに気ぃ遣うんだよ
  • アホ 手ぇ出すな

Vowel lengthening is also seen with monomoraic numbers (に and ご) when they're part of a string of digits such as a phone number, and when reciting the days of the week (げつ、かー、すい、もく、きん、どー、にち). [keio] [hinative]


まい、む、and じ

We know about the volitional form (飲もう、食べよう、よかろう、だろう). The negative volitional まい attaches to the dictionary form of verbs (飲むまい、見るまい), but for ichidan verbs it may also connect to the 未然形 (見まい). [imabi]

There are older, less-used volitional auxiliary verbs: む (affirmative) and じ (negative). They both connect to the nai-stem of a verb. む can contract to ん, which can be confusing, since ぬ also contracts to ん. The phrase 神のご加護があらんことを ("May God protect you"), for example, contains not ぬ, but む. [stack exchange] [wordpress]

じ is uncommon in modern Japanese, but here's an example from 新世界より where 逃さじと is used, meaning 逃すまいと or 逃さないように. [stack exchange] [wordpress]

  • 硝煙で、鏑木肆星氏の姿は完全に覆い尽くされてしまう。その機を逃さじと、二匹のバケネズミが突進した。

「ある」Helps Inflect I-Adjectives

Some of the familiar forms of i-adjectives actually contain the verb ある.

  • よくあった→よかった
  • よくあったら→よかったら
  • よくあったり→よかったり
  • よくあろう→よかろう

And some older forms as well:

  • 軽くあらず→軽からず

Here are some more interesting ways ある can help you out with i-adjectives:

  • 強くありたい [reference]
  • 世界が優しくありますように
  • 味方が強くあればあるほど、それだけこちらは楽になる [reference]
  • なんかこいつの説明はあまりに適当過ぎて、そのお陰で確かにわかりやすくはあるんだけれど、しかし他人にそのまま話したりしたら、大恥をかきそうな感じなんだよな……。[化物語]
  • それは嬉しくもあり、寂しくもある [reference]

Delayed も

When も is used with a question word (誰、何、いつ) it means "all" (or "none" if paired with a negative verb); 誰も means "everyone" or "no one", 何も means "nothing", and いつも means "always". What can we make of sentences like the following?

  • どうすることもできない
  • 何をやったとしても不思議じゃない [reference]
  • どの引き出しに入っているのも、仕事の資料ばかり [reference]
  • しかし、誰の助けを借りることもできない [reference]
  • その顔からは何の感情を窺うこともできない [reference]
  • 毎夜三更を過ぎる頃、紀昌の家の屋上で何者の立てるとも知れぬ弓弦の音がする。[名人伝(中島敦)]

Conditional with も

Sometimes 〜ても can be seen as the conditional 〜ては combined with the も particle.

  • 叱ってはいけない、ほめてもいけない [嫌われる勇気]
  • これからおまえたちには片足立ちをしたまま音楽に合わせて手拍子をしてもらう。バランスを崩して両足ついたら失格!拍手が大きくズレても失格!人数が半分になるまで続けてもらう! [reference]

Internally-Headed Relative Clauses

Only partially accepted as grammatical.

  • バンパーにちょっとスレ傷があったのを直して、あちこち点検してランプやら交換して、中をクリーニングしたぐらい。[営繕かるかや怪異譚p233-234]
  • 必要な材木や格子戸は、見栄えを気にしなければ、廃材を貰ってきたのがありますから、それでいけると思います。[営繕かるかや怪異譚p274]
  • 満一歳の誕生日を、アキラはおでこに濡れタオルを当てて迎えた。一週間前から風邪をひいて、三日前には三十八度台の熱が出ていたのが、ようやく平熱近くにまで下がったのだった。[とんびp43]
  • 五寸ほど芽の出掛かった椰子の実の落ちているのを蹴飛ばすと、水の中にころげ入ってボチャンと音を立てる。[真昼(中島敦)]

Sunday, December 30, 2018

The Binary Look-and-Say Sequence

I ran across an interesting math problem here. I've taken the solution posted by Mark Hennings and filled it out with more details.

Problem

Consider the binary look-and-say sequence:

\[ 1, 11, 101, 111011, 11110101, 100110111011, \ldots \]

Each term of the sequence can be generated from the previous term by reading off the digits, always saying how many times the same digit appears consecutively (but converting this number to binary). For example, the fourth term is "three 1s, one 0, two 1s". Three is 11 in binary and two is 10. So the fifth term is 11 1, 1 0, 10 1, or 11110101.

Let \(f(n)\) denote the number of times the string "100" appears in the \(n^\text{th}\) term. Then \(f(8) = 2\), for example, because the \(8^\text{th}\) term equals 111100111010110100110111011.

What is \(\displaystyle\lim_{n\to\infty}\frac{f(n)}{f(n-1)}\)?

Step 1. Express \(f(n)\) as a matrix equation

The terms in this sequence can all be expressed as collections of 10 specific strings. The table below details the strings, and what each string contributes to the next term. This transformation can also be expressed by the matrix \(M\). If \(v(n)\) is a column vector representing the number of times each string occurs in the \(n^\text{th}\) term of the sequence, then \(v(n+1) = M v(n)\).

\[ \begin{array}{ccc} \hline \mathrm{Label} & \mathrm{String} & \mathrm{Becomes} \\ \hline A & 1 & B \\ B & 11 & CA\\ C & 10 & E \\ D & 110 & CD \\ E & 1110 & F \\ F & 11110 & GD \\ G & 100 & I \\ H & 1100 & CH \\ I & 11100 & J \\ J & 111100 & GH \\ \hline \end{array} \qquad M = \left(\begin{array}{cccccccccc} 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ \end{array}\right) \]

It follows that:

\[f(n) = \left( \begin{array}{cccccccccc} 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 \end{array}\right) M^{n-1} v(1)\]

Step 2. Simplify the expression for \(f(n)\)

In order to easily compute powers of \(M\), we can put it in Jordan normal form. First, the characteristic polynomial of \(M\) is \( \chi_M(t) = t^4(t-1)^2(t+1)(t^3 - t^2 - 1) \). From here we can calculate the Jordan normal form \(J\) and transition matrix \(P\). The numbers \(x\), \(y\), and \(z\) are the roots of \(t^3-t^2-1\).

\[ J = \left(\begin{array}{cccccccccc} 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & x & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & y & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & z \end{array}\right) \] \[ P = \left(\begin{array}{cccccccccc} 0 & 0 & 0 & 0 & 0 & 1 & 3 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & -3 & 0 & 0 & 0 \\ 0 & 0 & -1 & 1 & 0 & 0 & 4 & x^2 & y^2 & z^2 \\ 1 & 0 & 0 & 0 & 1 & 0 & -2 & x^2 & y^2 & z^2 \\ 0 & -1 & 1 & 0 & 0 & 0 & -4 & x & y & z \\ -1 & 1 & 0 & 0 & 0 & 0 & 4 & 1 & 1 & 1 \\ 0 & 0 & 1 & -1 & 0 & 0 & -2 & 1 & 1 & 1 \\ -1 & 0 & 0 & -1 & -1 & -1 & 1 & 1 & 1 & 1 \\ 0 & 1 & -1 & 0 & 0 & 0 & 2 & 1/x & 1/y & 1/z \\ 1 & -1 & 0 & 1 & 0 & 0 & -2 & 1/x^2 & 1/y^2 & 1/z^2 \end{array}\right) \]

Substitute \(M=P J P^{-1}\) into the equation for \(f(n)\). Since \(P^{-1}\) is multiplied by \(v(1)\), we only need to find its first column, which we'll call \(p\). We can find it by using Gaussian elimination on the equation \(P p = e_1\), where \(e_1\) is the first column of the identity matrix. It will be necessary to make extensive use of identities like the ones below, which hold for any root \(r\) or any three distinct roots \(a\), \(b\), \(c\) of \(t^3-t^2-1\).

We can almost get away with using dummy variables for the entries of \(p\), which would save a lot of work, but I think it's necessary for later to show that \(p_8 \neq 0\). Besides, it's kind of neat to have a more explicit expression for \(f\).

\[ p = \left(\begin{array}{c} 0 \\ 0 \\ 0 \\ -1 \\ 0 \\ 1/2 \\ 1/6 \\ \frac{(x-1)(y+1)(z+1)}{3(x-y)(x-z)} \\ \frac{(x+1)(y-1)(z+1)}{3(y-x)(y-z)} \\ \frac{(x+1)(y+1)(z-1)}{3(z-x)(z-y)} \end{array}\right) \qquad\qquad\begin{array}{c} \hline \mathrm{Identities} \\ \hline r^3-r^2=1 \\ r-1=1/r^2 \\ abc=1 \\ a+b+c=1 \\ ab=c^2-c \\ a^2b^2=c-1 \\ \hline \end{array} \]

Multiplying everything out, and again making use of the identities, we find:

\begin{multline*} f(n) = -\frac{1}{2} + \frac{1}{6} (-1)^{n} + p_8 x^{n+2} + p_9 y^{n+2} + p_{10} z^{n+2}\qquad\text{if}\quad n > 1 \end{multline*}

Step 3. Find the limit

Now, find the value of \(\lim_{n\to\infty} \frac{f(n)}{f(n-1)}\). Let \(g(n)\) consist of all terms of \(f(n)\) that do not contain \(x\), assuming WLOG that \(x\) is the real root. Since the powers of \(y\) and \(z\) converge to 0, and \(-\frac{1}{2} + \frac{1}{6} (-1)^{n}\) is bounded, \(g(n)\) can be killed off by dividing by \(x^{n+1}\). Note that \(p_8 \neq 0\).

\[ \lim_{n\to\infty} \frac{f(n)}{f(n-1)} = \lim_{n\to\infty}\frac {-\frac{1}{2} + \frac{1}{6} (-1)^{n} + p_8 x^{n+2} + p_9 y^{n+2} + p_{10} z^{n+2}} {-\frac{1}{2} + \frac{1}{6} (-1)^{n-1} + p_8 x^{n+1} + p_9 y^{n+1} + p_{10} z^{n+1}} \] \[ = \lim_{n\to\infty}\cfrac {\cfrac{g(n)}{x^{n+1}} + p_8 x} {\cfrac{g(n-1)}{x^{n+1}} + p_8} = x \approx \boxed{1.46557} \]

Congratulations! If you would like to celebrate with a video, this is John Conway, known for the Game of Life, talking about a similar problem relating to the decimal version of the look-and-say sequence.

Here is a blog post written by Nathaniel Johnston, where he finds the rate of growth and the ratio of ones to zeros for the binary look-and-say sequence. He mentions that "it follows from standard theory of linear homogeneous recurrence relations that we can ... read off all of the long-term behaviour of the binary look-and-say sequence from the eigenvalues and eigenvectors of [the matrix]."

The closed-form expression for the \(n^\text{th}\) Fibonacci number is \(F_n = (\varphi{}^n - \psi{}^n) / \sqrt{5} \), and \(\lim_{n\to\infty} \frac{F_{n+1}}{F_n} = \varphi\). If you write the recurrence in matrix form, \(\varphi\) and \(\psi\) are the eigenvalues.

My computer can calculate values for \(f\) much more quickly using the expression found above, compared to generating the terms of the sequence and searching for occurrences of the substring "100". It takes more than 20 seconds to calculate the values up to \(n = 40\) the slow way, but less than a millisecond the fast way. In this case, math is more powerful than programming! Here's the code I used to take these measurements:

Tuesday, October 30, 2018

Circles Packed in an Ellipse

This animation1 shows four identical circles packed in an ellipse. The circles are tangent to each other and to the ellipse. There are two circles on the x-axis and two on the y-axis. Let \(\theta\) be the angle between the origin, the center of the lower circle, and the center of one of the circles to the left or the right.2 Now let's find the equations of the circles as \(\theta\) varies over time between \(0\) and \(\frac{\pi}{2}\). Assume the radius is \(1\).

\[ \left( x \pm 2\sin\theta \right)^2 + y^2 = 1 \] \[ x^2 + \left( y \pm 2\cos\theta \right)^2 = 1 \]

To find the equation of the ellipse, we need to know the major and minor axes. Finding the major axis is tricky because it sometimes ends on the perimeter of a circle, but sometimes it extends past it. It turns out we actually need three different equations, for when \(\theta\) is in different intervals. The three equations are represented by different colors in the animation.

\begin{align} x^2 + y^2\sin\theta = \left( 1 + 2\sin\theta \right)^2 \qquad & \text{if } \; 0 \leq \theta \leq \alpha \tag{1} \\ \\ \frac{x^2}{\left(1+2\sin\theta\right)^2}+\frac{y^2}{\left(1+2\cos\theta\right)^2}=1 \qquad & \text{if } \; \alpha < \theta \leq \beta \tag{2} \\ \\ x^2\cos\theta+y^2=\left(1+2\cos\theta\right)^2 \qquad & \text{if } \; \beta < \theta \leq \frac{\pi}{2} \tag{3} \\ \\ & \text{where } \alpha \approx 0.355,\; \beta \approx 1.216 \end{align}

The Major Axis

Let's derive equation \((3)\) (the other two aren't any harder). That means \(\theta\) will be near \(\frac{\pi}{2}\). Start with the general equation for an ellipse. The minor axis \(b\) is vertical and it extends from the origin, along the y-axis to the far perimeter of one of the circles, so \(b = 1+2\cos\theta\). To find the major axis \(a\), let's look at the intersections between the ellipse and one of the lateral circles. Solve both equations for \(y^2\) and set them equal to each other.

\begin{equation*} b^2 \left(1 - \frac{x^2}{a^2} \right) = 1 - \left(x + 2\sin\theta \right)^2 \tag{4} \end{equation*}

The blue lines in the image to the right show the values of \(x\) that solve equation \((4)\), for varying values of \(a\) and fixed \(\theta\). Note that some of the solutions are extraneous (when the blue line doesn't intersect the ellipse). We want to choose \(a\) so that the ellipse is tangent to the circle. At that moment, there is exactly one solution for \(x\) (represented as one blue line).3 The equation is quadratic in \(x\), so let's take a look at the discriminant.

\[ D = 16 (1 + \cos\theta) \left( \frac{\left( 1 + 2\cos\theta \right)^2}{a^2} - \cos\theta \right) \]

Setting this to \(0\), we get \(a = \frac{1+2\cos\theta}{\sqrt{\cos\theta}}\).

Bounds

If you don't use the proper bounds \(\alpha\) and \(\beta\), the ellipse will either detach from the circles unnecessarily (as shown), or intersect the circles non-tangentially. I followed a process similar to finding the major axis. I started by looking for intersections between an ellipse equation and one of the circle equations. At the bounds, the number of intersections changes, and I again used the discriminant. This time the only unknown is \(\theta\), and after a lot of simplification, I ended up with a cubic in terms of \(\sin\theta\). Let \(r\) be the real root of \( 4x^3 + 4x^2 + x - 1 \). Then \(\alpha = \sin^{-1} r\) and \(\beta = \cos^{-1} r\).

I thought it was interesting that the different ellipse curves transition smoothly into one another at the bounds, so I graphed their areas as functions of \(\theta\) (in Cartesian coordinates). Not only do they meet at the bounds, but their derivatives are also the same.


1. Created with Desmos.

2. This work was inspired by this problem, which asks for the minimum area of the ellipse.

3. Without the benefit of the animation, how could I conclude that equation \((4)\) should have exactly one solution at the moment of tangency? What if, at that moment, there are two solutions and one of them is extraneous?

Tuesday, September 25, 2018

Young Tableaux

Problem

1 3 6
2 4 7
5 8 9

How many ways can you arrange the numbers 1 through 9 in a 3-by-3 grid such that the following conditions hold?1

  • Every number is greater than the number directly above it.
  • Every number is greater than the number immediately to the left of it.

Solution

Insert the numbers into the grid one at a time, in order from 1 to 9. Each number has to be placed in an upper-left corner (there may be more than one way to do this). Forgetting about which number is in which box, just look at the shape they make. You will get a diagram like the one below. The number of ways to arrange numbers for each shape is always equal to the sum of the shapes feeding into it. The solution, 42, appears at the bottom of the diagram.2


1. I originally saw this problem posted here.

2. Number-filled grids with these properties are known as standard Young tableaux. The diagram used in the solution appears to be a subset of Young's lattice. Another way to find the solution is by using the Hook length formula.