Site hosted by Angelfire.com: Build your free website today!

 

Sets

 

A Baka Matrix may be used to hold a set. In mathematics a Set is defined a list of elements and is often represented by the capital letter S. 

 

S = { a, b, c, ...}

 

A set can contain elements where each element is also a set, in other words “a set of sets”. In the example below T1 - Tn represents different sets:

 

S = { T1, T2,T3 ... Tn }

 

 

The “Business Card “ Encryption Algorithm

 

A string of text is very similar to a set. Instead of a set of numbers it represents a set of text. But in the computers memory the text is actually stored as a set of numbers. These numbers have a consistent code for each character. ASCII and Unicode are the most common character codes used today.

In the IBM mainframe world EBCDIC (AKA “Ebsi”) is most commonly used.

 

S = { S T1, S T2, S T3, ... }

 

Where S is a set of summation of Set T.

 T = {E(ti), U(ti), A(ti) ...} and ti is a variable which represents a text character.

E( ) is a function that transforms the text character into Ebsi.

U( ) is a function that transforms the text character into Unicode.

A( ) is a function that transforms the text character into ASCII.

 

On a International business card there are several pieces of information in different langauges such as name, address and title. Only those who can read a particular language knows what that part says. The business card encrption scheme works in a simular way. Only part of the encrption can be read by one program. The encrpted code must be sent through several programs in a certain order for the message to be completely read.

Just like text was translated from Characters to ASCII, character can be translated to some other code and have several translation layered on top of each other. This can be represent with the following formula.

 

S Tx

 

Cardinality

 

One other thing to keep in mind is that even if we have a count of elements in Baka Matrix represented as |[B]| for [B] this does not have to be a linear set of element such as an array or linked list might be used to represent. Baka Matrix [B] could be represented by a binary tree where |[B]| holds the total number of Nodes in the Binary Tree. This number might be useful for giving some indication on how long it might take to transverse the binary tree. In this case the number currently in |[B]| is not useful in indicating the last element in the Baka Matrix [B]. In this case the Symbol & may be used to “Point To” the last element. The last element in a structure is often indicated as Z so if there is a header element that points to Z it would be denoted as &Z. the Element &Z would hold the address of the element Z.

 

Finite State Machines

 

In some case structure can replace code. This is the Code Vs. Structure Scenario.

For example if a program is to be developed for students to take a multi-answer quiz.

the rules of the Multi-Answer quiz state the there can be more then one answer but each question should always have at least one answer. Each Answer can only be used once.

 

For the sake of illustration let’s say that the quiz is for American History. Question 1 is “Name the first 13 colonies of America”  If all the student can remember is Delaware, then he or she can not just enter Delaware 13 times. There has to be some sort of mechanism that checks to see if an answer has been already used. If this program is to be interactive and check each answer as it is enter then there needs to be some way of determining the state that the student is in while answering the question.

 

Here are some possible states:

 

Student has entered in an Answer

Student has entered in all possible Answers

Student has entered in a duplicate Answer

Student has entered in a wrong Answer

Student has entered in a correct Answer

Student has moved on to the next question

 

These states can be diagramed as Finite State Machines as in the following Illustration.

 

 

 

Here the initial state is So. When the next state is reached there are several possibilities.

If the answer is a Duplicate or Incorrect, the program will be go back to the same state, if the  Answer is correct then the program will move to the next state.

 

Now it may be possible to create a flow chart instead of using the Finite State Machines but that would tend to start the direction of how the code will look and there needs to be more analysis done before writing the code.

 

Consider also another possibility: Repetition. If the student is giving wrong answers on a question, then that question should be asked again relatively soon. The question that the student answers correctly should not be asked as often and the there may be a certain number of times that a question is answered correctly that it no longer needs to be asked.

 

Once again there are several states in answering questions that may be diagramed with FSM.

 

A program could be written which would use many nested if-then statements to accomplish all the testing of each state and the action that should be taken. Testing to make sure that each nested if-then combination works correctly could be a nightmare.

Any changes made to the code would also be difficult to test and correct.

 

The program would be easier to modify and test if structures are used to store the states instead. The Baka Matrix will be used to determine what structures are required to accomplish this.

 

To make sure that an answer is not repeated, a new indicator is used which is the Symbol for the question mark (?). This symbol denotes a True or False condition. If A is a possible correct answer then A? represents the question has A been used and would evaluate to either true or false.  The following diagram shows how this would look in a Baka Matrix.

 

 

In the case of how long to wait before a question, the symbol Delta represented by a triangle is used to represent that a change must take place. In this case time is changes which is represented as a lower case t. The following Diagram represents the resulting Baka Matrix.

 

 

These two matrix can be combined together so that there are many answers to each question. In other words there is a parent - Child relationship between questions and answers. The following diagram shows how this would be illustrated.

 

 

Here N was changed to M for the matrix of Answers because the number of Questions are not equal to the number of answers so the two matrixes can not use the same letter.

There is a set of answers for each question and the number of answers for each question is not always the same.

 

Therefore M is actually a set of numbers where M = ( M1, M2,...Mn)

 

 

 

Interfacing programs on different platforms

 

There are some data structures that are used to transfer information from one data platform to another. Some examples are the ORB used in Corba and the Queue used in MQ Seris.