Chapter 3. Exploring the Mysterious Data Analysis Tool

With R prepared for use, you are primed to begin your initial status assessment of the Shu army. However, you have realized that the documents that you received make no mention of your own or your enemies' resources. Without this critical data, you will not be able to conduct your analyses.

You decide to pay a visit to Zhuge Liang's assistant to see if the great strategist had mistakenly misplaced the much needed information. Upon your arrival, the assistant silently hands you a written letter. It reads:

My true successor will be a person of sharp intellect and patient wisdom. Yet, it is not sufficient to merely choose a replacement. Rather, this person's character must be tested under the harshest of circumstances. I have hidden my records of the Shu and Wei armies. I predicted that you would come for them shortly after my death. My assistant has been instructed to share this letter with you. Further, if you are able to solve the puzzle that I have presented here within one hour, then you will receive what you seek. However, if you cannot complete this task within the given time, the documents will be destroyed and my assistant will promptly travel to the capital. There, my assistant will give the emperor my recommendation that the Shu forces surrender to the Wei kingdom.

Zhuge Liang

Exploring the Mysterious Data Analysis Tool

The mother is 260. Her four children and four grandchildren are 130. The family is in perfect harmony.

You have been challenged by the legendary strategist, in his letter, to prove yourself as a capable leader of the Shu forces. In order to accomplish this feat, you must be able to:

  • Use proper syntax within the R console
  • Comment your R code
  • Make calculations using formulas
  • Distinguish between different types of input and output in the R console

Time is running out. If you aim to prove yourself a worthy leader of the Shu army, then you will need to begin solving Zhuge Liang's puzzle!

Deciphering Zhuge Liang's magic square

Zhuge Liang's puzzle is an 8x8 magic square. In a magic square, all rows, columns, and diagonals add up to the same number. For an 8x8 puzzle like this one, that number is 260. Hence, the mother refers to the entire puzzle. Knowing this, take a moment to think about what the children and grandchildren might refer to.

Continuing, each of the cells in the puzzle hold a number between 1 and 64. Each number appears in one and only one cell. A useful technique for solving a large puzzle is to break it down into smaller components. For example, an 8x8 magic square can be broken down into four 4x4 puzzles (children). Furthermore, each 4x4 puzzle can be broken down into four 2x2 squares (grandchildren). In this case of perfect harmony, each 2x2 and 4x4 puzzle is also a magic square whose number is 130.

Now that we have deciphered Zhuge Liang's puzzle, we can begin solving it with the help of R.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.208.72