Saturday, February 28, 2015

Using Java to solve an AMC 10 problem

Nicholas continues to practice his Java coding. This quickly makes my job hard to find suitable and interesting problems for him to work on. One day when he talked to me about how he solved an AMC 12 problem, it dawned on me that he could use Java to solve the problem:

c^2005 = logab
a>=2, b>=1, c >=0. a, b, c are integers.

When I told him that he could use Java to solve the problem, he could not believe it - he thought that one has to use MATHMATICA to solve equations. In addition, he explained to me that it took reasoning to get the solutions: "Java can not reason, how could you use Java to solve the problem?"

It was a perfect educational moment for me. I showed him how to convert the problem into a programmable problem, I also used the opportunity to show him how to write out the flow chart for a program one more time. When he finally made his code to run, he was exhilarated to find out that the code produced the right solutions as he got!  (2004,1,0), and (1002, 1002, 1).

This week after AMC 10b test, he discussed with me about problem 25 which he did not complete during the real test. After some discussion, we found a way to solve the problem, which is essentially the same as the following question

2ab+2bc+2ca = abc
a>= b>= c >= 1, a,b,c are positive integers.

How many solutions does this problem have?

When it is time for him to practice Java coding this weekend, I recommended that he wrote a code to solve this problem. He happily agreed.  After he converted the problem into programmable problem, make the flow chart, it took him less than 10 minutes to write the code and got the solution without any help from me.

I am sure that after a few such practices, it will be a challenge for me again to find suitable and interesting problems for him to solve using Java.

It is time for him to get into next level of Java coding!
Appendix - the code and solutions

import java.util.*;
public class AMCTwentyFive {

       public static void main(String[] args) {
              int a;
              int b;
              int c;
              int counter=0;
              for (c=1;c<=6;c++){
                     for (b=c;b<=1000;b++){
                           for (a=b;a<=1000;a++){
                           int x = 2*a*b+2*a*c+2*b*c-a*b*c;
                            if (x==0){
                                  System.out.print("a = "+a+", ");
                                  System.out.print("b = "+b+", ");
                                  System.out.print("c = "+c);
       System.out.print("You have found "+counter+" solutions ");          

a = 42, b = 7, c = 3
a = 24, b = 8, c = 3
a = 18, b = 9, c = 3
a = 15, b = 10, c = 3
a = 12, b = 12, c = 3
a = 20, b = 5, c = 4
a = 12, b = 6, c = 4
a = 8, b = 8, c = 4
a = 10, b = 5, c = 5
a = 6, b = 6, c = 6

You have found 10 solutions

Note:  AMC - American Mathematics Competition

Friday, February 20, 2015

Rediscovering the Radio - by Lily

In my mind radio is permanently connected to the car. I get in the car and turn on the engine, the radio is on; I don’t even have to push a button. And that seems to be the only time that radio exists to me in my busy life. And I surely enjoyed the company of the radio on my long commute. However, since I changed job a couple of years ago, with the shortened commute and non-rush hour timing I wasn’t able to tune in to my favorite programs in the car anymore. As time went on, I realized I really missed the programs I used to listen to. News I can catch at many other places, what I really missed are the science and technology discussions, interviews on art and music, touching stories from story corp,  and market analysis.

What really motivated me to find a solution to this issue was the frustration over the unpredictability of KERA’s airing time for Intelligence Squared program. One week on then 3 months off is just too much for me. I looked it up online, and there were many past episodes for me to browse and select at my finger tip. And I found the perfect timing for it, on weekends while I plan and prepare meals for the coming week. While my hands are busy with the kitchen chores, my mind would be occupied by the interesting debates over a wide range of topics. Be it GMO, common core, or income inequality and American mobility, the facts and opinions articulated by the debaters inform me and engage my thoughts in a variety of societal issues. During my morning exercise time I would catch up with shorter programs such as All Tech Considered, Terry Gross’s Fresh Air, or Kai Ryssdal’s Market Place. The freedom of picking out a program and listening to it any time is very convenient and in my opinion a great way to keep those radio programs alive.

Sunday, February 15, 2015

Cooking Lessons at Home - by Lily

After catching up with old friends, the holidays, and a ski trip,  winter break at home for five weeks had become boring toward the end for Justin. So he decided to learn how to cook. He was especially motivated in anticipation of moving out of the dorm to an off campus apartment after the summer. He already knew how to boil instant noodles and frozen dumplings. I explained to him the concept of a balanced meal, with vegetables and proteins. He told me that he’d take care of his lunch on his own. The first day I received a picture from him while working in my office. It was a bowl of noodle topped with an egg, bacon, chicken, carrots, and Chinese cabbage. Job well done!

After simple dishes like this, he learned how to cook fried rice and then asked for lessons on cooking “real” dishes. I showed him how to cut different vegetables to desired shapes, how to cook the meat, how much oil to use, how to check the taste, etc.

In those couple of weeks, Allan would come home early after work to guide him to put what he observed and instructions he got from Mom to action. He taught Justin some techniques again.  First thing first, how to wash veggies and meat, and cutting veggies. Cutting vegetable or bean curds is easy, to cut them in proper size and shape while not cutting his fingers under any circumstance needs some techniques – bent the finger in such a way so that the side of a knife would touch the sides of fingers while making finger nails bent away from the knife. How to use spatula during stirring vegetables or meat was bit problematic at the beginning. During demonstration his dad could move the spatula in the cooking pan with ease, when its Justin’s turn, he would have difficulties to move the spatula and pushed veggie or meat out of the pan. After observing his actions carefully, his dad found out that each time Justin tried to move the full content in the pan at once, bending spatula … after a few tries, he could use spatula properly.  Once he could do the cooking, the important thing became how to cook tasty dishes. He learnt a few techniques  - the main one was not to put too much salt at the beginning, taste the cooked dish to see if additional condiment or salt was needed ….he also learnt how to marinate salmon and how to set the oven for the grill.

During the first week, he learned to cook and cooked bean curd with chives and pork, Chinese cabbage, broccoli, seafood tofu and grilled salmon!  During those cooking lessons, no arguing, no refusing to take instructions, no pouting when being criticized,  he learnt fast. The second week, Allan would only give some verbal advice from the comfort of a sofa, while watching evening world news, and Justin was fully independent at the stove to cook dinner for the whole family – he cooked some of the same dishes again and they were delicious!

For two weeks, I enjoyed dinner prepared and cooked by Justin and didn't need to worry about preparing dinner for next day. I was so proud of Justin.Yum! 

Sunday, February 8, 2015

VEX Robotics Competition

The VEX Robotics Competition is presented by the Robotics Education & Competition FoundationEach year, an engineering challenge is presented in the form of a game. Students, with guidance from their teachers and mentors, use the VEX Robotics Design System to build innovative robots designed to score the most points possible in qualification matches, elimination matches and Skills Challenges. In addition to having a great time and building amazing robots, through their participation in the VEX Robotics Competition and their work within their team, students will learn many academic and life skills. The competition tournaments are hosted by various organizations with help from REC Foundation. 

A robot placed two cubes on a skyrise

CIE/USA-DFW, which is a non profit organization with mission to promote Science, Technology, Engineering and Math (STEM) awareness in DFW area, successfully organized its first VEX robotics competition on February 7, 2015, in a Gymnasium at a local middle school.

Making it Happen

It took a lot efforts to make this event to happen and to be successful.

First and foremost, it was the planning. The event planning and organizing team captain Arnold initiated this event within CIE, and he took great efforts to learn how to host the event. He also convinced CIE/DFW leadership to have the event on the youth program.

To make the event actually happen, we needed a lot of volunteers to help. The volunteers were critical to carry out the plan. One important area needed help was the logistics for the event, which include 1) reservation of a venue and purchase of associated insurance, 2) venue preparation - tables and chairs (primarily from facility renting entity), banners, signs for directions ...,  3) setup and disassemble the competition fields, 4) food and water for volunteers, 5) materials for registrations, programs. The other important area was the operation of the event which include 1) registration, 2) Inspection of robots, 3) scoring and refereeing, 4) judging, 5) event control and record keeping.

