problem with float

A

Army1987

Charlton Wilbur said:
[1] OT, but at least not about C++ or Windows: The biggest lie is that
there are pitch combinations that are objectively consonant and
dissonant. If you limit your study only to European and American
music from AD 1000 to the present, you can see that this is not the
case: consonance and dissonance are elements of style. But you have
to pick a starting place, and if you hedge too much, you don't get
anywhere and the students don't have the grounding to understand it
anyway, and so freshman music theory students are told that some pitch
combinations are objectively consonant and dissonant.

<ot>
It all depends by what you mean by 'objectively': a fifth is
(approximately under 12-TET) a 3:2 ratio, meaning that the fourth
harmonic of C overlaps with the third harmonic of G (counting the
fundamental frequency as the zeroth harmonic and so on).
Instead, the semitone is a 1 : 1.0595 ratio, meaning that if you
play C and C#[1] together you will hear beatings. Obviously,
concluding that a fifth is always 'better' than a semitone is a
non-sequitur.
</ot>

[1] Whoops... I caused it to be no longer a "not-about-Microsoft
OT"... :)
 
C

Charlton Wilbur

A> <ot> It all depends by what you mean by 'objectively': a fifth
A> is (approximately under 12-TET) a 3:2 ratio, meaning that the
A> fourth harmonic of C overlaps with the third harmonic of G
A> (counting the fundamental frequency as the zeroth harmonic and
A> so on). Instead, the semitone is a 1 : 1.0595 ratio, meaning
A> that if you play C and C#[1] together you will hear
A> beatings. Obviously, concluding that a fifth is always 'better'
A> than a semitone is a non-sequitur. </ot>

Ah, but you're defining "consonance" to mean "has fewer beats when the
interval is played." This would make consonance and dissonance
dependent on tuning. But this is not so, because when you play a
12-tet fifth, there are unpleasant beats between the upper note and
the third harmonic of the lower note. (This is more apparent in the
12-tet major third, where the difference between the just interval and
the 12-tet interval is wider.) And yet the 12-tet perfect fith and
12-tet major third are still both considered consonances.

Alternately, look at the Notre Dame school, or the ars subtilior,
where the perfect fourth is considered a consonance and thirds
dissonances, and where consonance and dissonance is reckoned solely in
relation to the bass; after the time it takes to accustom yourself to
the style, a chord of fourths and fifths where each is in a consonant
relationship to the bass can sound perfectly natural as a
resting-point, even though the major second or seventh found in the
middle would be considered dissonant and unstable in later styles.

Rationalizing the rudiments of Western music has been attempted and
failed by better minds than you or I -- Schenker, Reti, Helmholtz,
Riemann (not the mathematician). Trying to derive the major scale
from the overtone series is like trying to derive English grammar from
anatomy, or C syntax (back on topic! hah!) from the properties of silicon.

Charlton
 
F

Flash Gordon

Jean-Marc Bourguet wrote, On 24/05/07 20:51:

(*) Some are pushing for the use of decimal floating point, which would
solve this second problem but increase the previous one and also increase
the difficulty of the analysis needed to get precise estimations of the
rounding error. IBM just announced a processor with hardware support for
decimal floating point. The C commitee has in project a Technical report
describing extentions to handle them.

The proposal for decimal floating point is not intended to solve the
general problems of floating point. To a large extent it is designed to
solve the problems of financial software, where the algorithm is often
defined in terms of how many decimal places you have to work to, what
rounding you do etc. Having decimal floating point would allow the
company that employs me to significantly simplify some code in the
application that makes most of the companies money whilst also reducing
the possibility of error.
 
J

JimS

The floating point numbers are a subset of the real numbers.

In fact, there are infinity real numbers between each consecutive pair
of binary floating point numbers, so it's a very tiny subset ;-)

Jim
 
O

Old Wolf

Ernie Wright said:


I prefer to think of it as a "lie-to-students" - that is, it's a
strategy that works perfectly well until they know enough about
programming in general and floating-point in particular to realise that
there are circumstances in which it *doesn't* work

