I don't get what they are asking for here. It makes no sense. An ordinal number is a positional number. ACSII numbers are not really positional, but if that is what we are looking at none of the results they give make any sense.

# What are they asking for? ACSII numbers do not match with their output example.

Under discussion

Comments (7)

- Popular
- New
- Old

You must be signed in to leave a comment

Guadalupe Gagnon

17 October 2020, 17:12

Example first file:
"text in file"
(i added dashes to separate the characters so the numbers above match clearer)
1 2 3 4 5 6 7 8 9 10 11 12
t-e--x-t-- -i-n- --f---i---l---e
↑ ↑ ↑ ↑ ↑ ↑
Every other character is output to the second file:
Output in the second file:
"eti ie"

+1

AlfredW

17 October 2020, 17:50

Thanks Guadalupe,
I had just put it together from looking at other posts.
I really think that they could be clearer about what they are looking for in some of these exercises.
Also just as a sticking point argument on this one... If we are looking at character position numbers and evaluating them for this exercise then "0" would be an ordinal number, Because it describes a position in the file stream. This is true in arrays as well, arr[0] is the first element in an array. So this makes 0 an ordinal number for arrays as well, because it indicates a position.

0

Guadalupe Gagnon

18 October 2020, 03:08

In computer science, when saying ordinal, you are essentially saying "starting from 1"

0

AlfredW

18 October 2020, 15:10

how does one then indicate the zeroth position in a stream or an array?

0

Guadalupe Gagnon

19 October 2020, 13:28

When talking array index access, you still need to use the proper numbers (eg starting from 0). When talking ordinal you start from 1. You don't access the index by the ordinal number, that would be combining two different definitions. The term 'ordinal' was defined ages before the concept of the modern computer was invented.
Now, computers, when first invented, were very limited with memory and what the cpu could process (its speed). With bits (the ones and zeros) you can fit, in base two, (n^2)-1 numbers in the bits (the number of bits squared minus one), so two bits can store three numbers(2^2-1 = 3), four bits can store 7 numbers(4^2-1 = 7), etc. Every time another bit was added the computer slowed down further, or wouldn't have enough switches to process the number of bits. It made perfect sense to make the starting point of numbers 0 to reduce the amount bits potentially needed.
Nowadays computers can process billions of bits a second, so the engineering required to maximize the usage ages ago has lost meaning. Just remember that all modern computers are literally built off the concepts built starting in the 1920's/30's.

0

AlfredW

19 October 2020, 16:04

Ha ha yeah. Some of this is in my head deep in there somewhere from back in the early 80's when I studied CS in college.
But to harp on the point a bit, an ordinal number is one that is used to order things. This is the original, pre CS definition that is still used today. Ordinal, order, Positional... So with that in mind if we have a position, or a thing, for which we have assigned the position "0" to, then in that case "0" is an Ordinal number, by the very fact that it is being used to denote a particular item or position.
But I get that this is academic.

0

Guadalupe Gagnon

19 October 2020, 16:49

=P

0