Sunday, April 27, 2014

Activity Diagram

After meeting with Tom of Dive Oahu, he explained that the current system he uses for logging dives is through DiveBoard.com. Some of the perks of the system include the ability to download single or groups of dive records, both as a virtual log and in a printable manner. Tom expressed the desire, however, to be able to share these logs with buddies, as well as upload photos, which can also be tagged and shared. By having the logs stored virtually and accessible by online friends, the job of the dive coordinator/organizer is also made simpler by allowing them to quickly search for credentials online, in addition to compiling all the data necessary for submitting records to certification companies.

In looking at the flow of data through the proposed Dive Portal system, the following activity diagram shows the way users will be working in the system, as well as giving a timeline to demonstrate how this activity is different prior to a dive and following a dive.


Use Case Diagrams

In considering how one interacts with the proposed Dive Portal, several interactions have been proposed.

Feature: Plan a Dive
As a dive coordinator
So that I can invite members to dive
I want to add a future trip to Dive Portal

Feature: Log Dive
As a diver
So that I can keep track of my records
I want to upload my dive data to Dive Portal

Feature: Make Friends
As a diver
So that I can share dive data
I want to connect with friends on Dive Portal

These interactions can be seen more clearly in the following diagram:


Thursday, April 24, 2014

Math Investigation

The Problem

How many people are in on the lanai? 
Suppose everyone shook everyone else’s hand exactly once.  How many handshakes would that be?
Suppose there were 120 people on the lanai. How many handshakes would that be?

The Solution

In solving this problem, I began first by drawing a few pictures. I represented each individual by a dot, and each handshake by a line. These drawings for 1-5 individuals are as follows:




I then turned these into a chart, showing the number of individuals and the number of handshakes:

Number of Individuals Number of Handshakes
10
21
33
46
510


I then noticed a pattern I had seen before...if you take the difference between the number of handshakes from one row to the next, that difference is equal to the number of individuals in the first of these two rows. Allow me to clarify. Consider rows 3 and 4, with 3 and 4 individuals. When you take the difference between the number of handshakes associated with each row, that difference is 3, which is the number of individuals in the first of these rows. Similarly, if you add the number of individuals in the second of these rows, 4, to the number of handshakes in that row, 6, the sum is the number of handshakes in the subsequent row. This leads to a recursive formula, where H is the number of handshakes, and n is the number of individuals:

Hn = Hn-1 + n-1

This can also be written in summation notation as follows:


A recursive formula is great if you already know the number of handshakes for the previous row, but suppose you want to quickly determine the number of handshakes for 120 people. Maybe there is quicker way to determine this.

Consider if there are 4 individuals in the group: A, B, C, and D. Another chart could be made to show the handshakes as follows:

AB     AC     AD
BC     BD
CD

If you take this triangle of handshakes and duplicate it, placing the duplicate next to the original triangle, the resulting shape is a rectangle with n rows and n-1 columns:

AB     AC     AD
BC     BD      **
CD      **       **
 **       **       **

This demonstrates a way to turn the recursive equation into an explicit equation. Multiply the number of rows (n) by the number of columns (n-1) and divide in half:

H = n * (n-1) / 2

If you apply this equation to the original question of 120 people, the answer is:

H = 120 * 119 / 2 = 7,140

If 120 people each shook every other person's hand, there would be a total of 7,140 handshakes!