A volunteer was inspecting if a robot met size requirement

There were about 15 adult volunteers which served as lead or adviser to 40 high school student volunteers. There were additionally seven engineers from local companies who served as judges for the competition.

The matches

The competition involved an elaborate and relatively long qualification round. Each match has two teams compete against each other - red team and blue team. The intriguing part is that a red or blue team is made up of two participating teams. For the 20 teams participated, each team played 7 matches with various partner teams selected by REC foundation's program.

A match itself include two part - a 15 second autonomous portion and a 1 minute 45 second driver controlled part. A robot is operated through a program written by its team in the autonomous part. The goal of the game was to place blue or red cubes on the grey posts on the perimeter of the filed or to build a skyrise (the yellow post) and place the cubes on the skyrise.

A robot attempted to place two cubes on a skyrise

The matches were very interesting to watch. In one match a robot  built a seven segment skyrises and placed 7 cubes on the skyrise, seemly effortlessly. Then one saw a robot just could not open its hand to garb cubes! One player tried too hard that his robot toppled.

In addition to try their best to make their robots to do the intended tasks,  some competing teams engaged in  tactical activities such as moving oponent's cubes away from its robot, removing opponent's cubes from grey posts ......

The finals

The finals were between Alliances formed by #1 qualifying team and by #2 qualifying team. Each Alliance consists of three teams. The two alliances were evenly matched, and the matches were very exciting - the playing field was totally surrounded, many spectators had to stand on chairs or tables in order to watch!
scene at finals
The first match of the final was  most exciting and enjoyable. Both competing alliances were at their best, each built a 6 or 7 skyrise, placed as manycubes onto it, and placed many cubes on the grey posts. There were many changes of leads until the last second - one incomplete act by #1 team made it lose the first match 61 vs 64. The second match was more thrilling than exciting as one team could win the championship! But both team made some mistakes, the matched was tied at 32 points each. The 3rd match was dramatic in that #2 Alliance accused # 1 Alliance of rule violation by requesting a size inspection, and #1 Alliance retaliated by requesting size inspection on the opponent's main robot as well. In the third match, one of #1 Alliance's robot malfunctioned, it could not open its hand to grab anything. All the malfunctioned robot could do was to push opponent's cubes away from opposing robot. In the end #2 Alliance lead by team Crossfire won the match and the championship!

Award presentation