The Novels

Sociology 500, a Romance (Second Draft) -- The first book in the Economics 101 Trilogy.
Karel and Dan, former American football teammates and now graduate students, meet fellow graduate students Kristie and Bobbie, and the four form a steady study group.

Economics 101, a Novel (Rough Draft) -- My first sustained attempt at a novel, two-thirds finished in rough draft, and heading a little too far south.
What would you do if you and your study partner, with whom you had been seriously discussing marriage, suddenly found yourselves all alone together on a desert island?

Featured Post

Sociology 500, a Romance, ch 1 pt 1 -- Introducing Bobbie

TOC Well, let's meet Roberta Whitmer. Bobbie entered the anthropology department office and looked around. Near the receptionis...

Tuesday, April 11, 2017

Sociology 500, a Romance, ch 3 pt 10 -- Computers

Previous




"Thank you, Karen and Georgia, for volunteering to do the typing." Professor Billings turned back to Ted. "It looks like you've got your chart ready."

"Of course it's just like the first year from the computer generated chart, but it's a little more readable."
      Month   Length Sum    End 
Time-division:  30    30   29.39
Deep-winter:    29    59   58.78
War-time:       30    89   88.18
Thaw-time:      29   118  117.57
Rebirth:        29   147  146.96
Brides-month:   30   177  176.35
Imperious:      29   206  205.75
Glorious:       30   236  235.14
False-summer:   29   265  264.53
Harvest:        29   294  293.92
Gratitude:      30   324  323.31
Winter-month:   29   353  352.71

(You'll notice that some of the names of their months parallel ours and some don't. Winter solstice was usually the first day of Time-division, so that month started earlier than January starts for us.)

"I think I would show this chart to young students instead of the computer generated charts, or at least show it first. And I think it'd work best to have the students help me put the chart up -- ask about each month, add things up, and so forth."

"Sounds good," Professor Billings agreed.

Merill asked, "Is there a reason you didn't have the computer put the names of the months in the computer chart?"

"I was focusing on the math. Eventually, as Professor Billings suggested, I want to use double integers in the sums so I can print out a listing up to the present and beyond. But I haven't written all the double length integer routines yet."

"Can your computer do that?" asked the professor.

"Shouldn't be a problem. It's just a few more functions."

Ultimately, it wasn't a problem for him, and it's only a problem for us if we try to run the code below on an old eight or sixteen bit processor.

"So how much of a problem would it be to have the computer print the names of the months, too?"

Ted laughed. "Not too much. But there are several ways to do it, and I have a bad habit of trying to make the program too general, which means I tend to do things the hard way." Ted did not elaborate. I might explain later.

But I have the same bad habit. Come to think of it, so did Mr. Mon, whom we have heard a little about, 'though not yet by name.

"Nice chart," the professor complimented him.

"Yeah. But I want to write a program to print out a regular calendar for any month of any year, too."

Carl was the one to ask, "You can do that?"

"It should be possible, just a matter of the time to write the program. I should be able to show the phases of the moons, as well."

Georgia asked, with just a little acid in her tone, "So, you just happened to bring this printout today?"

Ted laughed a little shyly, "Not really. I read in the syllabus that we would be studying skip years, and started working on this program Saturday night."

The professor frowned in concern. "Please don't let this put a crimp in your social life."

Ted shrugged.

Mark asked, "So is there a way we could bring this whiz-bang computer into a classroom for students to, I don't know, interact with?"

Ted opened his mouth as if to say, "Sure!", but then he closed it without saying anything. He looked at Dan, as if looking for help.

Dan raised his hands in a hands-off gesture. "Don't look at me."

Ted mumbled, "Maybe, ... maybe not ..."

Dan face showed a bit of consternation. He said, "I'm trying to do what the judge said, too, although you know I don't think he had any authority to put a gag on me."

The classroom was suddenly dead quiet. All ears listened.

Dan continued, "Anyway, sorry, Mark, but Ted can't even say he can't talk about that. And, theoretically, I was not supposed to say what I just said." Dan's expression changed from irritation to amusement. "And I can't believe I just actually used the word, 'theoretically'. And I can't believe I'm going to ask everyone to forget you heard any of this." Chuckling, he shook his head.

There was scattered nervous laughter.

Kristie felt indignant that her friends would be so imposed upon. But, not knowing about the non-disclosure agreement, she didn't know what to think. In fact, this was the first indication she had that Ted and Dan knew each other very well.

Bess spoke up. "My dad is actually working on a device to let computers print things to a television screen. That would be really useful in a classroom. He thinks they will one day be cheap enough to have in regular elementary school classrooms, too."

Dan rolled his eyes, and Ted showed his surprise.

But Dan bit his tongue. Instead of commenting on the futility of non-disclosure agreements, he said, "Really? That's way cool. Does he think the prices of computers themselves will drop, too?"

Now Ted was indignant, but he also held his tongue.

Bess said, excitedly, "Yes, he does. He says according to his calculations, they could eventually be cheap enough and small enough for ordinary people to own."

Many of the students began to talk excitedly about the possibility of having a computer, and about what they might do with one.

Then Professor Billings noticed the clock and said, "Oh. Look at the time. We're done for today."

As the students left, a number of them gathered around Bess and Professor Billings to talk about the possibility of schools being able to afford a computer.

Merill left quietly.

Ted and Dan stayed away from the group and talked in low voices.

"Karel is right," Dan said. "Your old boss ought to be sharing his stuff, not trying to keep it secret so he can patent it all and have a monopoly."

"The more time passes, the more I agree with Karel. Maybe I should have just let the computer go to junk instead of signing the NDA so I could bid on it."

Kristie listened quietly.

"Would it have made any difference about the court order not to talk?"

"I don't know. Karel thought my signature gave weight to Mr. Mon's arguments."

"It puts you and Karel and Merill in a tough spot. Me too, even though I only heard a few things about it from Karel before the gag order was set."

"Sorry about that."

"I'd have gone to have a little talk with that judge, but Dad told me to forget it."

"I couldn't just let the computer go to scrap. All the work we put into it. And the programming system would have just been lost."

"I was wondering about that."

"No, Mr. Mon said we could let people see the high-level code, just not the parts that would be needed to build the system. I think he thought rumors would be good advertising."

"If we were allowed to talk, there'd be even better advertising."

The professor joined them, and asked, "Will what happened now cause trouble for you guys?"

"I don't think so," Ted replied. "I said nothing, and Dan can claim best effort."

Kristie spoke up. "We were going to meet Karel and Bobbie for lunch."

"Ah. Gotta go."

"Me, too."

And they gathered their books and said goodbye to the professor and left.



So, while they go to meet Bobbie and Karel, should we take a look at Ted's work?



( Forth code for calculating idealized lengths of months )
( relative to skip years in the world of )
( Bobbie, Karel, Dan, and Kristi, Sociology 500, a Novel. )

( by Ted Turpin, of the Union of Independent States, Xhilr )
( Earth Copyright 2017, Joel Matthew Rees )

( Permission granted to use for personal entertainment only. )

( -- If you need it for other purposes, rewriting it yourself is not that hard, )
( and the result will be guaranteed to satisfy your needs much more effectively. )



( You can save it as something like "econmonths.fs". )
( In gforth and most modern or emulated environments, )
( just paste it into the terminal of a running Forth session. )

( Run it with

 7 SHOWIDEALMONTHS

  for seven years, etc. )


