1/3 = 2/6

Pages: 123
Well, sure, go and do it right with the cross-product...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>

struct fraction
{
    double num;
    double denom;
    fraction(double n, double d):num(n),denom(d){}
    bool operator==(fraction fr){ return (num/denom)==(fr.num/fr.denom);}
};

int main()
{
    fraction fr(1.0, 3.0), fr2(2.0, 6.0);
    if(fr == fr2)
    std::cout << fr.num << "/" << fr.denom << " = " << fr2.num << "/" << fr2.denom;
    else
    std::cout << fr.num << "/" << fr.denom << " != " << fr2.num << "/" << fr2.denom;
    return 0;
}
@QWERTYman: Doesn't that defeat the point of a fraction class?
Pretty much, yes. However, if those weren't floats or doubles, that program wouldn't work properly.

-Albatross
Grey Wolf wrote:
Why dose 1/3 have to be anything to do with maths. Why is ‘is not the same as’ being equated to ‘is equal to’.


Because that's the only definition that has any meaning.

If you want to use the most literal sense of "is not the same as", then no two things are the same. Not even '1' and '1' are the same because they both exist in different places in memory and are therefore two distinctly different things. Even the post I'm writing is not the same as the one you're reading because the one I'm writing exists (or existed) on my computer, whereas the one you're reading exists on your computer.

But that's philosophical/hypertechnical malarchy.

For all practical purposes, all of those things are the same.

Albatross wrote:
Ugh....

1/3 != 0.33333...


Assuming those 3's extend to infinity, yes, 1/3 actually does equal 0.33333...

Your denial of basic, fundamental mathematics is concerning.
It's actually by the same logic that 1/3 isn't the same as 2/6. Mathematically, they are indeed the same. I shouldn't have used that != though.

So you're telling me that Grey Wolf is the only one who proposed that I didn't mean it in terms of computers or mathematics, and that he's the only one who recognized that there is a view in which the definition a) has a very important meaning and b) via those definitions, the two are not equal the same? Someone's thinking...

-Albatross

EDIT: 700 posts and counting.
Last edited on
So you're telling me that Grey Wolf is the only one who proposed that I didn't mean it in terms of computers or mathematics,


Put this in context. You're asking about it on a computer programming forum.

If I went to a Beatles fan club and announced to the room that "Mr. McCartney is gay", everyone would think I was talking about Paul McCartney, and they'd object because he isn't gay.

But if I was talking about my personal friend Jeff McCartney who really is gay -- then yeah technically I was right, but I didn't really prove any point by pulling that stunt. =P

and that he's the only one who recognized that there is a view in which the definition a) has a very important meaning


In most views, it does not have any important meaning. In most views, 1/3 and 2/6 are exactly the same.

Hypertechnically, and in certain very specific views, they need to be treated differently, but you did not present your original point in one of those views, therefore we all made the obvious/safer assumption.

Food for thought: http://xkcd.com/169/

b) via those definitions, the two are not equal?


You're doing it again. They ARE equal. They're just not "the same" according to the definition you seem to be using.
Last edited on
Saying equal saves me typing, and up until a few minutes ago I was pressed for time. It's incorrect, but...

I know. I know I'm asking about this in a computer programming forum. This was actually a survey to see how many could and would see things from outside the common (locally) perspective. It was a puzzle, in a sense. Current total of those surveyed (including self): 2. Maybe 3.

Nice comic. It's inapplicable here, because I'm not acting smug. No, I'm actually quite disappointed. I've have thought that more than one person would realize that I was poking at something. In that puzzle in the comic as well, because there are over 100 solutions to that problem that are now obsolete.

Here's the view from a simplistic untuned common human intuition, which was the view from which these two were not equal. The limitations on this piece of circuitry that I am exploiting are: bias depending on the numerator and the difficulty of grasping infinity. If you tell someone that one in three people get a prize on a game show, then wonderful. If you tell them two in six, four in twelve, three-hundred in nine-hundred people, it will sound better. Yet, those are all mathematically equal to 1/3. Given two side by side, the spell is broken, however. Unfortunately, I wasn't about to construct a more realistic puzzle.

For 1/3 not being the same as 0.(infinite number of 3s), said human intuition often fails to compute infinite properly. It seems like it's just a tiny bit off. It's even more true for 1 = 0.(infinite number of 9s).

Whenever I personally see a contradiction, I first evaluate if in my default views it's a contradiction, and second if there is a view in which it would not be contradictory. How many of you did that?

Also, think carefully. I didn't want to raise my self esteem in any way, and I say that from the bottom of my amygdala. Why would I put this statement on this forum?

-Albatross




Last edited on
This was actually a survey to see how many could and would see things from outside the common (locally) perspective. It was a puzzle, in a sense. Current total of those surveyed (including self): 2. Maybe 3.


In that case, I see it as a positive thing that most people have "failed". It's far better to grasp the common perspective than to lose sight of the common perspective to grasp the esoteric and trivial.

In 99.9% of real world scenarios (and not trick forum posts), most people here would have made the right conclusion.

