# A question of maths

Discussion in 'NZ Computing' started by Philip, Apr 15, 2006.

1. ### PhilipGuest

How do I work out how long it would take do download a certain amout of
data at a given nominal speed?

Say I have a 100 MB file to download and I am connected at 256 kBit/s.
What's the easy equation? And how do I scale this to work out times at
different speeds.

I know the real speeds achieved differ from what's advertised, but I
want first to consider the theoretical perfect transfer.

Philip

Philip, Apr 15, 2006

2. ### MarkHGuest

Philip <> wrote in news:44402a79\$:

> How do I work out how long it would take do download a certain amout of
> data at a given nominal speed?
>
> Say I have a 100 MB file to download and I am connected at 256 kBit/s.
> What's the easy equation? And how do I scale this to work out times at
> different speeds.

256Kbit/s divided by 8
= 32 KB/s x 60
= 1920KB/minute x 60 / 1024
= 112.5 MB/hour

In practical terms if you get pretty good speeds 30KB/s or better than you
110 MB per hour then you are getting close to the theoretical maximum
speed.

--
Mark Heyes (New Zealand)
See my pics at www.gigatech.co.nz (last updated 5-September-05)
"The person on the other side was a young woman. Very obviously a
young woman. There was no possible way she could have been mistaken
for a young man in any language, especially Braille."

MarkH, Apr 15, 2006

3. ### JerryGuest

MarkH wrote:
> Philip <> wrote in news:44402a79\$:
>
>
>>How do I work out how long it would take do download a certain amout of
>>data at a given nominal speed?
>>
>>Say I have a 100 MB file to download and I am connected at 256 kBit/s.
>>What's the easy equation? And how do I scale this to work out times at
>>different speeds.

>
>
> 256Kbit/s divided by 8
> = 32 KB/s x 60
> = 1920KB/minute x 60 / 1024
> = 112.5 MB/hour
>
> In practical terms if you get pretty good speeds 30KB/s or better than you
> could expect to download 100MB in about an hour or so. If you get 105 -
> 110 MB per hour then you are getting close to the theoretical maximum
> speed.

why the 1024? A megabyte is 1 million bytes; 1000 x 1000; 1,000,000 bytes.

Jerry, Apr 15, 2006
4. ### Stephen WilliamsGuest

>
> why the 1024? A megabyte is 1 million bytes; 1000 x 1000; 1,000,000
> bytes.
>

Have Western Digital paid you to say that?

Steve

Stephen Williams, Apr 15, 2006
5. ### Murray SymonGuest

On Sat, 15 Apr 2006 13:44:38 +1200, Jerry wrote:

> MarkH wrote:
>> Philip <> wrote in
>> news:44402a79\$:
>>
>>
>>>How do I work out how long it would take do download a certain amout of
>>>data at a given nominal speed?
>>>
>>>Say I have a 100 MB file to download and I am connected at 256 kBit/s.
>>>What's the easy equation? And how do I scale this to work out times at
>>>different speeds.

>>
>>
>> 256Kbit/s divided by 8
>> = 32 KB/s x 60
>> = 1920KB/minute x 60 / 1024
>> = 112.5 MB/hour
>>
>> In practical terms if you get pretty good speeds 30KB/s or better than
>> 105 - 110 MB per hour then you are getting close to the theoretical
>> maximum speed.

>
> why the 1024? A megabyte is 1 million bytes; 1000 x 1000; 1,000,000
> bytes.

