Bunco and MATLAB (Module 4, ISTE-SS 5)

“One,” they say in approximate unison.
“One.”
“One. Two. Three. …Eight! Nine!”
“One. Two. BUNCO!!!” they scream, with a curious comradery considering they’re playing against each other.
“Nooo!” the other tables tease.
“What was your score? Sweet, I’m the loser!”

Once a month, my extended family gets together to play a game called Bunco. See here for some details; rules vary, and indeed our rules are a little different than what I linked. It’s a dice game. It might sound complicated, but I swear it’s incredibly easy. You take turns rolling and (in our rules) you want to be the first person to reach 21 points; there are specific point values associated with rolling certain things. At most Bunco parties we’ll play through the game six times. That’s a lot of dice rolling. It takes us about three hours. So one might eventually wonder, as I did, how many times, on average, does an individual need to roll to reach 21 points?

There is surely a mathematical solution to my question. You could also brute-force the answer by counting the number of times you had to roll to reach 21 points, over and over and over, and then averaging the results. That would take ages, but if you know how to play the game, you could do it. Or, with a little coding, you could have the computer brute-force the answer in no time at all! (Well, in 2 min and 27 sec, which actually felt like forever.)


This week’s module, Module 4, is about investigating ISTE Student Standard 5: Computational Thinker – “students develop and employ strategies for understanding and solving problems in ways that leverage the power of technological methods to develop and test solutions.” In response to Computational Thinker Indicator 5b, “students understand how automation works and use algorithmic thinking to develop a sequence of steps to create and test automated solutions,” I asked the investigation question:

What resources or programming tools are there that would be appropriate for students who have not previously done any programming? Maybe some good beginners tutorials for MATLAB, or something to teach the ideas used in programming (like vectors, for loops, if/else statements).

After poking around the internet and thinking about the setting of a college math class, I decided that I really did want to take this opportunity to look for a good beginner’s resource for MATLAB. MATLAB doesn’t have to be used as an advanced tool, and if you think of it as simply being a different (but epic) calculator, then I see no reason why beginning programmers shouldn’t be introduced to MATLAB. And furthermore, if you pursue math you’ll surely be introduced to it eventually.

MATLAB Resources

My two favorite resources that I found are:

Mikhelson’s video tutorials have the main things that I was looking for:

  • Zooming in on computer screen so you don’t have to squint.
  • Short-ish videos. I’m not really looking for entire hour-long, lecture-style lessons, just quick videos that give enough to know some basics.
  • Few enough videos, and covering the topics that I would want my students to know. Again, not looking for an entire course, I just want some good basics. The main topics I had in mind are: variable declaration, vectors, matrices, for loops, while loops, and if/else statements. But I like the other topics he included.
  • A slow enough speaking tempo.
  • Easy to follow visually.

I mostly just skimmed Xenophontos’ PDF, and I liked what I saw. It had a nice tone and layout. I found it easy to look at. Lots of good basics; more than the video tutorials, but not an exhaustive MATLAB manual. I think it could pair well with video tutorials as a reference.

Connecting MATLAB to ISTE Student Standard: Computational Thinker

Learning and using MATLAB easily touches on Computational Thinker Indicator 5b. For loops and while loops are two basic ways of programming the computer do repetitive tasks for so many iterations, or while some condition has yet to be met. When you write a script (a.k.a: code, program), you are writing a sequence of ordered steps. Coding in MATLAB or any other program is a manifestation of computational thinking.

But What Does This Have to do With Bunco?

Recall my game question: how many times, on average, does an individual need to roll to reach 21 points? This is a perfect question for MATLAB and I think a great example of using programming to answer a real-life question. The answer, by the way, is approximately 32.67 rolls. In order to program MATLAB to “roll the dice,” count how many times it took to reach 21, and then average the results, all I needed was: variable declaration, a vector, a for loop, a while loop, a few if/else statements, and two other commands – one to generate a random integer between 1 and 6, and one two average the number of rolls. Aside from the two other commands, all of these things are covered by Mikhelson’s tutorials in about 35 min.

It’s very freeing and rewarding to be able to answer your own questions, and a program like MATLAB opens you up to a new set of questions you can answer. It gives students a tool they can leverage while being a computational thinker. In addition to answering real questions, another reason a program like MATLAB is great tool to have at your disposal is because of what processes it can automate for you. For example, one time I was creating tons of bar graphs, which required calculating dozens and dozens of percentages. The tediousness and repetition of the task was making me cry on the inside. In comes MATLAB to save the day! Write a little code; copy and paste some tables; change a few numbers every now and then. Bam! Tables complete. I wanted to cry tears of joy over how much time MATLAB had saved me.

When I read Computational Thinker Indicator 5b, “students understand how automation works and use algorithmic thinking to develop a sequence of steps to create and test automated solutions,” the first thing I think of is MATLAB. It is a tool that enables you to embody this indicator. And as much as MATLAB can do, knowing even just a few basics can add such a powerful tool to your technology-toolbox. It’s a tool I want people, and my future students, to have access to.

(By access I meant the knowledge to use it, but speaking of access, Octave is the free “equivalent” to MATLAB; nearly all of its commands are identical. And typically, colleges will give students a discount on MATLAB and/or have MATLAB available for use on the school computers.)


References

ISTE: International Society for Technology in Education. (2016). ISTE standards for students. Retrieved from https://www.iste.org/standards/standards/for-students-2016

GNU Octave. (2017). Retrieved from https://www.gnu.org/software/octave/

MathWorks. (2017). MATLAB. Retrieved from https://www.mathworks.com/products/matlab.html?s_tid=hp_products_matlab

Mikhelson, I. (2014, March). MATLAB tutorials. Retrieved from https://www.youtube.com/playlist?list=PL1ec5YBm_crwcmeR8pKB9shvnriE8UbFE

Xenophontos, C. A beginner’s guide to MATLAB. Department of Mathematical Science, Loyola College. Retrieved from http://www.academia.edu/25726211/A_Beginners_Guide_to_MATLAB