So let's try an example. Suppose we wanted to find the days between dates. 2013
Janurary 24, and 2013 June 29th. If we were going to do this as a human we might
look at a calendar. I happen to have a calendar handy and thanks to my auntie in
Belfast for sending me the calendar and we could count the days using the
calendar so let's look at the calendar. We have our starting day is January 24
and we might count the days between January 24. How many do we have left in
January. So there would be 1,2, 3, 4, 5, 6, 7 days left in January. So there'd
be seven days in January. Then we have, have all of February, all of February is
28 days. Then we have all of March, 31 days. All of April, 30 days. All of May,
31 days. And then we have June. We don't want to count all of June because we
are stopping on June 29th, so we are going to add 29 days. From June, and if we
sum all those up we should get our answer. And as a human we know how to compute
sums by entering sums into Google, and we get 156.
例題を解いてみましょう
2013年1月24日から2013年6月29日までの日数を
知りたいとします
人間としてこれを解くにはカレンダーを見るでしょう
たまたま近くにカレンダーがありました
送ってくれたベルファストのおばさんに感謝します
カレンダーを使って日数を数えられるはずです
見てみましょう
始める日は1月24日です
1月24日からの日数を数えると
1月はあと何日あるでしょうか?
1月にはあと1、2、3、4、5、6、7日残っています
つまり1月は7日あります
次に2月のすべての日数があります 2月は28日です
次に3月のすべての日数は31日
4月のすべての日数は30日
5月のすべての日数は31日です
そして6月はすべての日を数えません
6月29日が最後ですので29日を加えます
すべての日数を合計すると答えが得られます
人間として知っているのは
Googleに数式を入力すると計算できることです
156日だと分かります