cue flame war ... (but yes, you're right Jerry).

In reality you can use either figure as it is only an estimation and
your Internet speed is likely to be the most variable factor, anyway.

Murray Symon, Apr 15, 2006
6. ### MarkHGuest

Jerry <> wrote in news:44404d66\$:

> MarkH wrote:
>> Philip <> wrote in
>> news:44402a79\$:
>>
>>
>>>How do I work out how long it would take do download a certain amout
>>>of data at a given nominal speed?
>>>
>>>Say I have a 100 MB file to download and I am connected at 256
>>>kBit/s. What's the easy equation? And how do I scale this to work out
>>>times at different speeds.

>>
>>
>> 256Kbit/s divided by 8
>> = 32 KB/s x 60
>> = 1920KB/minute x 60 / 1024
>> = 112.5 MB/hour
>>
>> In practical terms if you get pretty good speeds 30KB/s or better
>> you get 105 - 110 MB per hour then you are getting close to the
>> theoretical maximum speed.

>
> why the 1024? A megabyte is 1 million bytes; 1000 x 1000; 1,000,000
> bytes.

Is that a special size for pedants, or are you talking about common usage?

Try this:
Right click a large file and select properties, check size.
In Windows: 349MB (366,231,552 bytes)
In Linux: 349.3MB (366,231,552 bytes)

In common usage 1MB=1024x1024

--
Mark Heyes (New Zealand)
See my pics at www.gigatech.co.nz (last updated 5-September-05)
"The person on the other side was a young woman. Very obviously a
young woman. There was no possible way she could have been mistaken
for a young man in any language, especially Braille."

MarkH, Apr 15, 2006
7. ### -=rjh=-Guest

Philip wrote:
> How do I work out how long it would take do download a certain amout of
> data at a given nominal speed?
>
> Say I have a 100 MB file to download and I am connected at 256 kBit/s.
> What's the easy equation? And how do I scale this to work out times at
> different speeds.
>
> I know the real speeds achieved differ from what's advertised, but I
> want first to consider the theoretical perfect transfer.

It's been done a thousand times before, writing a javascript calculator
is trivial, so there are heaps of these on the web.

-=rjh=-, Apr 15, 2006
8. ### EnkiduGuest

Philip wrote:
> How do I work out how long it would take do download a certain amout of
> data at a given nominal speed?
>
> Say I have a 100 MB file to download and I am connected at 256 kBit/s.
> What's the easy equation? And how do I scale this to work out times at
> different speeds.
>
> I know the real speeds achieved differ from what's advertised, but I
> want first to consider the theoretical perfect transfer.
>

256kbps is 256 x 1024 bits per sec = 262144 bps = 32768 Bytes per second.

100Mb = 104,857,600 Bytes

Therefore 100Mb at 32768 bytes per second = 104857600 / 32768

= 3200 second = 53 minutes and 20 seconds.

I've used a scaling factor of 1024 = 1k. In some circumstances 1k may be
1000 units.

To look at it another way, 256kbps = 32kB/sec and you want to transfer
100MB or 102,400kB. That gives a transfer time of 3200 seconds. Amazing!

Cheers,

Cliff

Enkidu, Apr 15, 2006
9. ### Stephen WorthingtonGuest

On Sat, 15 Apr 2006 02:24:19 GMT, MarkH <> wrote:

>Jerry <> wrote in news:44404d66\$:
>
>> MarkH wrote:
>>> Philip <> wrote in
>>> news:44402a79\$:
>>>
>>>
>>>>How do I work out how long it would take do download a certain amout
>>>>of data at a given nominal speed?
>>>>
>>>>Say I have a 100 MB file to download and I am connected at 256
>>>>kBit/s. What's the easy equation? And how do I scale this to work out
>>>>times at different speeds.
>>>
>>>
>>> 256Kbit/s divided by 8
>>> = 32 KB/s x 60
>>> = 1920KB/minute x 60 / 1024
>>> = 112.5 MB/hour
>>>
>>> In practical terms if you get pretty good speeds 30KB/s or better
>>> you get 105 - 110 MB per hour then you are getting close to the
>>> theoretical maximum speed.

>>
>> why the 1024? A megabyte is 1 million bytes; 1000 x 1000; 1,000,000
>> bytes.

>
>Is that a special size for pedants, or are you talking about common usage?
>
>Try this:
>Right click a large file and select properties, check size.
>In Windows: 349MB (366,231,552 bytes)
>In Linux: 349.3MB (366,231,552 bytes)
>
>In common usage 1MB=1024x1024

Actually, that is now wrong. There is a proper standard for binary
prefixes that work alongside SI prefixes. Everybody should now be
doing it right, so there will be no confusion:

SI Prefixes (decimal):
http://physics.nist.gov/cuu/Units/prefixes.html

IEC binary prefixes:
http://physics.nist.gov/cuu/Units/binary.html

so 1 MB is 1,000,000 bytes and 1 MiB is 1,048,576 bytes.

Stephen Worthington, Apr 15, 2006
10. ### MarkHGuest

Stephen Worthington <34.nz56.remove_numbers> wrote in
news::

> On Sat, 15 Apr 2006 02:24:19 GMT, MarkH <> wrote:
>
>>In common usage 1MB=1024x1024

>
> Actually, that is now wrong. There is a proper standard for binary
> prefixes that work alongside SI prefixes. Everybody should now be
> doing it right, so there will be no confusion:
>
> SI Prefixes (decimal):
> http://physics.nist.gov/cuu/Units/prefixes.html
>
> IEC binary prefixes:
> http://physics.nist.gov/cuu/Units/binary.html
>
> so 1 MB is 1,000,000 bytes and 1 MiB is 1,048,576 bytes.

Actually you are wrong. In common usage 1MB IS 1,048,576!

In technically correct usage MiB would be used, but I have seen no evidence
that the common usage has moved to the technically correct prefix.

--
Mark Heyes (New Zealand)
See my pics at www.gigatech.co.nz (last updated 5-September-05)
"The person on the other side was a young woman. Very obviously a
young woman. There was no possible way she could have been mistaken
for a young man in any language, especially Braille."

MarkH, Apr 15, 2006
11. ### JerryGuest

MarkH wrote:
> Stephen Worthington <34.nz56.remove_numbers> wrote in
> news::
>
>
>>On Sat, 15 Apr 2006 02:24:19 GMT, MarkH <> wrote:
>>
>>
>>>In common usage 1MB=1024x1024

>>
>>Actually, that is now wrong. There is a proper standard for binary
>>prefixes that work alongside SI prefixes. Everybody should now be
>>doing it right, so there will be no confusion:
>>
>> SI Prefixes (decimal):
>> http://physics.nist.gov/cuu/Units/prefixes.html
>>
>> IEC binary prefixes:
>> http://physics.nist.gov/cuu/Units/binary.html
>>
>>so 1 MB is 1,000,000 bytes and 1 MiB is 1,048,576 bytes.

>
>
> Actually you are wrong. In common usage 1MB IS 1,048,576!
>
> In technically correct usage MiB would be used, but I have seen no evidence
> that the common usage has moved to the technically correct prefix.

From my observation 1,000,000 = 1 Meg is more common than the
1,048,576. Do youu have proof otherwise?

Jerry, Apr 16, 2006
12. ### Guest

Jerry wrote:
> From my observation 1,000,000 = 1 Meg is more common than the
> 1,048,576. Do youu have proof otherwise?

I think it would be hard for him to prove anything about your
observations!

Surely when dealing with files, 1MB generally refers to 1,048,576
bytes? And since the OP refered to a file, that would apply in this
case.

But anyways, this whole argument has been done to death many times
before so should we just cut & paste from another thread?

, Apr 16, 2006
13. ### JerryGuest

wrote:

> Surely when dealing with files, 1MB generally refers to 1,048,576
> bytes? And since the OP refered to a file, that would apply in this
> case.

There is no reason for a file to be measured in any numbering system
other than decimal. I know that Microsoft provides such a number, but I
can't for the life of me see any practical use for it.

I create a text file and type in *the quick brown fox jumps over a lazy
dog.* That is 42 characters. I now type it in 39 more times, no space
or return after the full stop (actually I cut and paste, but for the
example I type it out, OK?). I now have 1680 (42x40) characters in this
file. I can print the file, and count the characters, and there are
exactly 1680 of them. To convert to kilocharacters just move a decimal
point - I have 1.68 kilocharacters. You can do this with liters of
petrol, kilograms of butter, anything you like. Noone can give me a
reasonable reason to convert 1.68K to 1.64K, there just isn't any
logical reason to do so, except that Microsoft does it.

The terms Kilo and Meg are abbreviations anyway. If something costs
megabucks it isn't exactly a multiple of 1,000,000 or 1,048,576.

The mibi stuff is never going to be accepted, it just complicates a term
that was used in the first place to simplify things. It's sort of like
the term Ms didn't solve anything related to the title of women. You
know have women who want you to know they are married (Mrs), Women who
want you to know they are single (Miss) and women who don't want you to
know (Ms). Men still have just one title.

If you just realize that a K is somewhere around 1000, and a Meg is
somewhere around a million it's ok. They aren't supposed to be exact terms.

Jerry, Apr 16, 2006
14. ### Matty FGuest

Jerry wrote:

> wrote:
>
>> Surely when dealing with files, 1MB generally refers to 1,048,576
>> bytes? And since the OP refered to a file, that would apply in this
>> case.

>
>
> There is no reason for a file to be measured in any numbering system
> other than decimal. I know that Microsoft provides such a number, but I
> can't for the life of me see any practical use for it.

I think it's time we got rid of the non-decimal measure for
kilobyte and megabyte. They should be 1000 and 1,000,000 only.

Unfortunately dictionaries such as dictionary.com allow both options:

kilobyte
1. A unit of computer memory or data storage capacity equal
to 1,024 (2^10) bytes.
2. One thousand bytes.

megabyte
1. A unit of computer memory or data storage capacity equal
to 1,048,576 (2^20) bytes.
2. One million bytes.

The first computer I used was an NCR 315, which was a decimal
machine. It had exactly 10,000 12 bit words.

Matty F, Apr 16, 2006
15. ### Roger JohnstoneGuest

In <4441cfe5\$> Jerry wrote:
> wrote:
>
>> Surely when dealing with files, 1MB generally refers to 1,048,576
>> bytes? And since the OP refered to a file, that would apply in this
>> case.

>
> There is no reason for a file to be measured in any numbering system
> other than decimal. I know that Microsoft provides such a number, but
> I can't for the life of me see any practical use for it.

I can't remember how it's presented in Windows, but the Mac Finder shows
file sizes like this:

size: 4KB on disk (320 bytes)

The 4KB is of course meant to be 4kiB (4096 bytes), not 4000 bytes. The
reason they do this is that pretty much every storage device used on
computers today stores data in blocks of 512 bytes. The operating system
often groups those in larger clusters. On my hard drive the cluster size
is 4096 bytes, so every file takes a multiple of 4096 bytes of storage
space.

Because the hard drive, memory, operating system and applications
normally all move data around in binary multiples it was just natural
for sizes to be reported in binary multiples.

You can of course make the argument that the end user should never be
concerned about the space a file takes, but my first computer had a
storage capacity of 140kiB per disk, or 280 blocks of 512 bytes each.
When trying to squeeze as much onto a disk as possible it was important
to know that adding just one more byte to a file could use another whole
block (0.5kiB) on the disk.

Now that storage capacity has increased to the point that the cluster
size is a tiny fraction of the capacity of most storage devices it
generally doesn't matter anymore though. Who cares about a few extra
kibibytes used on a multi-gibibyte disk?

--
Roger Johnstone, Invercargill, New Zealand
http://roger.geek.nz/
________________________________________________________________________
No Silicon Heaven? Preposterous! Where would all the calculators go?

Kryten, from the Red Dwarf episode "The Last Day"

Roger Johnstone, Apr 16, 2006
16. ### MarkHGuest

Jerry <> wrote in news:4441cfe5\$:

> wrote:
>
>> Surely when dealing with files, 1MB generally refers to 1,048,576
>> bytes? And since the OP refered to a file, that would apply in this
>> case.

>
> There is no reason for a file to be measured in any numbering system
> other than decimal. I know that Microsoft provides such a number, but
> I can't for the life of me see any practical use for it.
>
> I create a text file and type in *the quick brown fox jumps over a
> lazy dog.* That is 42 characters. I now type it in 39 more times, no
> space or return after the full stop (actually I cut and paste, but for
> the example I type it out, OK?). I now have 1680 (42x40) characters
> in this file. I can print the file, and count the characters, and
> there are exactly 1680 of them. To convert to kilocharacters just
> move a decimal point - I have 1.68 kilocharacters. You can do this
> with liters of petrol, kilograms of butter, anything you like. Noone
> can give me a reasonable reason to convert 1.68K to 1.64K, there just
> isn't any logical reason to do so, except that Microsoft does it.
>
> The terms Kilo and Meg are abbreviations anyway. If something costs
> megabucks it isn't exactly a multiple of 1,000,000 or 1,048,576.
>
> The mibi stuff is never going to be accepted, it just complicates a
> term that was used in the first place to simplify things. It's sort
> of like the term Ms didn't solve anything related to the title of
> women. You know have women who want you to know they are married
> (Mrs), Women who want you to know they are single (Miss) and women who
> don't want you to know (Ms). Men still have just one title.
>
> If you just realize that a K is somewhere around 1000, and a Meg is
> somewhere around a million it's ok. They aren't supposed to be exact
> terms.

K and M ARE exact terms. According to Si definitions K = 1000 and M =
1000000. In computing terms there is an alternative definition that is
commonly used with bytes which is similar but KB=2^10 Bytes and MB=2^20
Bytes - which are also exact numbers. 2^10 is not an approximate number
meaning around a thousand or so, it is exactly 1024.

I see little point about being pedantic about K and M not being used for
binary versions (2^10, 2^20) instead of decimal (10^3, 10^6) when you
are not exactly pedantic about your use of the English language. i.e.
there is no such word as "noone" - you mean "no one", you used "know"
when you meant "now", unless you are American the word is "litres" - not
"liters"

Also, your example of "megabucks" is a poor one, that is just slang for
expensive and can mean a couple of hundred dollars or billions of
dollars.

--
Mark Heyes (New Zealand)
See my pics at www.gigatech.co.nz (last updated 5-September-05)
"The person on the other side was a young woman. Very obviously a
young woman. There was no possible way she could have been mistaken
for a young man in any language, especially Braille."

MarkH, Apr 16, 2006
17. ### MarkHGuest

Matty F <> wrote in
news:hRk0g.13373\$:

> Jerry wrote:
>
>> wrote:
>>
>>> Surely when dealing with files, 1MB generally refers to 1,048,576
>>> bytes? And since the OP refered to a file, that would apply in this
>>> case.

>>
>>
>> There is no reason for a file to be measured in any numbering system
>> other than decimal. I know that Microsoft provides such a number,
>> but I can't for the life of me see any practical use for it.

>
> I think it's time we got rid of the non-decimal measure for
> kilobyte and megabyte. They should be 1000 and 1,000,000 only.
>
> Unfortunately dictionaries such as dictionary.com allow both options:
>
> kilobyte
> 1. A unit of computer memory or data storage capacity equal
> to 1,024 (2^10) bytes.
> 2. One thousand bytes.
>
> megabyte
> 1. A unit of computer memory or data storage capacity equal
> to 1,048,576 (2^20) bytes.
> 2. One million bytes.
>
> The first computer I used was an NCR 315, which was a decimal
> machine. It had exactly 10,000 12 bit words.

Every computer I have ever used (since 1983) have been binary machines.

The standard SI definition of K, M and G may sound like a simpler thing to
use, but then my 1GB RAM modules would change to 1.073741824GB RAM modules
- nowhere near as simple and tidy sounding.

--
Mark Heyes (New Zealand)
See my pics at www.gigatech.co.nz (last updated 5-September-05)
"The person on the other side was a young woman. Very obviously a
young woman. There was no possible way she could have been mistaken
for a young man in any language, especially Braille."

MarkH, Apr 16, 2006
18. ### JerryGuest

MarkH wrote:

>
> I see little point about being pedantic

but then you go to considerable lengths to correct my typos.

Jerry, Apr 16, 2006
19. ### JerryGuest

Matty F wrote:
> Jerry wrote:
>
>> wrote:
>>
>>> Surely when dealing with files, 1MB generally refers to 1,048,576
>>> bytes? And since the OP refered to a file, that would apply in this
>>> case.

>>
>>
>>
>> There is no reason for a file to be measured in any numbering system
>> other than decimal. I know that Microsoft provides such a number, but
>> I can't for the life of me see any practical use for it.

>
>
> I think it's time we got rid of the non-decimal measure for kilobyte and
> megabyte. They should be 1000 and 1,000,000 only.
>
> Unfortunately dictionaries such as dictionary.com allow both options:
>
> kilobyte
> 1. A unit of computer memory or data storage capacity equal to 1,024
> (2^10) bytes.
> 2. One thousand bytes.
>
> megabyte
> 1. A unit of computer memory or data storage capacity equal to
> 1,048,576 (2^20) bytes.
> 2. One million bytes.
>
> The first computer I used was an NCR 315, which was a decimal machine.
> It had exactly 10,000 12 bit words.

Indeed they do, and they will despite what we say here. Can anyone say
what is improved, or clarified with the use of base 2 meanings of Kilo,
Mega and Giga? We know that a gigabyte of RAM is always going to be
exactly 1,073,741,824 bytes, where an 80 GB hard drive will have
something over 80,000,000,000 bytes. What difference does it make
really? Why was it found necessary to invent a complex numbering system?

At least it isn't using 4 decimal numbers between 0 and 255 to represent
a 32 bit binary number Someone thought this would be easier than

Jerry, Apr 16, 2006
20. ### MarkHGuest

Jerry <> wrote in news:4441eef3\$:

> MarkH wrote:
>
>>
>> I see little point about being pedantic

>
> but then you go to considerable lengths to correct my typos.

The whoosh sound you heard while reading my post was my point whizzing past

In case you care here it is again:
Why be so pedantic about whether KB is equal to 1000 or 1024 bytes when you
care so little about whether the words you use even exist. i.e. I am
pointing out the hypocrisy of your pedantry.

Of course that was what the rest of the sentence that you snipped said,
interesting how you can take issue with half of a sentence.

--
Mark Heyes (New Zealand)
See my pics at www.gigatech.co.nz (last updated 5-September-05)
"The person on the other side was a young woman. Very obviously a
young woman. There was no possible way she could have been mistaken
for a young man in any language, especially Braille."