StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

The Z Notation - Math Problem Example

Cite this document
Summary
This paper 'The Z Notation' tells us that the Z notation is a mathematical notation that describes system properties without describing the process in which these properties are archived. This helps in the description of what the system does without describing how it does those functions. Mathematical data types are used…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER98.9% of users find it useful
The Z Notation
Read Text Preview

Extract of sample "The Z Notation"

THE Z NOTATION The Z Notation INTRODUCTION The Z notation is a mathematical notation that describes system properties without describing the process in which these properties are archived. This helps in the description of what the system does without describing how it does those functions. Mathematical data types are used. Though these mathematical data types don't represent the computer notation, they help determine how a particular system will behave. The Z notation also allows for the disintegration of a given specification into schemas, this helps in presenting the code piecewise. Each piece can then be described informally with a commentary. The Z schemes describe the dynamic and static aspects of a system. The static aspect of a system includes the states the system can occupy and the relationship maintained when the system transits from state to state. The dynamic aspects include the operation that are possible, the changes that occur and the input - output relationship. (i)Initial condition for the stack Let the sequence be called 'stack' Setting the initial condition of the stack Stack N Item: seq ITEM (ii)Defining the limit condition in the limit schema; LIMIT LIMIT: N LIMIT = 256 The precondition limit = 256 sets the maximum value of the count. The count is a set of positive non zero numbers. (iii) Defining a counter to enable count the number of items as they are added to the stack the following schema is obtained; COUNTER : Z LIMIT (iv)Setting the initial value of count and the limit; COUNTER = 0 = 256 The precondition count = 0 and limit = 256 sets the counter ready to receive the first value and count '1'. Combining the schema Stack N : Z (1)PUSHING THE ITEM INTO THE STACK The addition of an input requires the counter to be incremented by one and an element is added to the stack. ADD STACK The precondition states that the item to be added is not an element in the sequence (seqITEM) The precondition states that final sequence is comprised of the original sequence plus item (i) which is being added. The schema for the counter change is as shown below COUNTER The precondition increments the value of count by one every time a value is added. The precondition indicates that the limit does not change. The precondition indicates that the number of items added cannot exceed 256, which is the limit. If the item to be added in the sequence already exists, the item should not be added to the list. The schema ALREADYADDED helps to control this. ALREADY ADDED The precondition tests if the item to be added already exists in the given sequence. If the value exists , then the system returns a value (ALREADY_ADDED) If the value is already in the sequence the resulting sequence does not change, this precondition is given by The function INFORM: is given by: Combining the three schemas gives the general expression for pushing the item onto the stack. PUSH_ITEM The item (i) becomes a subset of the ITEM The resulting count + 1 must be less than the limit value The limit value does not change The sign depicts change of state If the sequence has the item identical to one being input then, the system displays 'ALREADY_ADDED' (2)POPPING THE ITEM FROM THE STACK The schema for displaying an item is DISPLAY_ITEM For the item to be displayed it must be contained in the sequence The function takes the name of the requested item and finds it and displays all information about the given ITEM. There is no change in state of the system, this is illustrated by the symbol To prevent displaying an item not in the sequence, the system should return a NOT_FOUND result, the expression is given by; NOT_ FOUND The schema indicating that the item has been found is shown below FOUND The three schemas that is; (DISPLAY_ITEM), (NOT_FOUND) and (FOUND) are joined together to form one schema. The resulting schema is shown below; POP_ITEM The schema displays the value of a given item when the name is input. (3) THE PRECONDITION FOR PUSH AND POP OPERATIONS The preconditions for push operation The item name to be added should not exist in the set already stored Item name ITEMS The declaration "" indicating that the system will change. This declaration shows that for the item to be added the count value must be less than the limit. The number of items must also not exceed 256 as set by the condition LIMIT = 256 The counter elements comprise of integers that is positive numbers The precondition ensures that they are no double entry. if this occurs it returns a value 'ALREADY KNOWN' The precondition for pop operation The shows the stack condition does not change before and after operation. This precondition indicates that for the item to be displayed it must be contained in that sequence. The function, displays the item in the sequence. This function indicates that if the item is not in the set of items in the sequence, then the system returns a value of 'NOT_FOUND' The function allows the system to display a specified item in the sequence and also displays 'FOUND' (Spivey, 1998). (4) TEST DATA TO BE USED Two tests data can be used (1) The list of persons name and corresponding salaries (can be used by a company to store data of the employees working in that company and also store the salaries of these people.) the reasons for using this type of data are The numbers of people are countable, that is the variable is discrete. This means that for every person added to the sequence a count of one is added to the system. Each person has a unique name. Several people using one name may earn the same salary, the system can be coded to display number of people earning the same salary, this means that the tests data type can be subjected to various operations. (2) the list of persons name and corresponding age This tests data type is also suitable, the reasons being; The numbers of people are countable, that is their value is discrete. Each person has a unique age; this allows for easy formulation of test functions. for example, the names of different people can be matched with their age using a function. Each person has a unique name allowing entry of several people in the program database. This data item can also allow other function to be tested, e.g. arrays, bags rotation etc. (5) ROTATE LEFT The first element takes the last position and the other elements remain the same. The following parameters are used; : The first element of the sequence : The last element of the sequence : All the other elements of the set except the first element : All the other element of the set except the last element : reverses all items of the sequence (ITEM) Defining the system initial condition before rotation; ROTATE_LEFT The schema for rotating left is shown below; ROTATE_LEFT (6)ROTATE RIGHT ROTATE_RIGHT (7)TEST DATA FOR ROTATE RIGHT AND ROTATE LEFT To test for rotation a number (i) and the square of the number (i2) can be used. The test data comprise of different numbers and their squares, these numbers form a sequence. The elements can be arranged so that the top most elements are the first members of the given sequence and the last element is greatest number in that list. On rotating left the greatest number and its square becomes the first element of the set. (8)PROVE; ROTATE RIGHT: ROTATE RIGHT = The sequence has the set: seqITEM The original sequence is comprised of the headITEM and the tailITEM. This is described below Rotating the sequence left Rotating the resulting sequence right; The resulting expression after rotating the equation left and right are the same hence Rotate left: rotate right does not change the arrangement of the stack References Spivey, M. J. 1998. The Z Notation, a Reference Manual. Oxford: Oriel College. Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“The Z Notation Math Problem Example | Topics and Well Written Essays - 3250 words”, n.d.)
Retrieved from https://studentshare.org/science/1512444-the-z-notation
(The Z Notation Math Problem Example | Topics and Well Written Essays - 3250 Words)
https://studentshare.org/science/1512444-the-z-notation.
“The Z Notation Math Problem Example | Topics and Well Written Essays - 3250 Words”, n.d. https://studentshare.org/science/1512444-the-z-notation.
  • Cited: 0 times

