The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   The Coat Room (http://hintsforums.macworld.com/forumdisplay.php?f=8)
-   -   I need math examples in computer science (http://hintsforums.macworld.com/showthread.php?t=70704)

Craig R. Arko 05-05-2007 10:30 AM

Quote:

Originally Posted by roncross@cox.net (Post 376902)
Ok, you got me, what is a gygabyte?

I believe the suggested nomenclature for 2^30 is gibibyte, with gigabyte being used for 10^9, per the IEEE 1541 standard.

http://en.wikipedia.org/wiki/IEEE_1541

cwtnospam 05-05-2007 10:48 AM

It seems like the drive makers, rather than admit that their marketing departments have been over-inflating drive capacities, have found a way to claim that they're right:
From the same Wiki page:
Quote:

After a trial period of two years, in 2005 IEEE 1541-2002 has been elevated to a full-use standard by the IEEE Standards Association, and it is now scheduled for maintenance in 2007.

Despite the presence of the standard, the new binary prefixes have difficulty in gaining acceptance. Common refutations are that SI prefixes for binary multiples have been used for years for computer-related quantities and that major operating systems and applications still use SI prefixes for binary multiples.
Nevertheless, manufacturers of storage devices, such as hard disks and DVDs, are used to decimal multiples to express capacities, and decimal multiples are used for transmission rates as well. This is a common cause of confusion among users that see those amounts reported inconsistently, especially as capacities become bigger and bigger and the absolute error increases.
In any case, it's important for students of any computer science class to understand the differences.

NovaScotian 05-05-2007 11:01 AM

You mention trig functions and sequences and series.

Sin(x) can be expressed as a series: x - (x^3)/3! + (x^5)/5! - ...

Similarly, Cos(x) = 1 - (x^2)/2! + (x^4)/4! - ...

Both converge briskly because of the factorials, and the first (Sine) is fairly accurate for small angles (in radians) using only the first term.

roncross@cox.net 05-05-2007 12:28 PM

Quote:

Originally Posted by NovaScotian (Post 376979)
You mention trig functions and sequences and series.

Sin(x) can be expressed as a series: x - (x^3)/3! + (x^5)/5! - ...

Similarly, Cos(x) = 1 - (x^2)/2! + (x^4)/4! - ...

Both converge briskly because of the factorials, and the first (Sine) is fairly accurate for small angles (in radians) using only the first term.

Yes ok, but how does this relate to computer science? Is this the way computers calculate cos(x) and sin(x) using 4 or so terms? If so, this may also be a good example.

NovaScotian 05-05-2007 02:13 PM

In CS, most engines use FDLIBM's version which is an approximate polynomial of degree 13 on the range 0 to pi/4 with six coefficients since only even powers of x are considered. All other ranges can be found using identities.

Since the exact polynomial converges so quickly, however, not too many terms are required to converge within a given tolerance. Have them figure that out.

tw 05-05-2007 07:27 PM

let me add that as far as computers go, usually the logic of a problem is more difficult for students than the actual math. for instance, I run across students (more often than I like) who are capable of understanding fairly sophisticated calculations so long as they are step-by-step, but throw in anything conditional (where they have to keep two potential program flows in mind, as opposed to one actual program flow, or figure out the behavior of a conditional loop) and they get lost. heck, I have students are in a world of hurt trying to parse out a phrase like:

if ((var1<var2 && var2<var3) || var1>var3) ...

they just don't seem to be able to track the ORs and ANDs.

maybe get them to program a craps game - not too difficult, good conditionals and some basic statistics, and they'll find it entertaining... :)

cwtnospam 05-05-2007 08:11 PM

Here's one you could create lots of variations on:

If the probability of making a coding error is XX per hour of programming, and the probability that any given error will not be detected until after the final release is YY, how many undetected errors can be expected in an application that required ZZ man-hours of programming?

You could also do something similar with network security: If a hacker with a certain skill level can expect to find XX flaws in YY hours of searching, and the probability of a flaw being exploitable is ZZ, what are the odds that they will find an exploitable flaw if they pull an all nighter? That ought to hold their attention. ;)

roncross@cox.net 05-05-2007 09:02 PM

the programming one and the hacker problems are good examples and a good use of probability. Thanks...

roncross@cox.net 05-23-2007 01:58 AM

I want to thank everyone for their advice on math examples. The students really love the computer examples that involve summation and permutation in relationship to networking. I will be teaching the same course next quarter so if you have examples or come up with examples, please post so that I have them available for them. It is really appreciated.


All times are GMT -5. The time now is 03:06 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.