I'm not a fan of lie-to-students, especially in a
case like this where it would be very simple to
say something like:
"Always use double because it usually turns out
to be just as fast but you get extra accuracy"
and then they can file away that justification,
and more importantly, it makes them aware that
there may be cases where you use float (even if
they don't know what those cases are at the moment),
and the inquisitive students can follow it up later.

In school, I was taught electricity using the
"dump-truck" analogy: each electron is like
a little truck full of energy, and when it gets
to the bulb it dumps its load and we see the light,
then it goes back into the battery and gets a new
load.

This might explain an utterly simple circuit but
it breaks down very quickly. For example, a circuit
with two bulbs of differing resistances. I was
able to compute the right answer to the current
flow in each branch by using the formulae provided,
but I could never figure out how each dump-truck
decided which way to turn at the intersection and
why they decided that a certain ratio of them would
go one way when they didn't even know what was ahead.
In fact it was not until long after I had finished
my physics minor at university that I read some
websites with proper explanations and I was able
to finally disabuse myself of the ingrained misconception!

A similar thing applies for other people with air
flight; it is woefully common to find people who
think planes fly because the air going over the
wing has to go faster "to catch up with" the air
under the wing.
(I've even seen this printed in a kids education
section of a newspaper).
 
R

Richard Heathfield

Old Wolf said:

In school, I was taught electricity using the
"dump-truck" analogy: each electron is like
a little truck full of energy, and when it gets
to the bulb it dumps its load and we see the light,
then it goes back into the battery and gets a new
load.

This might explain an utterly simple circuit but
it breaks down very quickly. For example, a circuit
with two bulbs of differing resistances. I was
able to compute the right answer to the current
flow in each branch by using the formulae provided,
but I could never figure out how each dump-truck
decided which way to turn at the intersection and
why they decided that a certain ratio of them would
go one way when they didn't even know what was ahead.

Easy - they just pick the shortest queue!
A similar thing applies for other people with air
flight; it is woefully common to find people who
think planes fly because the air going over the
wing has to go faster "to catch up with" the air
under the wing.

Didn't they tell you at school how planes really fly? It's all done with
string.
 
E

Eric Sosman

Richard said:
[...]

Didn't they tell you at school how planes really fly? It's all done with
string.

I hear that the new crop of no-frills airlines charge
extra for terminating characters.

(On a few flights I've encountered characters I wouldn't
mind seeing terminated.)
 
M

Matt van de Werken

JimS said:
In fact, there are infinity real numbers between each consecutive pair
of binary floating point numbers, so it's a very tiny subset ;-)

In fact, it's worse than that:

There are as many real numbers between any two floating point numbers as
there are real numbers (this is the level of infinity known as "aleph
1", if I've remembered my number theory correctly).

There are even more integers than there are floating point numbers, as
the set of floating point numbers is a finite set, but the number of
integers is not as 'large' as the number of real numbers (the set of
real numbers is a 'bigger infinity' than the set of integers).
 
C

Chris Dollin

Matt van de Werken wrote:
There are even more integers than there are floating point numbers, as
the set of floating point numbers is a finite set,

That's an interesting restriction you've added there.
 
C

Charlton Wilbur

CD> That's an interesting restriction you've added there.

I think "floating point numbers" there is implicitly "floating point
numbers representable in a particular floating point format," because
that makes the statement make sense.

Charlton
 
E

Eric Sosman

CBFalconer wrote On 05/25/07 11:25,:
... snip ...



No, I think you've misremembered it. IIRC Aleph0 is a countable
infinity, i.e. each value can be put in 1 to 1 correspondence with
an integer. Aleph1 is not countable.

He didn't claim that Aleph1 is countable; in fact, he
characterized it as a "bigger infinity" than the number of
integers and hence UNcountable.

He also claimed (with a bit of a disclaimer) that Aleph1
is the number of real numbers, which is in a sense neither
true nor false. Gödel and Cohen, separately, showed that the
Continuum Hypothesis can neither be proved nor disproved in
Zermelo-Fraenkel systems; you can construct a consistent
mathematics by taking either the truth or the falsity of the
C.H. as an axiom (assuming Z-F itself is consistent). It's
analogous to Euclid's Parallel Postulate: you can't prove or
disprove the P.P. from Euclid's other axioms, and you can
generate self-consistent geometries by either affirming or
denying it.

Thus, whether Aleph1 is the smallest infinity greater
than Aleph0 or whether there exist other infinities between
them is a matter of personal taste.
 
P

Pierre Asselin

Matt van de Werken said:
In fact, it's worse than that:
There are as many real numbers between any two floating point numbers as
there are real numbers
ok

(this is the level of infinity known as "aleph
1", if I've remembered my number theory correctly).

Not quite. The number of reals is written as "c" and this is not
the same thing as aleph_1. Google for "continuum hypothesis" for
details. In particular, see the Wikipedia article near the top,
where (to stay tenously on-topic :) "c" is written as "pow(2,aleph_0)".
 
A

Aatu Koskensilta

He also claimed (with a bit of a disclaimer) that Aleph1
is the number of real numbers, which is in a sense neither
true nor false. Gödel and Cohen, separately, showed that the
Continuum Hypothesis can neither be proved nor disproved in
Zermelo-Fraenkel systems; you can construct a consistent
mathematics by taking either the truth or the falsity of the
C.H. as an axiom (assuming Z-F itself is consistent).

The statement "Zermelo-Fraenkel set theory is consistent" is neither
provable nor disprovable in Zermelo-Fraenkel set theory. Does this mean that
"Zermelo-Fraenkel set theory is consistent", which, when spelled out, states
that there is no sequence of strings satisfying certain syntactic criteria,
is neither true nor false? Can we "construct a consistent mathematics",
whatever that means, by taking either the truth or the falsity of the claim
that Zermelo-Fraenkel set theory is consistent as an axiom?
Thus, whether Aleph1 is the smallest infinity greater
than Aleph0 or whether there exist other infinities between
them is a matter of personal taste.

It is provable without the continuum hypothesis that aleph-1 is the smallest
cardinal greater than aleph-0. The cardinality of the continuum might be
bigger than aleph-1, or, in absence of choice, incomparable with alpeh-1.

As to matter of taste, is it similarly a matter of taste whether there
exists an infinite set or not? After all, it is neither provable nor
refutable from the other axioms that there exists an infinite set.
 
C

Charles Richmond

CBFalconer said:
No, I think you've misremembered it. IIRC Aleph0 is a countable
infinity, i.e. each value can be put in 1 to 1 correspondence with
an integer. Aleph1 is not countable.

Hey, it's thinking about things like this that got
Cantor locked in the rubber room. ;-)
 
A

Army1987

Eric Sosman said:
Thus, whether Aleph1 is the smallest infinity greater
than Aleph0 or whether there exist other infinities between
them is a matter of personal taste.

With the definition usually used in English, aleph1 is *defined*
as the smallest infinity greater than aleph0, 2^(aleph0) is called
beth1 or c, and the continuum hypotesis is phrased as
beth1 = aleph1, or as c = aleph1.

(But I've seen Italian and Spanish texts using your definition.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,252
Latest member
MeredithPl

Latest Threads

Top