Tuesday, June 14, 2011

Pedagogy X Secondary Text 4

A businessman wanted to calculate the time taken to do certain things. He said he would calculate the time a caterpillar robot took to approach a block, climb up it, then walk along it. For example, he placed a block on a piece of paper, and said that the height was 0 metres at a position of 0 metres, then changed from 0 metres to 0.1 metres at a position of 0.1 metres at the side of the block, then stayed constant at 0.1 metres at a position of 0.2 metres. The total distance a caterpillar robot would have travelled from position 0 metres to position 0.1 metres, then moved up the side of the block at 0.1 metres and then from position 0.1 metres to 0.2 metres was 0.1 metres + 0.1 metres + 0.1 metres = 0.3 metres. The formula: speed (metres/second) = distance (metres) / time (seconds) can be manipulated to calculate: time (seconds) = distance (metres) / speed (metres/second). In this case: time = 0.3 metres / 0.1 (metres/second) = 3 seconds, which is the time the caterpillar robot took to approach a block, climb up it, then walk along it. By calculating the duration of the caterpillar’s journey, the businessman worked out the different durations the caterpillar took to climb the different types (horizontal and vertical) parts of the terrain. In this way, he calculated the time the caterpillar robot took to approach a block, climb up it, then walk along it.
Also, a biomedical scientist used induction, which is finding a rule applying to each of a number of sets of data, to perform a computation. He used induction to separate types of patients needing rehabilitation. If a patient could walk before rehabilitation, he or she wouldn’t need it. Also, if a patient had recovered the ability to walk, shown inductively by walking unaided along a line, he or she was released. He tested that the brain had healed, enabling the patient to move normally, by inductively comparing the fluency and sureness of their movements with those of a healthy person. In this way, he used induction to separate recovered patients from unrecovered ones who would need rehabilitation.
Also, a business tax collector examined the way he executed a counting algorithm. He counted the time an algorithm, which counted a number of items in a list, took to execute. The algorithm: 1. count([], Count, Count).
2. count(List, Count1, Count2) :-
3. List = [_Item1 Items],
4. Count3 is Count1 + 1,
5. count(Items, Count3, Count2).
Line 1: When the base case is given the empty list to count the number of items in, it returns the current Count as the final Count.
Line 2: Count/3 counts a number of items in a list, where List is the list of items to count, Count1 is the initial count and Count2 is the final count.
Line 3: The list is processed so that next time the predicate is executed, Items will be the new List, and when there are no items in List, the count will be finished.
Line 4: The current count is incremented by one because there is one more item in the list.
Line 5: The count predicate is recursively called, so that the count can either be incremented again if there are any more items in the list, or the count can be returned if the list is empty.
Suppose the following query is given: ?- count([a, a, a, a], 0, Count), where [a, a, a, a] is the list of items to count, 0 is the initial count and Count is the final count. Following this, the output is: Count = 4. It took n times to execute, where n is the number of items in a list and the counter starts from 0. This showed that the width of the list, if each character was 0.01 metres wide, would be the number of characters x 0.01 metres, where the number of characters is the time to execute. In this way, the time an algorithm, which counted a number of items in a list, took that number of items as the number of times to execute.
Also, a biotechnologist said how what he would do with old variables. A variable holds a value, and is used during an algorithm. He said the thing he would do with the old variables was to delete them. He also said he would delete the variables after they had been finished with. Then he said he would mark the length of rope, representing the times the variable had been used, and specially marking the last time the variable had been used, so it could be deleted after it. In this way, he would delete variables after they had been finished with.

No comments:

Post a Comment