( Uses integer math throughout. )
( Forth expression syntax is mostly postfix. )
( Only the definition syntax is prefix or infix. )
( I've added some comments with equivalent infix expressions )
( to help those unfamiliar with Forth. )


( Using baroque identifiers for ancient Forths. )
( fig-Forth used first three character + length significance in symbol tables. )


( UM*, FM/MOD, and S>D are already there in most modern Forths. )
( These definitions are only for ancient Forths, )
( especially pre-1983 fig and bif-c. )
( Un-comment them if you see errors like )
( UM* ? err # 0 )
( from PRMONTH or thereabouts. )

( : UM* U* ; ) ( modern name for unsigned mixed multiply )

( This is a cheat! Behavior is not well defined for negative numbers, )
( but we don't do negatives here. )
( So this is just sloppy renaming in a sloppy fashion: )
( : FM/MOD M/MOD DROP ; ) ( unsigned division with modulo remainder )

( : S>D S->D ; ) ( Modern name for single-to-double. )

( Showing the above in infix won't help. )

SP@ SP@ - ABS CONSTANT CELLWIDTH
( Infix won't help here, either, but I can try to explain: )
( CELLWIDTH = absolute-value-of difference-between SP-without-pointer and SP-with-pointer.  )

( Semi-simulate local variables with the ability to fetch and store relative to top of stack. )

( Infix will be confusing here, too. )
: LC@ ( index -- sp[ix] ) ( 0 is top. PICK is available on many modern Forths. )
  1 + CELLWIDTH *  ( Skip over the stack address on stack. )
  SP@ + @  ( Assumes push-down stack. Will fail on push-up. )
;

( Infix will be confusing here, too. )
: LC! ( n index -- ) ( 0 is top. Just store. This is not ROLL. )
  2 + CELLWIDTH *  ( Index and stack address are extra on stack during calculation. )
  SP@ +  ( Assumes push-down stack. )
  ! ( *** Will fail in MISERABLE ways on push-up stacks! *** )
;

( Make things easier to read. )
( Infix will be confusing here, too. )

: PRCH EMIT ;

: COMMA 44 PRCH ;
: COLON 58 PRCH ;
: POINT 46 PRCH ;
: LPAREN 40 PRCH ;
: RPAREN 41 PRCH ;

( No trailing space. )
: PSNUM ( number -- )
 0 .R ;


( Do it in integers! )

( Watch limits on 16 bit processors! )

7 CONSTANT SCYCLE ( years in short cycle )
( SCYCLE = 7 )

7 2 * CONSTANT SPMCYC ( short cycles in medium cycle )
( SPMCYC = 7 × 2 )

SCYCLE SPMCYC * CONSTANT MCYCLE ( years in medium cycle, should be 98 )
( MCYCLE = SCYCLE × SPMCYC )

7 7 * CONSTANT SPLCYC ( short cycles in single long cycle )
( SPLCYC = 7 × 7 )

SCYCLE SPLCYC * CONSTANT LCYCLE ( years in single long cycle, should be 343 )
( LCYCLE = SCYCLE × SPLCYC )

7 CONSTANT MP2LCYC ( medium cycles in double long cycle )
( MP2LCYC = 7 )
( MPLCYC would not be an integer: 3 1/2 )

MCYCLE MP2LCYC * CONSTANT 2LCYCLE ( years in double long cycle, should be 686 )
( 2LCYCLE = MCYCLE × MP2LCYC )

352 CONSTANT DPSKIPYEAR ( floor of days per year  )


5 CONSTANT RDSCYCLE ( remainder days in short cycle )

DPSKIPYEAR SCYCLE * RDSCYCLE + CONSTANT DPSCYCLE ( whole days per 7 year cycle )
( DPSCYCLE = DPSKIPYEAR × SCYCLE + RDSCYCLE )
( DPSCYCLE SPMCYC * CONSTANT DPMCYCLE )
( DPMCYCLE = DPSCYCLE × SPMCYC )
( DPMCYCLE MP2LCYC * CONSTANT DP2LCYCLE )
( DP2LCYCLE = DPMCYCLE × MP2LCYC )
( DPMCYCLE and DP2LCYCLE would overflow on 16 bit math CPUs. )
( No particular problem on 32 bit CPUs.

RDSCYCLE SPMCYC * 1 - CONSTANT RDMCYCLE ( remainder days in medium cycle )
( RDMCYCLE = RDSCYCLE × SPMCYC - 1 )

RDMCYCLE MP2LCYC * 2 + CONSTANT RD2LCYCLE ( remainder days in double long cycle -- odd number )
( RD2LCYCLE = RDMCYCLE × MP2LCYC + 2 )
( RD2LCYCLE / 2LCYCLE is fractional part of year. )
( Ergo, length of year is DPSKIPYEAR + RD2LCYCLE / 2LCYCLE, )
( or 352 485/686 days. )

12 CONSTANT MPYEAR ( months per year )

DPSKIPYEAR MPYEAR /MOD CONSTANT FDMONTH ( floor of days per month )
( FDMONTH = DPSKIPYEAR / MPYEAR )
CONSTANT FRMONTH ( floored minimum remainder days per month )
( FRMONTH = DPSKIPYEAR MOD MPYEAR )

2LCYCLE MPYEAR * CONSTANT MDENOMINATOR ( denominator of month fractional part )
( MDENOMINATOR = 2LCYCLE × MPYEAR  )

FRMONTH 2LCYCLE * RD2LCYCLE + CONSTANT MNUMERATOR ( numerator of month fractional part )
( MNUMERATOR  = FRMONTH × 2LCYCLE + RD2LCYCLE )
( Ergo, length of month is FDMONTH + MNUMERATOR / MDENOMINATOR, )
( or 29 3229/8232 days. )

MDENOMINATOR 2 / CONSTANT MROUNDFUDGE

( Infix will be confusing below here, as well. )
( Hopefully, the comments and explanations will provide enough clues. )

( Sum up the days of the months in a year. )
: SU1MONTH ( startfractional startdays -- endfractional enddays )
  FDMONTH + ( Add the whole part. )
  SWAP ( Make the fractional part available to work on. )
  MNUMERATOR + ( Add the fractional part. )
  DUP MDENOMINATOR < ( Have we got a whole day yet? )
  IF
    SWAP ( No, restore stack order for next pass. )
  ELSE
    MDENOMINATOR - ( Take one whole day from the fractional part. )
    SWAP 1+ ( Restore stack and add the day carried in. )
  ENDIF
;

: PRMONTH ( fractional days -- fractional days )
  SPACE DUP PSNUM POINT ( whole days )
  OVER 1000 UM* ( Fake three digits of decimal precision. )
  MROUNDFUDGE 0 D+ ( Round the bottom digit. )
  MDENOMINATOR FM/MOD ( Divide, or evaluate the fraction. )
  S>D <# # # # #> ( Formatting puts most significant digits in buffer first. )
  TYPE ( Fake decimal output. )
  DROP SPACE
;

: SH1IDEALYEAR ( year daysmemory fractional days -- year daysmemory fractional days )
  CR
  12 0 DO
    3 LC@ PSNUM SPACE ( year )
    I PSNUM COLON SPACE
    SU1MONTH
    DUP 3 LC@ - ( difference in days )
    2 LC@ ( ceiling ) IF 1+ ENDIF
    DUP PSNUM SPACE ( show theoretical days in month )
    3 LC@ + ( sum of days )
    LPAREN DUP PSNUM COMMA SPACE
    2 LC! ( update )
    PRMONTH RPAREN CR
  LOOP
;

: SHOWIDEALMONTHS ( years -- )
  >R
  0 0 0 0 ( year, daysmemory, fractional, days )
  R> 0 DO
    CR
    SH1IDEALYEAR
    3 LC@ 1+ 3 LC!
  LOOP
  DROP DROP DROP DROP
;

  0 CONSTANT SKMONTH
  1 CONSTANT SK1SHORTCYC
  4 CONSTANT SK2SHORTCYC
 48 CONSTANT SKMEDIUMCYC
186 CONSTANT LPLONGCYC  ( Must be short1 or short2 within the seven year cycle. )

( Since skipyears are the exception, )
( we test for skipyears instead of leapyears. )
( Calendar system starts with year 0, not year 1. )
( Would need to check and adjust if the calendar started with year )
: ISKIPYEAR ( year -- flag )
  DUP MCYCLE MOD SKMEDIUMCYC =
  IF DROP -1  ( One specified extra skip year in medium cycle. )
  ELSE
    DUP SCYCLE MOD DUP
    SK1SHORTCYC =
    SWAP SK2SHORTCYC = OR  ( Two specified skip years in short cycle, but ... )
    SWAP LCYCLE MOD LPLONGCYC = 0= AND ( not the specified exception in the long cycle. )
  ENDIF
;


( At this point, I hit a condundrum. )
( Modern "standard" Forths want uninitialized variables, )
( but ancient, especially fig-Forths want initialized variables. )
( The lower-level <BUILDS DOES> for fig is only partially part of the modern standard. )
( And CREATE is initialized as a CONSTANT in the fig-Forth, )
( but has no initial characteristic code or value in modern standards. )
( So. )
( On ancient Forths, VARIABLE wants an initial value. We give it a zero. )
( The zero stays around forever on modern Forths, or until you drop it. )
0 VARIABLE DIMARRAY  ( Days In Months array )
   30 DIMARRAY !  ( 1st month )
   29 ,
   30 ,
   29 ,
   29 ,
   30 ,
   29 ,
   30 ,
   29 ,
   29 ,
   30 ,
   29 ,
   0 ,

: DIMONTH ( year month -- days )
  DUP 0 < 0=
  OVER MPYEAR < AND 0=
  IF
    DROP DROP 0  ( Out of range. No days. )
  ELSE
    DUP CELLWIDTH * DIMARRAY + @  ( Get the basic days. )
    SWAP SKMONTH =  ( true if skip month )
    ROT ISKIPYEAR AND  ( true if skip month of skip year )
    1 AND - ( Subtrahend is 1 only if skip month of skip year. )
  ENDIF
;
   
: SH1YEAR ( year daysmemory fractional days -- year daysmemory fractional days )
  CR
  12 0 DO
    3 LC@ PSNUM SPACE ( year )
    I PSNUM COLON SPACE
    SU1MONTH  ( ideal month )
    3 LC@ I DIMONTH  ( real month )
    DUP PSNUM SPACE ( show days in month )
    3 LC@ + ( sum of days )
    LPAREN DUP PSNUM COMMA SPACE
    2 LC! ( update )
    PRMONTH RPAREN CR
  LOOP
;

: SHOWMONTHS ( years -- )
  >R
  0 0 0 0 ( year, daysmemory, fractional, days )
  R> 0 DO
    CR
    SH1YEAR
    3 LC@ 1+ 3 LC!
  LOOP
  DROP DROP DROP DROP
;



Copying and pasting from here doesn't work very well. You can download the source code from
https://osdn.net/users/reiisi/pastebin/4990
You can save the file as something like "econmonths.fs".

In most modern Forths, you can just paste it into a running Forth session, and run it with
7 SHOWIDEALMONTHS
to show the ideal months that Ted talks about here, or
7 SHOWMONTHS
to show the months by the skip years, according to their calendar. You can compare the two, to see how their skip years keep the slippage minimal, restoring to no slippage at all after six hundred eight-six years.

If you need a Forth to run it on, you can find gforth at
<https://www.gnu.org/software/gforth/>.
You can also find it in the packages of most modern OS distributions and in many application stores. (It is Android's store, but not in iOS's, at least, not at the time I wrote this.) For MSWindows, you can download Cygwin at <https://www.cygwin.com/> and get gforth through the Cygwin packages.

If you like to compile things like this yourself, I guess I won't need to tell you how.

HTML documentation can be found on the web at <http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/>, which includes a tutorial for experienced programmers. An easier tutorial can be found in the book, Starting Forth, which can be found here: <https://www.forth.com/starting-forth/>.

Gforth is not the only Forth which will work, I think most modern Forths will run the code without modification.

The newsgroup comp.lang.forth, which can be accessed through newsreaders and various web interfaces is a good source of amusing and sometimes informative conversation about Forth.

If you like compiling things to play with, I have my own Forth, written in C, which you can find here: <http://bif-c.sourceforge.net/>. You'll want to look at the wiki, too: <https://sourceforge.net/p/bif-c/wiki/Home/>.

If Forth's postfix syntax is uncomfortable, I wrote similar programs in the Basic Calulator utility, bc, which is generally part of most modern operating system distributions without having to get it from packages. (You can get it as a package through Cygwin if you are running one of Microsoft's OSses.)

Just run "bc" from the command line and paste in the bc code, which you can get here: <https://osdn.net/users/reiisi/pastebin/4988>.

And, as I suggest in the code comments, you might modify the code to see how well your own leap year system works for your world. (Pretty well, really.)



You may have noticed, their calendar includes zeros. Years, months, days, all start with the zeroeth. That's a little different from us, isn't it?

And you're probably wondering about hours and minutes at this point. Similar to the way it happened in our world, the 12 constellations that represented the months also represented the hours of the night. Day and night were divided into four watches, and the night had three constellations per watch, so the day did, too.

Then some bright soul recognized that day and night varied in length, and instead of tying the hours to dawn or sunset, tied them to noon. And the royalty of his country liked it and it stuck for the more progressive parts of the world.

Sixty minute hours were derived from twelves, to give sixty minute hours and sixty second minutes. And that's convenient for us, because we could get confused if they used hundreds or forty-nines or base two.

(I really would have liked to show Ted's original programs. But I would have to write the emulator for the hardware he used, write the assembler and use it to bootstrap the language interpreter, write tools for converting -- meaningfully -- from their character set to ours, and so on. And I'd want to construct a font for their characters, too. That's a lot of work. Maybe if I ever write a best seller and make a million dollars off of it, I'll be able to break loose the time and hire the employees to do such a thing. ;-)

Previous TOC Next



[Backup and edit history are here: http://joel-rees-economics.blogspot.com/2017/04/backup-soc500-03-10-computers.html.]




[Chapter 3 part 10 is original to the second draft, and is not found in the first draft. Chronologically, it would be placed in chapter five of the first draft: http://free-is-not-free.blogspot.com/2016/05/economics-101-novel-ch05-first-semester.html.]



Backup: Sociology 500, a Romance, ch 3 pt 10 -- Computers

[JMR201704121825: metadata edits -- Title/name.]

Sociology 500, a {replace}Novel{with}Romance{replace.}, ch 3 pt 10 -- Computers

[JMR201704121825: end metadata edit.]


[JMR201704121022: edits -- cleanup.]

"{replace}It's{with}Of course it's{replace.} just like the first year from the computer generated chart, but a little more readable."

---------------

(You'll notice that some of the names of their months parallel ours and some don't. Winter solstice was usually the first day of Time-division, so {replace}it{with}that month{replace.} started earlier than January starts for us.)

---------------

"Shouldn't be a problem. It's just {replace}another function{with}a few more functions{replace.}."

---------------

But I have the same bad habit. Come to think of it, so did Mr. Mon, whom we have heard a little about, {replace}but{with}'though{replace.} not yet by name.

---------------

Dan continued, "Anyway, sorry, Mark, but Ted can't even say he can't talk about that. And, theoretically, I was not supposed to say what I just said." Dan's expression changed from irritation to amusement. "And I can't believe I just actually used the word, 'theoretically'. And I can't believe I'm going to ask everyone to forget you heard any of this."{add} Chuckling, he shook his head.{add.}

---------------

Bess said, {add}excitedly, {add.}"Yes, he does. He says according to his calculations, they could eventually be cheap enough and small enough for ordinary people to own."

---------------

{replace}The{with}Many of the{replace.} students began to talk excitedly about the possibility of having a computer{replace} and{with}, and about{replace.} what they might do with one.

---------------

Then Professor Billings {add}noticed the clock {add.}and said, "Oh. Look at the time. {replace}Class dismissed{with}We're done for today{replace.}."

---------------

"The more time passes, the more I {replace}think Karel was right{with}agree with Karel{replace.}. Maybe I should have just let the computer go to junk instead of signing the NDA so I could bid on it."

---------------

"I'd have gone to {replace}give the judge a piece of my mind{with}have a little talk with that judge{replace.}, but Dad told me to forget it."

---------------

So, while they go to meet Bobbie and Karel, should we take a look at Ted's {replace}programs{with]work{replace.}?

[JMR201704121022: end-edits.]

[JMR201704120928: backup of http://joel-rees-economics.blogspot.com/2017/04/soc500-03-10-computers.html.]
Previous




"Thank you, Karen and Georgia, for volunteering to do the typing." Professor Billings turned back to Ted. "It looks like you've got your chart ready."

"It's just like the first year from the computer generated chart, but a little more readable."
      Month   Length Sum    End 
Time-division:  30    30   29.39
Deep-winter:    29    59   58.78
War-time:       30    89   88.18
Thaw-time:      29   118  117.57
Rebirth:        29   147  146.96
Brides-month:   30   177  176.35
Imperious:      29   206  205.75
Glorious:       30   236  235.14
False-summer:   29   265  264.53
Harvest:        29   294  293.92
Gratitude:      30   324  323.31
Winter-month:   29   353  352.71

(You'll notice that some of the names of their months parallel ours and some don't. Winter solstice was usually the first day of Time-division, so it started earlier than January starts for us.)

"I think I would show this chart to young students instead of the computer generated charts, or at least show it first. And I think it'd work best to have the students help me put the chart up -- ask about each month, add things up, and so forth."

"Sounds good," Professor Billings agreed.

Merill asked, "Is there a reason you didn't have the computer put the names of the months in the computer chart?"

"I was focusing on the math. Eventually, as Professor Billings suggested, I want to use double integers in the sums so I can print out a listing up to the present and beyond. But I haven't written all the double length integer routines yet."

"Can your computer do that?" asked the professor.

"Shouldn't be a problem. It's just another function."

Ultimately, it wasn't a problem for him, and it's only a problem for us if we try to run the code below on an old eight or sixteen bit processor.

"So how much of a problem would it be to have the computer print the names of the months, too?"

Ted laughed. "Not too much. But there are several ways to do it, and I have a bad habit of trying to make the program too general, which means I tend to do things the hard way." Ted did not elaborate. I might explain later.

But I have the same bad habit. Come to think of it, so did Mr. Mon, whom we have heard a little about, but not yet by name.

"Nice chart," the professor complimented him.

"Yeah. But I want to write a program to print out a regular calendar for any month of any year, too."

Carl was the one to ask, "You can do that?"

"It should be possible, just a matter of the time to write the program. I should be able to show the phases of the moons, as well."

Georgia asked, with just a little acid in her tone, "So, you just happened to bring this printout today?"

Ted laughed a little shyly, "Not really. I read in the syllabus that we would be studying skip years, and started working on this program Saturday night."

The professor frowned in concern. "Please don't let this put a crimp in your social life."

Ted shrugged.

Mark asked, "So is there a way we could bring this whiz-bang computer into a classroom for students to, I don't know, interact with?"

Ted opened his mouth as if to say, "Sure!", but then he closed it without saying anything. He looked at Dan, as if looking for help.

Dan raised his hands in a hands-off gesture. "Don't look at me."

Ted mumbled, "Maybe, ... maybe not ..."

Dan face showed a bit of consternation. He said, "I'm trying to do what the judge said, too, although you know I don't think he had any authority to put a gag on me."

The classroom was suddenly dead quiet. All ears listened.

Dan continued, "Anyway, sorry, Mark, but Ted can't even say he can't talk about that. And, theoretically, I was not supposed to say what I just said." Dan's expression changed from irritation to amusement. "And I can't believe I just actually used the word, 'theoretically'. And I can't believe I'm going to ask everyone to forget you heard any of this."

There was scattered nervous laughter.

Kristie felt indignant that her friends would be so imposed upon. But, not knowing about the non-disclosure agreement, she didn't know what to think. In fact, this was the first indication she had that Ted and Dan knew each other very well.

Bess spoke up. "My dad is actually working on a device to let computers print things to a television screen. That would be really useful in a classroom. He thinks they will one day be cheap enough to have in regular elementary school classrooms, too."

Dan rolled his eyes, and Ted showed his surprise.

But Dan bit his tongue. Instead of commenting on the futility of non-disclosure agreements, he said, "Really? That's way cool. Does he think the prices of computers themselves will drop, too?"

Now Ted was indignant, but he also held his tongue.

Bess said, "Yes, he does. He says according to his calculations, they could eventually be cheap enough and small enough for ordinary people to own."

The students began to talk excitedly about the possibility of having a computer and what they might do with one.

Then Professor Billings said, "Oh. Look at the time. Class dismissed."

As the students left, a number of them gathered around Bess and Professor Billings to talk about the possibility of schools being able to afford a computer.

Merill left quietly.

Ted and Dan stayed away from the group and talked in low voices.

"Karel is right," Dan said. "Your old boss ought to be sharing his stuff, not trying to keep it secret so he can patent it all and have a monopoly."

"The more time passes, the more I think Karel was right. Maybe I should have just let the computer go to junk instead of signing the NDA so I could bid on it."

Kristie listened quietly.

"Would it have made any difference about the court order not to talk?"

"I don't know. Karel thought my signature gave weight to Mr. Mon's arguments."

"It puts you and Karel and Merill in a tough spot. Me too, even though I only heard a few things about it from Karel before the gag order was set."

"Sorry about that."

"I'd have gone to give the judge a piece of my mind, but Dad told me to forget it."

"I couldn't just let the computer go to scrap. All the work we put into it. And the programming system would have just been lost."

"I was wondering about that."

"No, Mr. Mon said we could let people see the high-level code, just not the parts that would be needed to build the system. I think he thought rumors would be good advertising."

"If we were allowed to talk, there'd be even better advertising."

The professor joined them, and asked, "Will what happened now cause trouble for you guys?"

"I don't think so," Ted replied. "I said nothing, and Dan can claim best effort."

Kristie spoke up. "We were going to meet Karel and Bobbie for lunch."

"Ah. Gotta go."

"Me, too."

And they gathered their books and said goodbye to the professor and left.



So, while they go to meet Bobbie and Karel, should we take a look at Ted's programs?



( Forth code for calculating idealized lengths of months )
( relative to skip years in the world of )
( Bobbie, Karel, Dan, and Kristi, Sociology 500, a Novel. )

( by Ted Turpin, of the Union of Independent States, Xhilr )
( Earth Copyright 2017, Joel Matthew Rees )

( Permission granted to use for personal entertainment only. )

( -- If you need it for other purposes, rewriting it yourself is not that hard, )
( and the result will be guaranteed to satisfy your needs much more effectively. )



( You can save it as something like "econmonths.fs". )
( In gforth and most modern or emulated environments, )
( just paste it into the terminal of a running Forth session. )

( Run it with

 7 SHOWIDEALMONTHS

  for seven years, etc. )


( Uses integer math throughout. )
( Forth expression syntax is mostly postfix. )
( Only the definition syntax is prefix or infix. )
( I've added some comments with equivalent infix expressions )
( to help those unfamiliar with Forth. )


( Using baroque identifiers for ancient Forths. )
( fig-Forth used first three character + length significance in symbol tables. )


( UM*, FM/MOD, and S>D are already there in most modern Forths. )
( These definitions are only for ancient Forths, )
( especially pre-1983 fig and bif-c. )
( Un-comment them if you see errors like )
( UM* ? err # 0 )
( from PRMONTH or thereabouts. )

( : UM* U* ; ) ( modern name for unsigned mixed multiply )

( This is a cheat! Behavior is not well defined for negative numbers, )
( but we don't do negatives here. )
( So this is just sloppy renaming in a sloppy fashion: )
( : FM/MOD M/MOD DROP ; ) ( unsigned division with modulo remainder )

( : S>D S->D ; ) ( Modern name for single-to-double. )

( Showing the above in infix won't help. )

SP@ SP@ - ABS CONSTANT CELLWIDTH
( Infix won't help here, either, but I can try to explain: )
( CELLWIDTH = absolute-value-of difference-between SP-without-pointer and SP-with-pointer.  )

( Semi-simulate local variables with the ability to fetch and store relative to top of stack. )

( Infix will be confusing here, too. )
: LC@ ( index -- sp[ix] ) ( 0 is top. PICK is available on many modern Forths. )
  1 + CELLWIDTH *  ( Skip over the stack address on stack. )
  SP@ + @  ( Assumes push-down stack. Will fail on push-up. )
;

( Infix will be confusing here, too. )
: LC! ( n index -- ) ( 0 is top. Just store. This is not ROLL. )
  2 + CELLWIDTH *  ( Index and stack address are extra on stack during calculation. )
  SP@ +  ( Assumes push-down stack. )
  ! ( *** Will fail in MISERABLE ways on push-up stacks! *** )
;

( Make things easier to read. )
( Infix will be confusing here, too. )

: PRCH EMIT ;

: COMMA 44 PRCH ;
: COLON 58 PRCH ;
: POINT 46 PRCH ;
: LPAREN 40 PRCH ;
: RPAREN 41 PRCH ;

( No trailing space. )
: PSNUM ( number -- )
 0 .R ;


( Do it in integers! )

( Watch limits on 16 bit processors! )

7 CONSTANT SCYCLE ( years in short cycle )
( SCYCLE = 7 )

7 2 * CONSTANT SPMCYC ( short cycles in medium cycle )
( SPMCYC = 7 × 2 )

SCYCLE SPMCYC * CONSTANT MCYCLE ( years in medium cycle, should be 98 )
( MCYCLE = SCYCLE × SPMCYC )

7 7 * CONSTANT SPLCYC ( short cycles in single long cycle )
( SPLCYC = 7 × 7 )

SCYCLE SPLCYC * CONSTANT LCYCLE ( years in single long cycle, should be 343 )
( LCYCLE = SCYCLE × SPLCYC )

7 CONSTANT MP2LCYC ( medium cycles in double long cycle )
( MP2LCYC = 7 )
( MPLCYC would not be an integer: 3 1/2 )

MCYCLE MP2LCYC * CONSTANT 2LCYCLE ( years in double long cycle, should be 686 )
( 2LCYCLE = MCYCLE × MP2LCYC )

352 CONSTANT DPSKIPYEAR ( floor of days per year  )


5 CONSTANT RDSCYCLE ( remainder days in short cycle )

DPSKIPYEAR SCYCLE * RDSCYCLE + CONSTANT DPSCYCLE ( whole days per 7 year cycle )
( DPSCYCLE = DPSKIPYEAR × SCYCLE + RDSCYCLE )
( DPSCYCLE SPMCYC * CONSTANT DPMCYCLE )
( DPMCYCLE = DPSCYCLE × SPMCYC )
( DPMCYCLE MP2LCYC * CONSTANT DP2LCYCLE )
( DP2LCYCLE = DPMCYCLE × MP2LCYC )
( DPMCYCLE and DP2LCYCLE would overflow on 16 bit math CPUs. )
( No particular problem on 32 bit CPUs.

RDSCYCLE SPMCYC * 1 - CONSTANT RDMCYCLE ( remainder days in medium cycle )
( RDMCYCLE = RDSCYCLE × SPMCYC - 1 )

RDMCYCLE MP2LCYC * 2 + CONSTANT RD2LCYCLE ( remainder days in double long cycle -- odd number )
( RD2LCYCLE = RDMCYCLE × MP2LCYC + 2 )
( RD2LCYCLE / 2LCYCLE is fractional part of year. )
( Ergo, length of year is DPSKIPYEAR + RD2LCYCLE / 2LCYCLE, )
( or 352 485/686 days. )

12 CONSTANT MPYEAR ( months per year )

DPSKIPYEAR MPYEAR /MOD CONSTANT FDMONTH ( floor of days per month )
( FDMONTH = DPSKIPYEAR / MPYEAR )
CONSTANT FRMONTH ( floored minimum remainder days per month )
( FRMONTH = DPSKIPYEAR MOD MPYEAR )

2LCYCLE MPYEAR * CONSTANT MDENOMINATOR ( denominator of month fractional part )
( MDENOMINATOR = 2LCYCLE × MPYEAR  )

FRMONTH 2LCYCLE * RD2LCYCLE + CONSTANT MNUMERATOR ( numerator of month fractional part )
( MNUMERATOR  = FRMONTH × 2LCYCLE + RD2LCYCLE )
( Ergo, length of month is FDMONTH + MNUMERATOR / MDENOMINATOR, )
( or 29 3229/8232 days. )

MDENOMINATOR 2 / CONSTANT MROUNDFUDGE

( Infix will be confusing below here, as well. )
( Hopefully, the comments and explanations will provide enough clues. )

( Sum up the days of the months in a year. )
: SU1MONTH ( startfractional startdays -- endfractional enddays )
  FDMONTH + ( Add the whole part. )
  SWAP ( Make the fractional part available to work on. )
  MNUMERATOR + ( Add the fractional part. )
  DUP MDENOMINATOR < ( Have we got a whole day yet? )
  IF
    SWAP ( No, restore stack order for next pass. )
  ELSE
    MDENOMINATOR - ( Take one whole day from the fractional part. )
    SWAP 1+ ( Restore stack and add the day carried in. )
  ENDIF
;

: PRMONTH ( fractional days -- fractional days )
  SPACE DUP PSNUM POINT ( whole days )
  OVER 1000 UM* ( Fake three digits of decimal precision. )
  MROUNDFUDGE 0 D+ ( Round the bottom digit. )
  MDENOMINATOR FM/MOD ( Divide, or evaluate the fraction. )
  S>D <# # # # #> ( Formatting puts most significant digits in buffer first. )
  TYPE ( Fake decimal output. )
  DROP SPACE
;

: SH1IDEALYEAR ( year daysmemory fractional days -- year daysmemory fractional days )
  CR
  12 0 DO
    3 LC@ PSNUM SPACE ( year )
    I PSNUM COLON SPACE
    SU1MONTH
    DUP 3 LC@ - ( difference in days )
    2 LC@ ( ceiling ) IF 1+ ENDIF
    DUP PSNUM SPACE ( show theoretical days in month )
    3 LC@ + ( sum of days )
    LPAREN DUP PSNUM COMMA SPACE
    2 LC! ( update )
    PRMONTH RPAREN CR
  LOOP
;

: SHOWIDEALMONTHS ( years -- )
  >R
  0 0 0 0 ( year, daysmemory, fractional, days )
  R> 0 DO
    CR
    SH1IDEALYEAR
    3 LC@ 1+ 3 LC!
  LOOP
  DROP DROP DROP DROP
;

  0 CONSTANT SKMONTH
  1 CONSTANT SK1SHORTCYC
  4 CONSTANT SK2SHORTCYC
 48 CONSTANT SKMEDIUMCYC
186 CONSTANT LPLONGCYC  ( Must be short1 or short2 within the seven year cycle. )

( Since skipyears are the exception, )
( we test for skipyears instead of leapyears. )
( Calendar system starts with year 0, not year 1. )
( Would need to check and adjust if the calendar started with year )
: ISKIPYEAR ( year -- flag )
  DUP MCYCLE MOD SKMEDIUMCYC =
  IF DROP -1  ( One specified extra skip year in medium cycle. )
  ELSE
    DUP SCYCLE MOD DUP
    SK1SHORTCYC =
    SWAP SK2SHORTCYC = OR  ( Two specified skip years in short cycle, but ... )
    SWAP LCYCLE MOD LPLONGCYC = 0= AND ( not the specified exception in the long cycle. )
  ENDIF
;


( At this point, I hit a condundrum. )
( Modern "standard" Forths want uninitialized variables, )
( but ancient, especially fig-Forths want initialized variables. )
( The lower-level <BUILDS DOES> for fig is only partially part of the modern standard. )
( And CREATE is initialized as a CONSTANT in the fig-Forth, )
( but has no initial characteristic code or value in modern standards. )
( So. )
( On ancient Forths, VARIABLE wants an initial value. We give it a zero. )
( The zero stays around forever on modern Forths, or until you drop it. )
0 VARIABLE DIMARRAY  ( Days In Months array )
   30 DIMARRAY !  ( 1st month )
   29 ,
   30 ,
   29 ,
   29 ,
   30 ,
   29 ,
   30 ,
   29 ,
   29 ,
   30 ,
   29 ,
   0 ,

: DIMONTH ( year month -- days )
  DUP 0 < 0=
  OVER MPYEAR < AND 0=
  IF
    DROP DROP 0  ( Out of range. No days. )
  ELSE
    DUP CELLWIDTH * DIMARRAY + @  ( Get the basic days. )
    SWAP SKMONTH =  ( true if skip month )
    ROT ISKIPYEAR AND  ( true if skip month of skip year )
    1 AND - ( Subtrahend is 1 only if skip month of skip year. )
  ENDIF
;
   
: SH1YEAR ( year daysmemory fractional days -- year daysmemory fractional days )
  CR
  12 0 DO
    3 LC@ PSNUM SPACE ( year )
    I PSNUM COLON SPACE
    SU1MONTH  ( ideal month )
    3 LC@ I DIMONTH  ( real month )
    DUP PSNUM SPACE ( show days in month )
    3 LC@ + ( sum of days )
    LPAREN DUP PSNUM COMMA SPACE
    2 LC! ( update )
    PRMONTH RPAREN CR
  LOOP
;

: SHOWMONTHS ( years -- )
  >R
  0 0 0 0 ( year, daysmemory, fractional, days )
  R> 0 DO
    CR
    SH1YEAR
    3 LC@ 1+ 3 LC!
  LOOP
  DROP DROP DROP DROP
;



Copying and pasting from here doesn't work very well. You can download the source code from
https://osdn.net/users/reiisi/pastebin/4990
You can save the file as something like "econmonths.fs".

In most modern Forths, you can just paste it into a running Forth session, and run it with
7 SHOWIDEALMONTHS
to show the ideal months that Ted talks about here, or
7 SHOWMONTHS
to show the months by the skip years, according to their calendar. You can compare the two, to see how their skip years keep the slippage minimal, restoring to no slippage at all after six hundred eight-six years.

If you need a Forth to run it on, you can find gforth at
<https://www.gnu.org/software/gforth/>.
You can also find it in the packages of most modern OS distributions and in many application stores. (It is Android's store, but not in iOS's, at least, not at the time I wrote this.) For MSWindows, you can download Cygwin at <https://www.cygwin.com/> and get gforth through the Cygwin packages.

If you like to compile things like this yourself, I guess I won't need to tell you how.

HTML documentation can be found on the web at <http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/>, which includes a tutorial for experienced programmers. An easier tutorial can be found in the book, Starting Forth, which can be found here: <https://www.forth.com/starting-forth/>.

Gforth is not the only Forth which will work, I think most modern Forths will run the code without modification.

The newsgroup comp.lang.forth, which can be accessed through newsreaders and various web interfaces is a good source of amusing and sometimes informative conversation about Forth.

If you like compiling things to play with, I have my own Forth, written in C, which you can find here: <http://bif-c.sourceforge.net/>. You'll want to look at the wiki, too: <https://sourceforge.net/p/bif-c/wiki/Home/>.

If Forth's postfix syntax is uncomfortable, I wrote similar programs in the Basic Calulator utility, bc, which is generally part of most modern operating system distributions without having to get it from packages. (You can get it as a package through Cygwin if you are running one of Microsoft's OSses.)

Just run "bc" from the command line and paste in the bc code, which you can get here: <https://osdn.net/users/reiisi/pastebin/4988>.

And, as I suggest in the code comments, you might modify the code to see how well your own leap year system works for your world. (Pretty well, really.)



You may have noticed, their calendar includes zeros. Years, months, days, all start with the zeroeth. That's a little different from us, isn't it?

And you're probably wondering about hours and minutes at this point. Similar to the way it happened in our world, the 12 constellations that represented the months also represented the hours of the night. Day and night were divided into four watches, and the night had three constellations per watch, so the day did, too.

Then some bright soul recognized that day and night varied in length, and instead of tying the hours to dawn or sunset, tied them to noon. And the royalty of his country liked it and it stuck for the more progressive parts of the world.

Sixty minute hours were derived from twelves, to give sixty minute hours and sixty second minutes. And that's convenient for us, because we could get confused if they used hundreds or forty-nines or base two.

(I really would have liked to show Ted's original programs. But I would have to write the emulator for the hardware he used, write the assembler and use it to bootstrap the language interpreter, write tools for converting -- meaningfully -- from their character set to ours, and so on. And I'd want to construct a font for their characters, too. That's a lot of work. Maybe if I ever write a best seller and make a million dollars off of it, I'll be able to break loose the time and hire the employees to do such a thing. ;-)

Previous TOC Next



[Backup and edit history will eventually be here: http://joel-rees-economics.blogspot.com/2017/04/backup-soc500-03-10-computers.html.]




[Chapter 3 part 10 is original to the second draft, and is not found in the first draft. Chronologically, it would be placed in chapter five of the first draft: http://free-is-not-free.blogspot.com/2016/05/economics-101-novel-ch05-first-semester.html.]

[JMR201704120928: end-backup.]

Saturday, April 8, 2017

Backup: Sociology 500, a Novel, ch 3 pt 9 -- Calculating Months in Skip Years

[JMR201704101934: edits -- forgotten structure.]


[Backup and edit history {replace}will eventually be{with}are{replace.} here: http://joel-rees-economics.blogspot.com/2017/04/backup-soc500-03-09-calculating-months-skip-years.html.]

[JMR201704101934: end-edits.]


[JMR201704082007: edits -- minor stuff.]

To which Professor Billings said, "Ted is being kind enough to loan it to the department." The department had had to {replace}scramble{with}scrounge{replace.} for the budget for the electricity, and we'll find out more about that later. The professor {replace}added{with}asked{replace.}, "Do you have the printout with you?"

[JMR201704082007: end-edits.]

[JMR201704081836: backup of http://joel-rees-economics.blogspot.com/2017/04/soc500-03-09-calculating-months-skip-years.html.]
Previous




Ted picked up the model of the solar system and demonstrated the orbit of their planet again. "We should focus the children's attention on the tilt of the earth, as Jack diagrammed. It would probably be good to review the reasons for the seasons."

Georgia asked, "When the north pole is tilted towards the sun, that's summer for us in the northern hemisphere, right?"

Professor Billings asked, "Anyone still not clear on that point? You don't want to find yourself in class, wondering which is which, with students looking at you and expecting you to know all the answers."

Jack asked, "Isn't the physics of the seasons obvious? I mean, we would expect to not even need that model in high school, right?"

Karen complained. "It's obvious to you. I'm still trying to figure it out. Is the sun that much closer to us in summer?"

"Yeah," Jack replied sarcastically. "A fraction of a percent makes that much difference."

"Jack, you'll confuse people." said Merill. "Karen, think of the sun against your car roof. At an angle, the light tends to reflect more."

Jack grumbled. "Maybe, maybe not."

"Okay," Karen said hesitantly. "I can see the angle being important. There was a teacher who explained it to us as distance when I was in elementary school, and I've been confused since then."

Ted said, "Well, it is partly distance, but the distance that is relevant is the distance through the atmosphere due to the angle, not the distance from the sun. But, more basically, like Merill says, the angle reduces the amount of sunlight that reaches the surface. And that's more important." And he drew a diagram on the chalkboard, of sunlight hitting their earth:


Karen still looked puzzled. "I'm not seeing it."

So Kristie stood up and said, "There's another way to draw that diagram that helped me." And she drew a second version of the diagram, using a polygon instead of a circle:



"It helped me see that the deeper angle reduces the amount of sunlight for the same amount of surface area." Then she picked up a textbook and held it in front of a window, rotating it to show the area being struck by sunlight. "Like this."

Karen thought a few moments and said, "Thanks, I think I can see that."

Kristie gave the chalk back to Ted and he started started writing out a chart on the chalkboard.

Dan grumbled. "You and Karel."

Kristie smiled as she sat down, and members of the class who knew our four protagonists laughed.

Karen continued after some thought, "I think I can probably draw diagrams like that in a class."

While Ted wrote, Professor Billings pointed out, "This kind of discussion often does much more than a lecture." He paused. "You may feel a little out of control, during the discussion, but I strongly urge you to learn to use this kind of discussion, in every grade you teach."

Ted turned around. "And if we can get the students to draw the diagrams and write the math on the board themselves, that works even better, right?"

"You've heard it before."

General laughter.

"So," Ted returned to the board, to the left of the chart he had been working on, and said, "if we can satisfy the students about the measured length of the solar year, we can tell them that the length of the year is three hundred fifty-two whole days and four hundred eighty-five six eighty-sixths of a day. But we probably want to show them decimal fractions, too:
1 year: 352 485/686 days (about 352.7070)
Carl asked, "How do we connect that with sevens?"

Dan said, "Write the factors on the board, two times seven cubed."

Ted stopped, and he and many of the students turned to look at Dan.

"What? I didn't say I couldn't do any math at all, just not comfortable with some of it." Dan was grinning sheepishly.

More laughter, which Ted and Dan joined as Ted wrote out the factors on the board:
2 × 7 = 14, 14 × 7 = 98
98 × 7 = 686, 686 ÷ 2 = 343
Dan continued, "And we could work out the decimal fraction, to show how close it is to five sevenths. Should I work that out?"

Professor Billing smiled and held up a piece of chalk, which Dan took to a chalkboard at the side of the room, to show the long division for 5/7 and 485/686:
   0.714287             0.70699
 -----------        -------------
7| 5.0000000     686| 485.0000000
   4.9                480.2
     10                 4.800
     07                 4.116
      30                  6840
      28                  6174
       20                  6660
       14                  6174
        60                  4860
        56   
         40  
         35 
          50
And Dan sat down.

Carl pressed the question. "Is that the closest small fraction?"

Ted said, "Actually, I've got a chart of fractions that I printed up on the computer, where we can get a look at that question."

There were some complaints.

"Braggart."

And, "How come he's so lucky?"

Etc.

To which Professor Billings said, "Ted is being kind enough to loan it to the department." The department had had to scramble for the budget for the electricity, and we'll find out more about that later. The professor added, "Do you have the printout with you?"

"Yeah."

"I'll go get the overhead projector."

"I'll help you," Mark volunteered, and Mark followed the professor into the prep room as Ted went back to writing on the board.

Do you remember those heavy, hot, smelly, fragile overhead projectors we used to use, back in the 1950s and '60s? And big. That was what Mark and the professor emerged carrying. They set it up on a desk in front of a screen and plugged it into the wall to get the lamp warming up while Ted continued his explanation.

"We probably want to ask how many months in a year and show the division:"
1 ideal month: 352.7070 ÷ 12 = 29.39225 days
"Ideal month?" queried the professor.

"We can say it's some crazy professor's idea of a better month, but it isn't a real month."

"That explanation of ideal might work."

Ted continued, "Here's a question I think young kids will find interesting: If we used this exact length for the month, at what hour of the day on January 30th would it become February 1st?" And he showed them where he had written out the math for that, to the side of the still incomplete chart:
0.39225 * 24 = 9.414 hours
0.414 * 60 = 24.84 minutes
Before 9:25 A.M., January 30th.
After 9:25, February 1st.
While the other students absorbed that, he continued, "Then we can ask whether they would think it interesting for January thirtieth to suddenly turn into February first at about nine twenty five in the morning."

Jack suggested, "That's going to get some students excited, maybe too excited."

Dan chuckled. "It's the kind of thing Karel would say just as we split up for our specialty practice. Make sure we had plenty of time to think about it."

Kristie suggested, "Maybe you could save it until just before lunchtime? then the students would have lots of time to talk about it and forget their excitement."

Jack scratched his head. "Maybe, if you could get the timing right."

The professor was chuckling. He suggested, "Ted, let's look at your chart of fractions."

Ted dug a computer printout out of his books and handed it to the professor, who put it on the overhead projector's light stage.



: PRCH EMIT ;

: COMMA 44 PRCH ;
: COLON 58 PRCH ;

( No trailing space. )
: PSNUM ( number -- )
  0 .R ;

: NUMERATORS ( count -- )
DUP 1+ 0 DO
   I PSNUM COLON SPACE
   I 1000 * OVER / PSNUM COMMA ( 1000 times I divided by count )
   SPACE LOOP
DROP ;

: FRACTIONS ( count -- )
CR
1+ 1 DO
   I PSNUM SPACE I NUMERATORS CR
LOOP ;



"What's this?"

"That's the program."

Okay, it isn't exactly the program code he showed. Although the colon and semicolon were similar, most of the characters did not look much like our Latin-based alphabet. And I've translated it into symbols derived from English.

But the postfix grammar was surprisingly similar to the language Forth.

Maybe not so surprising, if we consider what a progressive definition grammar would naturally look like.

I made sure the translation would run in most Forth interpreters, if you are interested in trying it out. It definitely works in gforth, which is relatively easy to get for most PCs and for Android phones. Probably the easiest way to get it on a MSWindows PC is to go to the Cygwin site and install that, then use Cygwin's installer to get gforth. Android's Play Store has it, and, if you are using a Linux OS, it is probably in the packages.

(It also runs in my bif-c interpreter, but that is not easy to get if you aren't into compiling things yourself.)

In our world, it would have been a few more years before Forth became somewhat available, but we'll hear more about that later.

Professor Billings moved the printout down on the staging table to show the chart:


9 fractions                    
1 0: 0, 1: 1000,
2 0: 0, 1: 500, 2: 1000,
3 0: 0, 1: 333, 2: 666, 3: 1000,
4 0: 0, 1: 250, 2: 500, 3: 750, 4: 1000,
5 0: 0, 1: 200, 2: 400, 3: 600, 4: 800, 5: 1000,
6 0: 0, 1: 166, 2: 333, 3: 500, 4: 666, 5: 833, 6: 1000,
7 0: 0, 1: 142, 2: 285, 3: 428, 4: 571, 5: 714, 6: 857, 7: 1000,
8 0: 0, 1: 125, 2: 250, 3: 375, 4: 500, 5: 625, 6: 750, 7: 875, 8: 1000,
9 0: 0, 1: 111, 2: 222, 3: 333, 4: 444, 5: 555, 6: 666, 7: 777, 8: 888, 9: 1000,


He used a pen to trace through the listing. "Okay, these are the first three digits to the right of the decimal point, right?"

"Right. So we can see that 0.714 in the fives column of the sevens row is about the closest fraction less than ten."

Jack was still doubtful. "But seven tenths is closer than five sevenths."

"Well," Carl spoke up again, "When somebody way back there in our history first set up our modern calendar, he wouldn't have even had mechanical calculators, and the numbering system wasn't always base ten. And it took several centuries to get the length of the year accurately measured, didn't it?"

While the rest of the class talked about this, Ted finished his chart on the chalkboard.

"What's this?" Professor Billings asked, as he slid the listing across the stage table so the class could see it:


7 showmonths

0 0: 30 (30,  29.392 )
0 1: 29 (59,  58.784 )
0 2: 30 (89,  88.177 )
0 3: 29 (118,  117.569 )
0 4: 29 (147,  146.961 )
0 5: 30 (177,  176.353 )
0 6: 29 (206,  205.746 )
0 7: 30 (236,  235.138 )
0 8: 29 (265,  264.530 )
0 9: 29 (294,  293.922 )
0 10: 30 (324,  323.315 )
0 11: 29 (353,  352.707 )


1 0: 30 (383,  382.099 )
1 1: 29 (412,  411.491 )
1 2: 29 (441,  440.884 )
1 3: 30 (471,  470.276 )
1 4: 29 (500,  499.668 )
1 5: 30 (530,  529.060 )
1 6: 29 (559,  558.453 )
1 7: 29 (588,  587.845 )
1 8: 30 (618,  617.237 )
1 9: 29 (647,  646.629 )
1 10: 30 (677,  676.022 )
1 11: 29 (706,  705.414 )


2 0: 29 (735,  734.806 )
2 1: 30 (765,  764.198 )
2 2: 29 (794,  793.591 )
2 3: 29 (823,  822.983 )
2 4: 30 (853,  852.375 )
2 5: 29 (882,  881.767 )
2 6: 30 (912,  911.160 )
2 7: 29 (941,  940.552 )
2 8: 29 (970,  969.944 )
2 9: 30 (1000,  999.336 )
2 10: 29 (1029,  1028.729 )
2 11: 30 (1059,  1058.121 )


3 0: 29 (1088,  1087.513 )
3 1: 29 (1117,  1116.905 )
3 2: 30 (1147,  1146.298 )
3 3: 29 (1176,  1175.690 )
3 4: 30 (1206,  1205.082 )
3 5: 29 (1235,  1234.474 )
3 6: 29 (1264,  1263.867 )
3 7: 30 (1294,  1293.259 )
3 8: 29 (1323,  1322.651 )
3 9: 30 (1353,  1352.043 )
3 10: 29 (1382,  1381.436 )
3 11: 29 (1411,  1410.828 )


4 0: 30 (1441,  1440.220 )
4 1: 29 (1470,  1469.612 )
4 2: 30 (1500,  1499.005 )
4 3: 29 (1529,  1528.397 )
4 4: 29 (1558,  1557.789 )
4 5: 30 (1588,  1587.181 )
4 6: 29 (1617,  1616.574 )
4 7: 29 (1646,  1645.966 )
4 8: 30 (1676,  1675.358 )
4 9: 29 (1705,  1704.750 )
4 10: 30 (1735,  1734.143 )
4 11: 29 (1764,  1763.535 )


5 0: 29 (1793,  1792.927 )
5 1: 30 (1823,  1822.319 )
5 2: 29 (1852,  1851.712 )
5 3: 30 (1882,  1881.104 )
5 4: 29 (1911,  1910.496 )
5 5: 29 (1940,  1939.888 )
5 6: 30 (1970,  1969.281 )
5 7: 29 (1999,  1998.673 )
5 8: 30 (2029,  2028.065 )
5 9: 29 (2058,  2057.457 )
5 10: 29 (2087,  2086.850 )
5 11: 30 (2117,  2116.242 )


6 0: 29 (2146,  2145.634 )
6 1: 30 (2176,  2175.026 )
6 2: 29 (2205,  2204.419 )
6 3: 29 (2234,  2233.811 )
6 4: 30 (2264,  2263.203 )
6 5: 29 (2293,  2292.595 )
6 6: 29 (2322,  2321.988 )
6 7: 30 (2352,  2351.380 )
6 8: 29 (2381,  2380.772 )
6 9: 30 (2411,  2410.164 )
6 10: 29 (2440,  2439.557 )
6 11: 29 (2469,  2468.949 )
 ok


"I calculated out a chart to show how the lengths of months would mesh with the lengths of days cumulatively across seven years. It might be useful for demonstrating how variable a calendar would be if we didn't use something like skip years. Typing it up for a duplicator would be a lot of work. But you can see how the first year in that chart looks a lot like the calendar we use."

The professor moved the chart back up to year zero and let the students look it over. Then he asked, "How hard would it be to go to 700 years, so we could get a look at the entire cycle?"

"Waste of paper and ink, I'd say. Also, I'd have to fix part of the program that can only calculate to a bit more than thirty thousand days."

"Oh. So even a hundred years is going to be too many, then?"

"If I don't fix it."

"Well, it would be nice to pass this table out to everyone. Anyone want to type it up for the duplicator?"

Xerography was still too expensive to substitute for stencil or spirits duplicators, so copying out material like this still required a lot of manual labor. Georgia and Karen volunteered to type it up.



And this chapter is getting a bit long, so I'm going to arbitrarily end it here so you and I can take a break.

Previous TOC Next



[Backup and edit history will eventually be here: http://joel-rees-economics.blogspot.com/2017/04/backup-soc500-03-09-calculating-skip-years.]



[Chapter 3 part 9 is original to the second draft, and is not found in the first draft. Chronologically, it would be placed in chapter five of the first draft: http://free-is-not-free.blogspot.com/2016/05/economics-101-novel-ch05-first-semester.html.]
[JMR201704081836: end-backup.] 

Friday, April 7, 2017

Sociology 500, a Novel, ch 3 pt 9 -- Calculating Months in Skip Years

Previous




Ted picked up the model of the solar system and demonstrated the orbit of their planet again. "We should focus the children's attention on the tilt of the earth, as Jack diagrammed. It would probably be good to review the reasons for the seasons."

Georgia asked, "When the north pole is tilted towards the sun, that's summer for us in the northern hemisphere, right?"

Professor Billings asked, "Anyone still not clear on that point? You don't want to find yourself in class, wondering which is which, with students looking at you and expecting you to know all the answers."

Jack asked, "Isn't the physics of the seasons obvious? I mean, we would expect to not even need that model in high school, right?"

Karen complained. "It's obvious to you. I'm still trying to figure it out. Is the sun that much closer to us in summer?"

"Yeah," Jack replied sarcastically. "A fraction of a percent makes that much difference."

"Jack, you'll confuse people." said Merill. "Karen, think of the sun against your car roof. At an angle, the light tends to reflect more."

Jack grumbled. "Maybe, maybe not."

"Okay," Karen said hesitantly. "I can see the angle being important. There was a teacher who explained it to us as distance when I was in elementary school, and I've been confused since then."

Ted said, "Well, it is partly distance, but the distance that is relevant is the distance through the atmosphere due to the angle, not the distance from the sun. But, more basically, like Merill says, the angle reduces the amount of sunlight that reaches the surface. And that's more important." And he drew a diagram on the chalkboard, of sunlight hitting their earth:


Karen still looked puzzled. "I'm not seeing it."

So Kristie stood up and said, "There's another way to draw that diagram that helped me." And she drew a second version of the diagram, using a polygon instead of a circle:



"It helped me see that the deeper angle reduces the amount of sunlight for the same amount of surface area." Then she picked up a textbook and held it in front of a window, rotating it to show the area being struck by sunlight. "Like this."

Karen thought a few moments and said, "Thanks, I think I can see that."

Kristie gave the chalk back to Ted and he started started writing out a chart on the chalkboard.

Dan grumbled. "You and Karel."

Kristie smiled as she sat down, and members of the class who knew our four protagonists laughed.

Karen continued after some thought, "I think I can probably draw diagrams like that in a class."

While Ted wrote, Professor Billings pointed out, "This kind of discussion often does much more than a lecture." He paused. "You may feel a little out of control, during the discussion, but I strongly urge you to learn to use this kind of discussion, in every grade you teach."

Ted turned around. "And if we can get the students to draw the diagrams and write the math on the board themselves, that works even better, right?"

"You've heard it before."

General laughter.

"So," Ted returned to the board, to the left of the chart he had been working on, and said, "if we can satisfy the students about the measured length of the solar year, we can tell them that the length of the year is three hundred fifty-two whole days and four hundred eighty-five six eighty-sixths of a day. But we probably want to show them decimal fractions, too:
1 year: 352 485/686 days (about 352.7070)
Carl asked, "How do we connect that with sevens?"

Dan said, "Write the factors on the board, two times seven cubed."

Ted stopped, and he and many of the students turned to look at Dan.

"What? I didn't say I couldn't do any math at all, just not comfortable with some of it." Dan was grinning sheepishly.

More laughter, which Ted and Dan joined as Ted wrote out the factors on the board:
2 × 7 = 14, 14 × 7 = 98
98 × 7 = 686, 686 ÷ 2 = 343
Dan continued, "And we could work out the decimal fraction, to show how close it is to five sevenths. Should I work that out?"

Professor Billing smiled and held up a piece of chalk, which Dan took to a chalkboard at the side of the room, to show the long division for 5/7 and 485/686:
   0.714287             0.70699
 -----------        -------------
7| 5.0000000     686| 485.0000000
   4.9                480.2
     10                 4.800
     07                 4.116
      30                  6840
      28                  6174
       20                  6660
       14                  6174
        60                  4860
        56   
         40  
         35 
          50
And Dan sat down.

Carl pressed the question. "Is that the closest small fraction?"

Ted said, "Actually, I've got a chart of fractions that I printed up on the computer, where we can get a look at that question."

There were some complaints.

"Braggart."

And, "How come he's so lucky?"

Etc.

To which Professor Billings said, "Ted is being kind enough to loan it to the department." The department had had to scrounge for the budget for the electricity, and we'll find out more about that later. The professor asked, "Do you have the printout with you?"

"Yeah."

"I'll go get the overhead projector."

"I'll help you," Mark volunteered, and Mark followed the professor into the prep room as Ted went back to writing on the board.

Do you remember those heavy, hot, smelly, fragile overhead projectors we used to use, back in the 1950s and '60s? And big. That was what Mark and the professor emerged carrying. They set it up on a desk in front of a screen and plugged it into the wall to get the lamp warming up while Ted continued his explanation.

"We probably want to ask how many months in a year and show the division:"
1 ideal month: 352.7070 ÷ 12 = 29.39225 days
"Ideal month?" queried the professor.

"We can say it's some crazy professor's idea of a better month, but it isn't a real month."

"That explanation of ideal might work."

Ted continued, "Here's a question I think young kids will find interesting: If we used this exact length for the month, at what hour of the day on January 30th would it become February 1st?" And he showed them where he had written out the math for that, to the side of the still incomplete chart:
0.39225 * 24 = 9.414 hours
0.414 * 60 = 24.84 minutes
Before 9:25 A.M., January 30th.
After 9:25, February 1st.
While the other students absorbed that, he continued, "Then we can ask whether they would think it interesting for January thirtieth to suddenly turn into February first at about nine twenty five in the morning."

Jack suggested, "That's going to get some students excited, maybe too excited."

Dan chuckled. "It's the kind of thing Karel would say just as we split up for our specialty practice. Make sure we had plenty of time to think about it."

Kristie suggested, "Maybe you could save it until just before lunchtime? then the students would have lots of time to talk about it and forget their excitement."

Jack scratched his head. "Maybe, if you could get the timing right."

The professor was chuckling. He suggested, "Ted, let's look at your chart of fractions."

Ted dug a computer printout out of his books and handed it to the professor, who put it on the overhead projector's light stage.



: PRCH EMIT ;

: COMMA 44 PRCH ;
: COLON 58 PRCH ;

( No trailing space. )
: PSNUM ( number -- )
  0 .R ;

: NUMERATORS ( count -- )
DUP 1+ 0 DO
   I PSNUM COLON SPACE
   I 1000 * OVER / PSNUM COMMA ( 1000 times I divided by count )
   SPACE LOOP
DROP ;

: FRACTIONS ( count -- )
CR
1+ 1 DO
   I PSNUM SPACE I NUMERATORS CR
LOOP ;



"What's this?"

"That's the program."

Okay, it isn't exactly the program code he showed. Although the colon and semicolon were similar, most of the characters did not look much like our Latin-based alphabet. And I've translated it into symbols derived from English.

But the postfix grammar was surprisingly similar to the language Forth.

Maybe not so surprising, if we consider what a progressive definition grammar would naturally look like.

I made sure the translation would run in most Forth interpreters, if you are interested in trying it out. It definitely works in gforth, which is relatively easy to get for most PCs and for Android phones. Probably the easiest way to get it on a MSWindows PC is to go to the Cygwin site and install that, then use Cygwin's installer to get gforth. Android's Play Store has it, and, if you are using a Linux OS, it is probably in the packages.

(It also runs in my bif-c interpreter, but that is not easy to get if you aren't into compiling things yourself.)

In our world, it would have been a few more years before Forth became somewhat available, but we'll hear more about that later.

Professor Billings moved the printout down on the staging table to show the chart:


9 fractions                    
1 0: 0, 1: 1000,
2 0: 0, 1: 500, 2: 1000,
3 0: 0, 1: 333, 2: 666, 3: 1000,
4 0: 0, 1: 250, 2: 500, 3: 750, 4: 1000,
5 0: 0, 1: 200, 2: 400, 3: 600, 4: 800, 5: 1000,
6 0: 0, 1: 166, 2: 333, 3: 500, 4: 666, 5: 833, 6: 1000,
7 0: 0, 1: 142, 2: 285, 3: 428, 4: 571, 5: 714, 6: 857, 7: 1000,
8 0: 0, 1: 125, 2: 250, 3: 375, 4: 500, 5: 625, 6: 750, 7: 875, 8: 1000,
9 0: 0, 1: 111, 2: 222, 3: 333, 4: 444, 5: 555, 6: 666, 7: 777, 8: 888, 9: 1000,


He used a pen to trace through the listing. "Okay, these are the first three digits to the right of the decimal point, right?"

"Right. So we can see that 0.714 in the fives column of the sevens row is about the closest fraction less than ten."

Jack was still doubtful. "But seven tenths is closer than five sevenths."

"Well," Carl spoke up again, "When somebody way back there in our history first set up our modern calendar, he wouldn't have even had mechanical calculators, and the numbering system wasn't always base ten. And it took several centuries to get the length of the year accurately measured, didn't it?"

While the rest of the class talked about this, Ted finished his chart on the chalkboard.

"What's this?" Professor Billings asked, as he slid the listing across the stage table so the class could see it:


7 showmonths

0 0: 30 (30,  29.392 )
0 1: 29 (59,  58.784 )
0 2: 30 (89,  88.177 )
0 3: 29 (118,  117.569 )
0 4: 29 (147,  146.961 )
0 5: 30 (177,  176.353 )
0 6: 29 (206,  205.746 )
0 7: 30 (236,  235.138 )
0 8: 29 (265,  264.530 )
0 9: 29 (294,  293.922 )
0 10: 30 (324,  323.315 )
0 11: 29 (353,  352.707 )


1 0: 30 (383,  382.099 )
1 1: 29 (412,  411.491 )
1 2: 29 (441,  440.884 )
1 3: 30 (471,  470.276 )
1 4: 29 (500,  499.668 )
1 5: 30 (530,  529.060 )
1 6: 29 (559,  558.453 )
1 7: 29 (588,  587.845 )
1 8: 30 (618,  617.237 )
1 9: 29 (647,  646.629 )
1 10: 30 (677,  676.022 )
1 11: 29 (706,  705.414 )


2 0: 29 (735,  734.806 )
2 1: 30 (765,  764.198 )
2 2: 29 (794,  793.591 )
2 3: 29 (823,  822.983 )
2 4: 30 (853,  852.375 )
2 5: 29 (882,  881.767 )
2 6: 30 (912,  911.160 )
2 7: 29 (941,  940.552 )
2 8: 29 (970,  969.944 )
2 9: 30 (1000,  999.336 )
2 10: 29 (1029,  1028.729 )
2 11: 30 (1059,  1058.121 )


3 0: 29 (1088,  1087.513 )
3 1: 29 (1117,  1116.905 )
3 2: 30 (1147,  1146.298 )
3 3: 29 (1176,  1175.690 )
3 4: 30 (1206,  1205.082 )
3 5: 29 (1235,  1234.474 )
3 6: 29 (1264,  1263.867 )
3 7: 30 (1294,  1293.259 )
3 8: 29 (1323,  1322.651 )
3 9: 30 (1353,  1352.043 )
3 10: 29 (1382,  1381.436 )
3 11: 29 (1411,  1410.828 )


4 0: 30 (1441,  1440.220 )
4 1: 29 (1470,  1469.612 )
4 2: 30 (1500,  1499.005 )
4 3: 29 (1529,  1528.397 )
4 4: 29 (1558,  1557.789 )
4 5: 30 (1588,  1587.181 )
4 6: 29 (1617,  1616.574 )
4 7: 29 (1646,  1645.966 )
4 8: 30 (1676,  1675.358 )
4 9: 29 (1705,  1704.750 )
4 10: 30 (1735,  1734.143 )
4 11: 29 (1764,  1763.535 )


5 0: 29 (1793,  1792.927 )
5 1: 30 (1823,  1822.319 )
5 2: 29 (1852,  1851.712 )
5 3: 30 (1882,  1881.104 )
5 4: 29 (1911,  1910.496 )
5 5: 29 (1940,  1939.888 )
5 6: 30 (1970,  1969.281 )
5 7: 29 (1999,  1998.673 )
5 8: 30 (2029,  2028.065 )
5 9: 29 (2058,  2057.457 )
5 10: 29 (2087,  2086.850 )
5 11: 30 (2117,  2116.242 )


6 0: 29 (2146,  2145.634 )
6 1: 30 (2176,  2175.026 )
6 2: 29 (2205,  2204.419 )
6 3: 29 (2234,  2233.811 )
6 4: 30 (2264,  2263.203 )
6 5: 29 (2293,  2292.595 )
6 6: 29 (2322,  2321.988 )
6 7: 30 (2352,  2351.380 )
6 8: 29 (2381,  2380.772 )
6 9: 30 (2411,  2410.164 )
6 10: 29 (2440,  2439.557 )
6 11: 29 (2469,  2468.949 )
 ok


"I calculated out a chart to show how the lengths of months would mesh with the lengths of days cumulatively across seven years. It might be useful for demonstrating how variable a calendar would be if we didn't use something like skip years. Typing it up for a duplicator would be a lot of work. But you can see how the first year in that chart looks a lot like the calendar we use."

The professor moved the chart back up to year zero and let the students look it over. Then he asked, "How hard would it be to go to 700 years, so we could get a look at the entire cycle?"

"Waste of paper and ink, I'd say. Also, I'd have to fix part of the program that can only calculate to a bit more than thirty thousand days."

"Oh. So even a hundred years is going to be too many, then?"

"If I don't fix it."

"Well, it would be nice to pass this table out to everyone. Anyone want to type it up for the duplicator?"

Xerography was still too expensive to substitute for stencil or spirits duplicators, so copying out material like this still required a lot of manual labor. Georgia and Karen volunteered to type it up.



And this chapter is getting a bit long, so I'm going to arbitrarily end it here so you and I can take a break.

Previous TOC Next



[Backup and edit history are here: http://joel-rees-economics.blogspot.com/2017/04/backup-soc500-03-09-calculating-months-skip-years.html.]



[Chapter 3 part 9 is original to the second draft, and is not found in the first draft. Chronologically, it would be placed in chapter five of the first draft: http://free-is-not-free.blogspot.com/2016/05/economics-101-novel-ch05-first-semester.html.]

Wednesday, April 5, 2017

Backup: Sociology 500, a Novel, ch 3 pt 8 -- Calendar Math (I know you really want to read this. ;-)

[JMR201704052226: edits -- Taking care of some clumsy points.]

By coincidence, that Monday morning in Dan and Kristie's overview of physical science education topics, they were discussing teaching about skip years. We'll pick up {replace}partway through{with}a little after{replace.} Professor Billings's lesson{add} began{add.}.

----------

"Why not?" asked Karen. "I mean, isn't it just like π, numbers somebody made up?"

{add}Yes, I'm translating that. The character was not π, and it was not pronounced as in "pie". Strangely enough, however, one of their words for "pie" did have the same pronunciation as the name of the constant. More than coincidence, maybe?

<add.}Against the general chorus of groans and cat-calls, Dan said, "Take it easy on Karen. I think more than half of us have at sometime in our college lives had the same question."

----------

Professor Billings liked to encourage{add} various kinds of{add.} independent thinking with lab-baked sweetbreads.

----------

"Okay, let's compare {replace}cookies{with}recipes{replace.} after class{replace}.{with}," the professor laughed. "{relace.}So where do we go from here?"

----------

"{replace>H{with}Again, h{replace.}ow many weeks in a regular year?"

----------

Georgia answered, "Three fifty-two divided by seven is fifty with two days left over. {replace}Wait. J{with}But, j{replace.}ust one day less, so, of course fifty weeks with just two days left over."

----------

"Good question. Anyone?{replace} {with}

Ted raised his hand.

{replace.}Ted?"

----------

{add>The professor asked, {add.}"Do you think you could explain that to elementary school children?"

----------

No one could think of questions, so {add}Merill sat down and {add.}Mirium continued. "Now, is it always going to be like this?" {replace}Mirium{with}she{replace.} asked. "Is every seven year cycle going to be the same?"

----------

{replace}Mirium turned{with}Turning{replace.} to the professor{replace}.{with}, she asked,{replace.} "Then, should I just finish the math out myself?"{delete} she asked.{delete.}

[JMR201704052226: end-edits ]

[JMR201704052217: backup of http://joel-rees-economics.blogspot.com/2017/03/soc500-03-08-calendar-math.html.]
Previous

You said you wanted to see my notes on their calendar, didn't you? But my notes are boring.

By coincidence, that Monday morning in Dan and Kristie's overview of physical science education topics, they were discussing teaching about skip years. We'll pick up partway through Professor Billings's lesson.



The professor posed this question: "Many students will find the subject of skip years interesting on the last day of January or the first of February in a skip year. But when it's a regular day of a regular year, how can we get students interested in the length of the year?"

Bess thought out loud. "Models of the solar system are generally good for raising interest."

"Like this one?" The professor took a solar system model out from under his desk and demonstrated rotating the planets a bit. "What does it tell the students about skip years?" he asked, and set it on the lab table beside his lectern.

Kristie responded, "I guess that many students won't draw a connection without help?"

"Well?"

Merill suggested, "If someone has a birthday that falls on January 30th, that could also motivate interest. You could raise the question of whether or when to count January 30th birthdays on skip years."

Some of the students nodded.

Dan commented, "But I'd guess it's going to have to be something related to either astronomy or the calendar."

"How about the math?" Professor Billings suggested. "Do you think young students would find that interesting?"

Merill's response was fast. "No way!"

Ted's response was a little more positive. "Maybe. Sometimes math that seems to break rules is interesting to children. Skip years being exceptions in a cyclic series, they might be presented as breaking rules."

"Okay, who agrees with Merill," and he paused as some students raised their hands, "and who agrees with Ted?" and he paused again as other students raised theirs. Dan and Kristie raised their hands both ways.

"Kristie, can't you and Dan make up your minds?"

"It's not a binary question." Kristie said, and the professor nodded.

Dan said, "My buddy Karel used to entertain the football team with oddball math, but he had a sense for it that's a little unusual."

"So what do you think?"

"I learned some of his tricks, but the math sure doesn't come natural to me. I think I might use it in class sometimes, but not as much as Karel could."

The professor chuckled. "I guess I need to try harder to get you guys to really dig into the math. The more you guys are interested, the more your students will be."

"Would asking why skip years happen also help?" Kristie asked.

"Kids are often interested in reasons," the professor encouraged.

Merill laughed. "My little sister once asked me why someone couldn't have just passed a law to make all the years the same."

"There's a possibly good approach, asking why just making a law wouldn't work."

"Why not?" asked Karen. "I mean, isn't it just like π, numbers somebody made up?"

Against the general chorus of groans and cat-calls, Dan said, "Take it easy on Karen. I think more than half of us have at sometime in our college lives had the same question."

"Thank you, Karen and Dan. You're both welcome to a maple cookie for your contributions today."

Professor Billings liked to encourage independent thinking with lab-baked sweetbreads.

And now you're wondering that they have maple in their world. Well, the tree and its leaves look a lot like the maple, and its sap serves pretty much the same as the sap of maple serves us. The flavor is slightly different -- we might think someone had mixed in a little chocolate or cinnamon, depending on the variety.

You ask how either you or I could taste their maple, considering the distances between their planet and ours?

Good question. Back to the lesson.

There were still complaints. Jack was among those complaining: "But we're college students. Surely we all should know by now that the ratio of the radius of a circle to its circumference is a physical property of the real world, not a product of the whimsy of lawyers and legislators."

The classroom became quiet. The professor waited a moment and then asked, "Okay, who is willing to admit that you really aren't quite sure of either of these questions?"

A few hands hesitantly drifted up, almost as if without the will of their owners.

"Thanks for being honest." He continued, "If you couldn't look it up, how many of you would be unable to calculate an accurate value of π?" He paused. More students started raising their hands. Then he asked, "And how many of you would not be confident of being able to design a proper experiment to measure the length of the year?"

More hands were raised. He continued, "... especially since outer space has no reasonable way to set down a signpost that says, 'This is where we were this time last year.'?"

Jack was looking rebellious, but everyone around him had raised their hands.

"And now, how many of you think this discussion is interesting? Are we all awake enough to review the math?"

Many in the class nodded in partial understanding.

Kristie commented, "Asking questions in a way that asks children to think is generally pretty good for keeping the students awake, right?"

"You've heard me say that before, too. Good. Now we've talked a little about some lead-ins, how about the explanations? Who thinks they have an approach to the math?"

"Start with the shifting seasons?" Mark suggested.

"Who has ever seen a season shift?" the professor asked.

No one had.

Jack said, "Well, I really think we should start with demonstrating how to tell when a year has passed."

"Do tell." The professor motioned Jack forward.

Jack stood up at the chalkboard and drew a diagram showing their planet in orbit around their sun, showing the four positions of maximum and minimum tilt with the seasons labeled. For simplicity's sake, he avoided using the terms that would translate as equinox and solstice:


Chalkboard. Yes, they had calcium-rich minerals in abundance, and they made large boards to write on with the chalk. And, yes Jack used colored chalk.

"There you go," he said. "Standard stuff."

"And the kids really understand it?" the professor asked.

"Sure, well enough."

"How do you explain the part about marking the start position in outer space?"

"Oh. Yeah. We tell them we are counting the minutes from noon on the longest day of the year to noon on the longest day of the next year."

"And if the students understand how hard that is?"

"Most of the kids who will understand what the marker question means will have dads or moms who have already explained the precession of the equinoxes. Those who haven't will probably take the question for granted, and that should be okay for this level of lesson. Any oddballs, we can invite to help us make a class experiment."

"Good enough. Especially that last part about making experiments. Thank you. Do you want an oatmeal cookie?"

He grinned. "Thanks, but I take so many home, my wife has started baking cookies for me to bring. I actually have some oatmeal raisin cookies to share today." Jack sat down.

Oats. Wheat. Not quite the same, but closer to wheat than to rice. Oh. And they have a grain quite similar to rice, as well. And the raisins were a dried fruit that would be hard to say was not a grape, or maybe a cross between a grape and a currant.

"Okay, let's compare cookies after class. So where do we go from here?"

Mirium had a suggestion. "Some students won't really be familiar with the calendar, and reviewing a little will probably keep them listening. We should explain about how many weeks there are in a year, with how many left-over days, and how there is one less left over in skip years."

"Why not explain the varying number of days in the months, and the reason January may be twenty-nine or thirty days? We could talk about that." Merill countered.

"Wouldn't days in the week be simpler as a starting point?" Mirium responded.

"True, the weeks look simpler, but is simpler always simpler?" the professor asked.

The students all thought for a moment, then Ted spoke up. "Sometimes I've found it harder to get kids to talk about the simpler approach. Especially if they think they've heard it before. Simple sometimes means boring, uhm, because simple doesn't necessarily offer many features for them to get a grip on, to manipulate the ideas. I think we need to prepare multiple approaches."

"Thank you, Ted. I think there's an almond-flake doughnut in the box today."

And lot's of students said, "Yum!"

The almond seems to be an important form factor for nuts in many worlds.

Doughnuts? ... Uhm, yeah. Someone in their country had dropped a ring of sweet pastry batter into a pot of hot oil and discovered that it made an interesting way to cook sweetbreads.

"Okay, let's walk through both. Mirium, could you go first on the number of weeks?"

She nodded and stood.

"And, Merill, either you or Ted could do the days in the months?"

"I'll let Ted. I think he's brought something interesting."

Ted agreed to do the months, and Mirium went to the chalkboard.

"How many days this year?" Mirium asked.

Several students responded. "Three hundred fifty-three."

Mirium wrote the number on the chalkboard as she asked, "How many days in a week?"

Everyone answered seven, and Mirium wrote:
353 days ÷ 7 days per week =
and paused.

"Seven times five is thirty-five," Georgia said.

"Fifty, remainder three."
353 days ÷ 7 says per week = 50 rem 3,
or 50 weeks and 3 days
"Fifty and three sevenths, or ..." Jack recalled his sevenths. "50.428571, repeating from the four."

"Too many decimals," Georgia suggested.

"Maybe," replied Professor Billings. "But you want to be sensitive to the class. Some classes, some days, details can keep the students awake instead of put them to sleep. Some days, your plan may even require details."

Mirium continued, "Is next year a skip year?" General noises of agreement. "How many days?" And she continued the exchange while she wrote.
352 ÷ 7 = 50 rem 2, or 50 2/7, or 50.285714
"What does two sevenths mean?" she asked.

"Two days out of a week," Georgia volunteered.

"Okay," Mirium continued, "in seven years, how many skip years do we have?"

"Two," in chorus.

"How many non-skip years?"

"Five."

"How many days in seven years?"

"Don't forget to give the slow students a little time to see the answers if they can." the professor reminded them. "Even if you have to wait a minute, try to keep them answering in their own heads."

And the exchange continued while Mirium wrote on the board:
352 days/yr × 2 yrs + 353 days/yr × 5 yrs
704 + 1765 = 2469 days in seven years, usually
"Okay, how many weeks?"

Georgia suggested, "Divide by seven."

"Seven what?" Mirium asked. "Seven years?"

"Seven days in a week," Georgia replied again.

And Mirium wrote on the board,
2469 days in 7 years ÷ 7 days/week
   = 352 weeks 5 days in 7 years
"How many weeks in a regular year?"

Karen answered, "Three fifty-three divided by seven is fifty with three days left over. Fifty weeks and three days."

"How many in a skip year?"

Georgia answered, "Three fifty-two divided by seven is fifty with two days left over. Wait. Just one day less, so, of course fifty weeks with just two days left over."

Bess spoke up. "I've always wondered, is there a reason that the number of weeks in seven years is the same as the number of days in a skip year?"

"Good question. Anyone? Ted?"

Ted said, "If we had, for example, 366 days in a regular year, and 365 in skip years, the numbers would be similar."

Merill worked the math on some scratch paper, reading it out loud. "Three sixty-six times five plus three sixty-five times two is twenty-five sixty. Divide that by seven and we get three hundred sixty-five and five days. Wait. Of course. There are five years that have one more day than the short year, so of course it's the shorter number plus the extra days. It's because there are seven years in the cycle and seven days in the week."

Professor Billings laughed. "Okay, Merill, if you'll put that on the board, you can have the apple fritter in the box."

Apples, yes, they had several fruit trees that produced fruit with flesh and skin like apples. Some varieties were naturally tinged with a cinnamon-like flavor. Some tasted slightly like persimmon.

(Oh. They had a persimmon-like fruit, too. And you are asking again how we would know about the tastes of these. X^)

"Can I skip Ted's theoretical years from some science fiction planet and just do real years?"

"Sure."

So Merill put his work on the chalkboard, carefully organized:
Whole weeks per year: 50
( 50 wks/yr × 7 days/wk × 7 years ) ÷ 7 years
   == 350 days/yr

( 50 wks/yr × 7 days/wk × 7 years ) ÷ 7 days/wk
   == 350 wks in 7 years

leftover days --
2 days in 2 years, and 3 days in five years:
   2 days/yr × 2 yrs/cycle + 3 days/yr × 5 yrs/cycle
   4 + 15 or 19 days in seven years

or, leftover days --
2 days in 7 years, and 1 more in five years:
   2 days/yr × 7 yrs/cycle + 1 day/yr × 5 yrs/cycle
   14 + 5 or 19 days in seven years

19 days/cycle ÷ 7 days/wk == 2 wks 5 days,
   or 2 5/7 weeks/cycle

19 days/cycle ÷ 7 yrs/cycle == 2 5/7 days/yr     
"Which is just to show that dividing by seven is dividing by seven, I guess. Since we have seven years in the small cycle of years, and we have seven days in a week, there are numbers that will appear the same."

"Do you think you could explain that to elementary school children?"

"Maybe. It'd take a lot more thought than this, I think."

"Good enough for now?"

No one could think of questions, so Mirium continued. "Now, is it always going to be like this?" Mirium asked. "Is every seven year cycle going to be the same?"

"This is where you are going to start to lose students." the professor warned.

Mirium turned to the professor. "Then, should I just finish the math out myself?" she asked.

Mark suggested, "Would that also depend on the class?"

"What do you all think?"

Ted suggested, "Would it be a good idea to work on the months now?"

No one had a complaint, so Ted stood up and Mirium sat down.




Patience. We're getting there.


Previous TOC Next




[Backup and edit history will be here: http://joel-rees-economics.blogspot.com/2017/03/backup-soc500-03-08-calendar-math.html.]



[Chapter 3 part 8 is original to the second draft, and is not found in the first draft. Chronologically, it would come in chapter five of the first draft: http://free-is-not-free.blogspot.com/2016/05/economics-101-novel-ch05-first-semester.html.]
[JMR201704052217: end-backup]