0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【基本情報技術者試験対策】最短経路の問題の解き方

Posted at

参考サイト:
https://www.fe-siken.com/kakomon/30_haru/q2.html

問題

keiro.png

解き方

次の3ステップで解ける

1.点Pから点Rに至る経路数を求める
2.点Rから点Qに至る経路数を求める

  1. 1 × 2

1.点Pから点Rに至る経路数を求める

4回行われる移動のうち上2回の位置が決まると自動的に右2回の位置も決定することから、組合せの公式を用いて次のように求められる。

4C2=(4×3)/2=6(通り)

2.点Rから点Qに至る経路数を求める

4回行われる移動のうち上3回の位置が決まると自動的に右2回の位置も決定することから、組合せの公式を用いて次のように求められる。

5C3=(5×4×3)/(3×2)=10(通り)

余談

右への移動をベースに考えた時でも、求めらえる答えは同じ。

5C2=(5×4)/2=10(通り)

3. 1 × 2

6 × 10 = 60(通り)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?