CSC 216/s08/diminish fear: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 2: Line 2:
[http://meta.wikimedia.org/wiki/Help:Wikitext_examples Formatting Help Guide from MetaWiki]
[http://meta.wikimedia.org/wiki/Help:Wikitext_examples Formatting Help Guide from MetaWiki]


==Place Title of Exercise Here==
==The Gumball Finite State Machine==


Give the title of your exercise, which may include the name of the topic you are covering, or some other catchy title.


===The problem===
===The problem===


Describe what you are attempting to teach students by this exercise.
To teach the student about finite state machines.


===Participants and props===
===Participants and props===
 
The participants include those who who will volunteer. The props will include the diagrams that will eventually be created.
How many students will participate? What else do you need (e.g., old tennis ball, Powerpoint slides, software).


===The script===
===The script===
Line 20: Line 18:
Once everyone has been assigned a state, display the state transition diagram.  The professor then should give input values and have the students run through the simulation with the "current state" student standing next to the correct "state" student.
Once everyone has been assigned a state, display the state transition diagram.  The professor then should give input values and have the students run through the simulation with the "current state" student standing next to the correct "state" student.


 
Here is an example run through.<br />
Here is an example run through.
1. The "current state" student stands next to the "0 cent" state.<br />
1. The "current state" student stands next to the "0 cent" state.  
2. The professor says he deposits 5 cents. <br />
2. The professor says he deposits 5 cents.  
3. The "0 cent" student tells the "current state" student to go to the "5 cents" student.<br />
3. The "0 cent" student tells the "current state" student to go to the "5 cents" student.
4. The professor says he deposits 10 cents.<br />
4. The professor says he deposits 10 cents.
5. The "5 cents" student tells the "current state" student to go to the "15 cents" student.<br />
5. The "5 cents" student tells the "current state" student to go to the "15 cents" student.
6. The professor says he deposits 10 cents.<br />
6. The professor says he deposits 10 cents.
7. The "15 cents" student tells the "current state" student to go to the "25 cents" student.<br />
7. The "15 cents" student tells the "current state" student to go to the "25 cents" student.
8. The "25 cent" student tells the "current state" student to go to the "0 cent" student. This student should also announce that the machine should dispense the candy and also give 5 cents worth of change back.<br />
8. The "25 cent" student tells the "current state" student to go to the "0 cent" student. This student should also announce that the machine should dispense the candy and also give 5 cents worth of change back.

Revision as of 04:13, 16 April 2008

Formatting Resources

Formatting Help Guide from MetaWiki

The Gumball Finite State Machine

The problem

To teach the student about finite state machines.

Participants and props

The participants include those who who will volunteer. The props will include the diagrams that will eventually be created.

The script

A simple example that can be used to demonstrate the finite state machine is a candy dispenser. This is a special kind of candy dispenser that only takes dimes and nickels. Every item in the dispenser cost 20 cents. Assign one of the volunteers to be the current state. Everyone else becomes a different state. In this example, there are 6 different states: 0 cents, 5 cents, 10 cents, 15 cents, and 20 cents, 25 cents.

Once everyone has been assigned a state, display the state transition diagram. The professor then should give input values and have the students run through the simulation with the "current state" student standing next to the correct "state" student.

Here is an example run through.
1. The "current state" student stands next to the "0 cent" state.
2. The professor says he deposits 5 cents.
3. The "0 cent" student tells the "current state" student to go to the "5 cents" student.
4. The professor says he deposits 10 cents.
5. The "5 cents" student tells the "current state" student to go to the "15 cents" student.
6. The professor says he deposits 10 cents.
7. The "15 cents" student tells the "current state" student to go to the "25 cents" student.
8. The "25 cent" student tells the "current state" student to go to the "0 cent" student. This student should also announce that the machine should dispense the candy and also give 5 cents worth of change back.