Archive for the 'grad school' Category

Printing Boolean Input Combinations in Scala

Someone at school recently asked me to help him write some code in Scala to print out the 2^n Boolean input combinations that are possible with n variables. I decided to start off with n=4 variables to keep things simple and verifiable. After a couple of minutes of hacking around, I came up with the following code:
The cool part is the shifting modulus check. I’m actually kind of proud of it. It enabled me to write the code using only two loops! Here is the result:
-a -b -c -d
+a -b -c -d
-a +b -c -d
+a +b -c -d
-a -b +c -d
+a -b +c -d
-a +b +c -d
+a +b +c -d
-a -b -c +d
+a -b -c +d
-a +b -c +d
+a +b -c +d
-a -b +c +d
+a -b +c +d
-a +b +c +d
+a +b +c +d

Also, please note that this is probably, by no means, the most functional way to do this. It was merely an attempt at hacking together some code that just gets the job done. If I have time, I will write up some posts on functional ways to produce both combinations and permutations in Scala.

First Semester Completed


My first semester of Graduate School is completed! Grades are back (4.0) and the stress level is diminishing. Now I’m enjoying some much-needed family time with at my Aunt and Uncle’s house in South Carolina.

Spring Research Assistantship Accepted!


I got an offer for a 1/6th time Research Assistantship in the Spring, working with Dr. Miller in the Computer Science Department and Dr. Kissinger in the Institute of Bioinformatics. According to the letter, recipients are selected through a competitive process, and assistantships are awarded only to the University’s most qualified individuals to aid them in their pursuit of study or research. Anyway, I accepted the offer. So, I’ll be on both a Teaching Assistantship and Research Assistantship in the Spring!

michaelcotterell.com, at a glance…

You are currently browsing the michaelcotterell.com weblog archives for the grad school category.

88x31-2