CHECK THESE SAMPLES OF The Z Notation

Organ Donation a Controversial Topic

The essay “Organ Donation – a Controversial Topic” discusses the need for organ donations for ill individuals.... Still, people do not donate organs.... Reasons range from religion to misinformation for not donating organs.... Religious reasons cannot be changed.... hellip; The author states that organ donation should remain a choice, but this choice must be more informed....
1 Pages (250 words) Essay

Sports recreation

The author of this essay "Sports recreation" casts light on the significance of sports in modern life.... According to the text, sports being a major scenario in our day to day lives not only helps us in maintaining fitness but also helps in mind physiology.... hellip; Soccer which is mainly known as football is used in the notational analysis in which its techniques are aimed at the analyzing of the gross movement in the game....
6 Pages (1500 words) Essay

Unit 1 mutation

This genomic sequence may refer to the DNA sequence of a cell or the RNA sequence of a virus.... Mutation in gene DNA changes the amino acids sequence of a protein encoded by the gene.... For this case, the DNA sequence is interpreted… So what causes mutation? Mutation can happen spontaneously through molecular decay, or it can be induced by the use of mutagens (Sage, 2005)....
1 Pages (250 words) Admission/Application Essay

Why I Want To Do My Rural Rotations In Western Australia And My Rural Location Of Preference

This paper under the headline "Why I Want to Do My Rural Rotations in Western Australia and My Rural Location of Preference" focuses on the fact that rural rotation is part of a student's fulfilment of the academic program into health care and medical practice.... hellip; Rural rotation is a recommended program and is facilitated by learning institutions to enable students to gain experience and improve their skills through interaction with rural environments....
1 Pages (250 words) Essay

What is a Nation

This essay focuses on history of the Europeans and nationalism, describes the idea of a national sensibility and how people derive their identities.... Also attempts to define what a nation is in details, according to famous researchers Hunt and Ernest Renan.... … This essay not only describes terminology of a nation according to Hunt and Renan, but also focuses on history of developing Europeans as a nation....
2 Pages (500 words) Essay

Influence of Gender Differences

Participants were given a series of different shapes on computer screen for 48 trials.... The experiment involved comparing random shapes.... The results… showed that as the angle of rotation becomes bigger, it took the participants longer to make decision whether it's an identical version of the shape or reflected version....
4 Pages (1000 words) Essay

Differentiate a nation, a state, and a nation-state

A nation entails a defined structure of ruling to a given population that share religion or a given language.... The binding units of a nation are common experiences of history.... A nation originates from the… Language is a significant element that defines different nations.... The available resources in a given territory also define a given nation in the context of survival....
2 Pages (500 words) Essay

A Casualty Clearing Station

A writer of the essay "A Casualty Clearing Station" claims that Dr.... Hayward narrated his experience so that he could provide an inside picture of the terrors of war and the difficulties that were faced by the medical fraternity during periods of war.... hellip; ''A Casualty Clearing Station" is a primary source which first appeared in the year 1930 in the book "Everyman at War"....
4 Pages (1000 words) Essay
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us