매일 학교에서 6 계단을 오르는데, 한번에 1 , 2 , 3 계단을 올라 갈수있다.
예를 들어 3 계단을 오르고 , 1 계단 , 2 계단을 오르면 6 계단 을 올라갈수 있다.
계단을 오르는 방법은 몇가지 인가?
Problem
Everyday at school, Jo climbs a flight of
stairs. Jo can take the stairs
,
, or
at a time. For example, Jo could climb
, then
, then
. In how many ways can Jo climb the stairs?








Solution 2
A recursive approach is quick and easy. The number of ways to climb one stair is
. There are
ways to climb two stairs:
,
or
. For 3 stairs, there are
ways: (
,
,
) (
,
) (
,
) (
)














For four stairs, consider what step they came from to land on the fourth stair. They could have hopped straight from the 1st, done a double from #2, or used a single step from #3. The ways to get to each of these steps are
ways to get to step 4. The pattern can then be extended:
steps:
ways.
steps:
ways.
steps:
ways.







Thus, there are
ways to get to step 


풀이 )
계단이 한개 있다면, 오르는 방법은 한가지 밖에 없다.
계단이 두개 있다면, 오르는 방법은 두가지 가 있다.
한번에 두계단을 오르거나, 한계단 한 계단 오를수있다.
계단이 모두 3개 있다면, 오르는 방법은 4가지 가 있다.
한번에 3계단을 오르거나, 2 계단을 오른후 1 계단,
1 계단을 오른후 2 계단, 한번에 한 계단씩 1, 1 ,1
계단이 모두 4개 있다면, 오르는 방법은 7가지 가 있다.
3 1 , 1 3 , 2 2 , 2 1 1 , 1 2 1 , 1 1 2 , 1 1 1 1
모두 7 가지이다.
그런데, 여기서 규칙을 찾을수 있다.
계단이 모두 4개 있다면, 앞에서 구한 결과를 이용할수가 있다.
계단이 한개 있으때 1 가지
계단이 2개 있으때 2 가지
계단이 3개 있으때 4가지
계단이 4개 있으때 1 + 2 + 4 = 7 가지
계단이 5개 있으때 2 + 4 + 7 = 13 가지
계단이 6개 있으때 4 + 7 + 13 = 24 가지
그다음은 7 + 13 + 24
...........
궁금 하면 문의 하세요.
010-3549-5206
댓글
댓글 쓰기