Coding at Camp and on Campus: Computational Thinking in My Everyday Life

Code can be used to solve problems in any field. Programs can solve complex mathematical equations, model Earth’s rising sea levels and convert text into music. I did not completely understand the versatility of programming until I attended the Wolfram High School Summer Camp last summer.

At the camp, students learn how to use the Wolfram Language and Mathematica while working on a project that interests them. When I attended, projects ranged from modeling traffic simulations to determining whether a piece of writing was fiction or nonfiction. My project was to create a program that classified 3D figures generated by cellular automata rules based on their shapes.

The variety of projects helped me understand how code can enhance every field, because I saw applications of one language in areas ranging from music to math. Furthermore, I learned that while a physical program can enhance a field, the thought process behind coding can help me solve problems in my everyday life as well.

Deconstructing Projects

When I met with the team of mentors at the Summer Camp to receive my project assignment, I was excited to work on it because my previous experience with cellular automata had been in two dimensions, and I had never done machine learning before! However, as I hung out with my friends back at the dorms, I became increasingly worried about completing the project. I had only been programming with the Wolfram Language for two weeks, and since this was the most complex project I had tackled so far, I was overwhelmed.

I made a list of the various tasks that I needed to learn how to do in order to make the project. These included figuring out how to generate 3D cellular automata figures, use machine learning to identify the shapes, choose the different groups to sort the figures into and display the results in a user-friendly format. After I made the list, I felt less stressed because I had broken the task down into smaller, more manageable pieces.

Breaking down large projects into smaller pieces is helpful because it gives me a place to start when working on a large project. For example, I am the head programmer of a FIRST Tech Challenge robotics team (Team Thunderstone 6010). One of the most important and ongoing parts of my job is to program an autonomous period where the robot completes a series of tasks to score points. As there is no robot driver controlling the robot during the autonomous period, sensors and preprogrammed instructions to move around the field.

When tackling this challenge, I break the program down into individual tasks instead of trying to code everything all at once. For example, I first develop a proportional turning method that accurately moves the robot a specific number of degrees before trying to program it to move a large foundation game piece while turning. This makes the autonomous period more manageable to program, and it makes it very clear where the bug is if the program does not work.

You can read more about FIRST Tech Challenge Robotics here.

Deconstruction also works with playwriting. When creating a play, once I have the general subject or the message of the story, I generate ideas based on the different elements in a play. I might work on generating different characters separate from developing the plot.

Even in sports, teams do not scrimmage the entire time. By breaking down practice into smaller drills focusing on specific skills, team members improve at one skill so that they can build upon it in the next practice. For example, in volleyball, serve receive drills help with passing, and hitting drills help with blocking and spiking. Once players gain these skills, then they can learn rotations and transitions that lead to more complex plays.

The Art of Planning

While at camp, however, using deconstruction wasn’t enough. I still had to complete my project.

After breaking down the different aspects of my project, I made plans to accomplish each task. For example, under “figure out how to display the figures in 3D,” I wrote that I needed to research different methods during the first day working on the project. My timeline helped me stay on task and gave me a goal for each day of the project. My timeline did not go through the end of camp, but I think that this was good because it gave me flexibility for when I encountered problems and gave me time to expand on my initial project as time permitted.

Writing out a plan helps me in robotics because when creating the first program for the autonomous period of the competition of a season, there is always a time crunch. The robot is typically finished less than a week before the first competition, so I have a limited amount of time to finalize all the code. Thus, if I do not manage my time effectively, the autonomous will score fewer points than I would like it to because I will not complete the task. Before the one-week deadline, I try to have all the functions and strategy planned out, so with the robot, it is all about putting it together.

Diagram of the autonomous task strategy

A detailed plan further helps with writing plays and papers because before writing the script, I like to make an outline of what is going to happen. While many people dislike outlines because they feel they are a waste of time, I find them helpful because they allow me to organize my thoughts. For example, this blog post was arranged by describing the different methods I used as I approached my summer project. I added bulleted examples for each method beneath those headings. This helped me collect my thoughts before writing! Similarly, when doing geometry proofs, it is easier to think about what needs to be proven from the given information instead of starting to prove everything you can.

The Importance of Research

“Basic research is what I am doing when I don’t know what I am doing.”
-Wernher von Braun

Once I had created a plan for executing my 3D cellular automata project, it was time to get started!

The first item on my list was to research ways to display cellular automata with the Wolfram Language and to learn more about the different rules. I began by looking through the Wolfram documentation and quickly found how to print the figures in 2D. Through more searching, I was able to find how to print them in 3D! However, the function input was complicated, and I was unsure of the effect of each number.