It's inapplicable here, because I'm not acting smug. No, I'm actually quite disappointed.


That's just as bad (or worse).

For 1/3 not being the same as 0.(infinite number of 3s), it seems off when that said human intuition often fails to compute infinite properly.


Human intuition also often fails to see 1/3 and 2/6 as two different things. Which side of this argument are you on?
Oops. Mistype @that last one.

I have to say that I'm not full sure which is better. It depends mostly on the context. I also said it would have been tricky to create a realistic scenario that I didn't have the time for.

High expectations are bad? WHAT?

-Albatross
Last edited on
closed account (z05DSL3A)
Disch wrote:
Put this in context. You're asking about it on a computer programming forum.


It is posted in a forum hows topic is:
Discussions about this website, or other topics not related to programming

Sorry, cheap shot but I couldn't resist.

But this is getting silly, the fact that it is written in a natural language with few terms of reference means that it is ambiguous and the reader will but there own interpretation to it.

http://xkcd.com/169/
Hey, I guessed!

via those definitions, the two are not equal?
1/3 and 2/6 describe the same point on the real line. You're just making the statement "1/3 and 2/6 are not equal" equivalent to the statement "1.0/3.0 and 2.0/6.0 don't evaluate to the same number" without being explicit about it. The two statements are in fact completely different. The most obvious problems being:
1. The rational number 1/3 cannot be represented in binary in finite space, so 1/3 == 2/6 != 1.0/3.0 != 2.0/6.0.
2. Since you never said what '1', '3, '2', '6', and '/' mean (apparently, to you they are double values and floating point division, and not real numbers and mathematical division), they could literally mean anything. It's easy to say 2+2=5 when you don't give the semantics that make that relationship supposedly true.
Last edited on
@ Albatross:

Wanna lighten up? Write an exact implementation of rational numbers with

1) dynamic memory allocation (i.e. no limits a priori on the size of the rationals).

2) Nice printouts in string format

3) Compute and print out on the screen in decimal 1/(2010!) , 1/(2011!), 1/(2009!).

4) Check that 1/(2010)! - 1/(2011!) = 1/(2009!)* 1/2011.


Such an exercise will surely lighten you up! Then next time you get into an argument with picky programmers, you can always pull out some math trick you learned in the implementation and impress 'em ;)

Last edited on
Grey Wolf wrote:
But this is getting silly, the fact that it is written in a natural language with few terms of reference means that it is ambiguous and the reader will but there own interpretation to it.


Agreed. That's kind of my point.

I wouldn't call any of our answers "wrong". It's more that we misunderstood the problem because it was unclear.

Albatross wrote:
High expectations are bad? WHAT?


It's not so much that you had high expectations, it's more that you had obscure expectations.

You expected people to respond in a way which most people wouldn't respond. Their response wasn't "wrong", your problem was just unclear.

The fact that you were disappointed implies that you think our response was "wrong", which is somewhat demeaning. It wasn't wrong in the context of the original post, or at least in the context we perceived in the original post.


Basically what I'm saying is... if we were wrong it's because the question was phrased/communicated poorly. Not because we're incapable of grasping the concept.

It's the job of the person communicating to illustrate their ideas clearly. It isn't our shortcoming for misunderstanding you... it's your shortcoming for being unclear. So instead of being disappointed in our response, maybe you should be disappointed in your original phrasing of the question.


EDIT: This is the essense of that xkcd comic I linked to, so it was more on point than you think. ;P. But that's probably my fault for not illustrating clearly enough exactly what I meant by linking to that comic - so I'm not the least bit disappointed that you didn't make the conneciton right away.
Last edited on
I did not think my expectations were unreasonable. You appear to be a fairly intelligent group. There was no wrong answer, really (if I said there was only one right answer, then point it out and I'll add an edit, because it was a critical error for which I apologize), but I expected that someone would realize that the mathematical answer was not the answer I was expecting, or at least not the whole answer. It's a mathematical contradiction in a C++ forum without any explanation; there has to be something up with that.

Frankly, I have VERY high expectations that I myself often don't meet. I try to, though, and I don't consider them unreasonable, because eventually I DO meet them. It takes sweat, but I manage.

And how was the question unclear? I asked what you thought. I thought the question was clear and to the point, I just was surprised that so many told me what they thought and that response contained only one point of view which was the mathematical.

-Albatross
Last edited on
Say you've got 2 separate piles of sand...

If you take one of the piles, and put it on top of the other pile, what do you end up with?

Answer: 1 pile of sand.

That's what i think :)
I would agree with you, but only because of gravity.
closed account (z05DSL3A)
but that is saying that 1+1=1 and that 1 < 1. ;0)
Well, if you have an x and another x and you add them together, you get 2x or two xs. But a pile of sand is a group of objects. A "sand" + a "sand" would be 2(sand) but a "pile of sand" + a "pile of sand" would be... uhh... I don't know.

I'm inclined to think that the piles would intersperse into one pile.

:S
Last edited on
Pages: 123