It took me a very long time to figure out what everything meant, but by the end of the day, I understood most of the function, which made implementing it easier! To figure this out, I tried changing the various input values and making comparisons between the 3D input and the 2D input. In addition, mentors at the camp helped me figure out what some of the variables in the documentation page meant.

I learned that the number 126 in the function shown in the image (Image3D[#,ImageSize→150] & /@CellularAutomaton[{126,{2,1},{1,1,1}},{{{{1}}},0},11]) represents the cellular automata rule displayed. The {1,1,1} indicates that it is in three dimensions, and the {{{{1}}},0} represents that the one cell in the middle was alive at the start. The 11 at the end represents the number of iterations of the rule to display. If the 11 was in double curly braces ({{11}}), then only the 11th iteration would be displayed.

After researching the function, I felt ready to select my training set for the Classify function. However, when I tried to generate figures for certain rules, the code resulted in an error. It was the 2 in the {2,1} that threw things off because some of the rules needed a different number than 2. I did not know the reason behind the switch, so I made a Manipulate that allowed me to change the k values and find which values worked for cellular automata rules 0–255. (I had decided that my function would focus on deterministic rules for cellular automata or rules 0–255.)

After talking with a mentor, they helped me discover that the 2 in {2,1} represents the number of possible states each cell can be in, which changes the type of cellular automaton. I had previously thought that each cell could only be alive or dead, so it was interesting to learn that different rules needed different numbers of states for the cells. Thus, research helped me gain a better understanding of the function I was using in my project, which helped me to finalize the details of my project and be able to move forward on a solid foundation.

Research is important in any project. Without a solid understanding of a subject, it can be difficult to complete an assignment. Conducting research can give you substantial background knowledge. For example, as a sophomore, I completed the Virginia Space Coast Scholars online course, and my grade in the class qualified me for the Virginia Space Coast Scholars Summer Academy at Wallops Flight Facility. There I worked with a team of students to design our own scientific balloon mission. As the risk specialist for the mission, research was essential in completing my mission tasks.

In this position, my job was to create a flight path for our balloons as well as a risk matrix, a table where potential risks are graphed, along with the risk of them occurring once a mitigation strategy has been implemented. I researched previous balloon flight paths and the weather at the launch centers to create a solid flight path as well as potential risks with the hand-launch balloons my team chose and ways to prevent these risks to help me create the risk matrix.

The importance of research was particularly evident during the presentation of our mission to the rest of the scholars, parents and NASA officials. During the Q&A period, I was asked why we launched out of Halley Research Station in Antarctica instead of McMurdo Station (also in Antarctica). During our mission, the balloons used both stations to transmit data to the payloads. However, we chose to launch out of Halley because the flight path in Antarctica is very similar to the flight path of the BARREL mission, which also launched from Halley.

In addition, I was asked if payloads could be reused if they were not retrieved for many months, and whether a late retrieval would push our timeline back. I said that the payload would need refurbishing before its next flight and that it would not delay our mission because we have an extra payload constructed. I added that the refurbishing should not take too long unless the landing was harder than expected.

I would not have been able to answer these questions without conducting extensive research throughout, so research was vital to the success of our project.

Documentation: Show Your Work!

While learning more about a subject is important before starting every project, you should conduct your own research through the process of creating it. Documenting your work gives you your own resources to consult.

During my Summer Camp project, I created a separate document that outlined the work I had done that day, what needed to be done the next day and notes about each element of the project. These notes helped me avoid backtracking when I ran into problems, because everything that I tried was documented in the notebook along with notes of its success. In addition, when creating the final Classify function, as I changed training sets to try and improve the accuracy of the method, sometimes the accuracy decreased. Having the previous training sets saved along with their accuracies helped me preserve the work I had done while also letting me try different sets.

An engineering notebook in robotics serves the same purpose. In this notebook, the entire design process of each element of the robot is documented, along with goals, adaptations and tests of the mechanisms. Thus, everything tested or designed is documented here with notes, so as a team we know what different members have tried and what is working.

Documentation of different autonomous functions, driver controls and wiring is also in the notebook, so if parts are replaced or someone needs to look at the code, the information is readily available. Recording each step of a process is important because you can use the knowledge that you obtained during the process of the project to help you improve a mechanism or try something new.

Change Is Coming

Halfway through the Summer Camp, I was able to meet with Stephen Wolfram to discuss my progress and how to further develop my project.

When I met with him, I was dividing the shapes into three categories: sphere, cube and irregular. The irregular shapes were everything that was not a sphere or a cube. He felt that the program would be more effective if this category was split into two: less interesting and more interesting irregulars. Thus, the complex irregular shapes and the more basic shapes could be distinguished.

I think that this change has improved the program because it is now able to distinguish the complex shapes from the more basic irregular shapes, providing the user with a more specific classification. Furthermore, I was interested in changing the color of the 3D figures and worked with my direct mentor, Sylvia Haas, to try and figure out how to do this.

We looked through my progress reports and found that instead of using Image3D for displaying the figures, the Cuboid function could be used in addition to the ColorData function. This switch in the graphics allowed me to change the colors! Being open to change and adapting the program led to better results.

Adaptation is important in any field. Projects never go exactly as planned, so being open to new ideas and methods is important in creating the best product. For example, in robotics I was trying to use encoders on a motor to set limits on the flipping motion of the intake system so that it could not crash and break. However, the encoders are initialized when the program is started, so if the intake is not in the correct position when initialized, the limits are wrong.

My coach suggested that I use a potentiometer instead because the positions of it are constant. This initially stressed me out, given that we changed the method two days before our first competition, but the change made the robot more reliable because the limits were the same each time.

It is also important to be willing to try different approaches when stuck on a problem. During my project, I tested over 20 different training sets for the Classify function to try and get the best accuracy possible. The variety of the sets was large: some had 10 figures, others had 30 and they all had a different combination of shapes generated by cellular automata rules. In the end, this trial-and-error method improved my accuracy to 83%. Even better, after camp was over, I was able to improve it to 87%! Trying different approaches to creating a testing set helped me improve the accuracy of my program.

Poetry is another area where flexibility and a willingness to experiment are key. I think I write my best poems when I don’t know what the story is about! By not having a direct vision, I give the poem time to evolve during the process, rather than before. This is similar to solving complicated math problems. Sometimes you do not know how to get to the answer, but once you start trying different techniques, you can figure it out.

Perseverance and Brain Breaks

Programming can be frustrating. Programs rarely work the first time, and they do exactly what you tell them to do, not necessarily what you want them to. When this happens, it is important to take a break and not give up.

My mentor, Sylvia, always had my group spend time outside during breaks. Not many students participated with us, but I think these breaks were important to help us relax and take our minds off our projects, even for a little bit. These “brain breaks” helped us let out some of our frustration and let us focus on the bugs we had in our code with a fresh outlook. When you run into problems, it is important to take some time to reevaluate things and find a solution. You can do it!

Continued Improvement

When we presented our projects to the other campers, mentors and Stephen Wolfram, one of the sections we were to include in our presentations was how we intended to improve on our future work. We all wanted to continue working on our projects to improve their success rates and make them more user friendly.

After camp, I worked on improving the accuracy of the shape-identifying function generated by Wolfram’s Classify method and am in the process of turning it into a Wolfram Demonstration so that people can explore 3D figures generated by cellular automata. This goes to show that projects can always be refined into better projects. In everyday life, technology is constantly remade and improved. Software updates for different apps improve bugs, and phone cameras keep getting better.

The presentations of all the different projects at the Summer Camp were very rewarding. Everyone had a chance to learn about each student’s work. I am not the most confident public speaker, and I was worried that people would not like my project because it was relatively simple compared to some of the other projects in the program. I didn’t have to worry! Everyone was very supportive, and people were excited to learn about my project.

Presenting at the camp helped me recognize the value of the work that I had done. I think that learning to be proud of my work helped me become a more confident person. Valuing your work is important in every field because everyone’s contributions are important!

The lessons I learned at the Wolfram High School Summer Camp continue to this day. The different methods for working on a coding project help me solve problems in my everyday life. From creating a plan, breaking down problems and conducting research to taking occasional breaks and valuing my work, coding has helped me approach tasks in a variety of subjects! Therefore, strategies for approaching problems in a specific field can benefit everyone!

About the blogger:

Adrienne Lai

Adrienne Lai is a high school student from Alexandria, Virginia, who loves programming, reading and robotics. She is a proud Hufflepuff, the cue coordinator and set builder for her school’s technical theater team and a literary editor for her school’s literary magazine. For college, Adrienne is interested in studying computer science, engineering (especially biomedical and biochemical engineering) and mathematics!

--

--

Tech-Based Teaching Editor
Tech-Based Teaching: Computational Thinking in the Classroom

Tech-Based Teaching is all about computational thinking, edtech, and the ways that tech enriches learning. Want to contribute? Reach out to edutech@wolfram.com.