flat assembler
Message board for the users of flat assembler.

Index > Heap > Simple math problem/question

Goto page Previous  1, 2, 3  Next
Author
Thread Post new topic Reply to topic
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
Actually.. let's take this example bit more deeper.
6:2(2+1)
6:2*3
3*3=9
Actually, first should be division because it's first action and second is multiplication..
let's try something like this:
   6
------- and sum is 1.
2(2+1)

and second one:
6
-- * (2+1) here sum is 9.
2
I think this example is similar like second one. Because, 6 is divided to 2 first and then multiplied by (2+1)=3. These nails makes people to think deeper but it's equal to 6:2*3 which equals to 9. Maybe this is math mistake ? Very Happy I'm really stuck.. Is this theory true ?.. Let me know what you think.
Post 17 May 2011, 11:58
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
I am wandering how you can write 2 pages of comments on problem, that even does not exists??? Very Happy
The solution is simple and even my 4 class daughter can solve it.

0. In the algebra the multiplication sign is '.' and it is commonly omitted. In arithmetic some countries uses "x". In programming it is "*" because of better readability. But the operation is one. There is no different multiplications for the different signs.

1. The brackets have highest priority, so it is safe to solve them in order to make the problem simpler.
The equivalent expression is: 6/2*3

2. The priority of multiplication and division are the same.
(if you think different, you are using different mathematics from the commonly accepted and it is normal to get different results)
In the case when two operations have the same priority, the operations must be processed from left to write.

So, 6/2*3 = 9 and every other result (as I already said) is legal, but in some different mathematics.

Now, go write some assembly, instead of wasting your time. Laughing
Post 17 May 2011, 12:23
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Enko



Joined: 03 Apr 2007
Posts: 678
Location: Mar del Plata
Enko
JohnFound wrote:
I am wandering how you can write 2 pages of comments on problem, that even does not exists??? Very Happy
The solution is simple and even my 4 class daughter can solve it.

0. In the algebra the multiplication sign is '.' and it is commonly omitted. In arithmetic some countries uses "x". In programming it is "*" because of better readability. But the operation is one. There is no different multiplications for the different signs.

1. The brackets have highest priority, so it is safe to solve them in order to make the problem simpler.
The equivalent expression is: 6/2*3

2. The priority of multiplication and division are the same.
(if you think different, you are using different mathematics from the commonly accepted and it is normal to get different results)
In the case when two operations have the same priority, the operations must be processed from left to write.

So, 6/2*3 = 9 and every other result (as I already said) is legal, but in some different mathematics.

Now, go write some assembly, instead of wasting your time. Laughing


As I remember, the division sign is ":" and not /
you can write:
6
- or 6:2
2

on paper, normally you wouldnt write 6/2

so, the problem here is really stupid. Becouse we all know how to resolve it, but what we coudn-t know, it what it means on the calculator.

it could be
6
----------
2(2+1)

or

6
-(2+1)
2


Becouse depending on the model of the calc, they interpret diferently the "implied multiplication", this way, in some of them, you dont need to write extra brackets.
Post 17 May 2011, 13:19
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
Enko wrote:
As I remember, the division sign is ":" and not /.
For English speaking countries, "/" is by far the most common symbol for division. Wikipedia says that ":" is used in some non-English speaking countries, so that's were the confusion arises from.
Post 19 May 2011, 01:36
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
@Tyler ÷ and / Very Happy
Post 19 May 2011, 01:48
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
typedef wrote:
@Tyler ÷ and / Very Happy
Who uses ÷ after 4th grade? Razz I don't know know about you, but I was actually discouraged from using it after we learned fractions. I can guess why: it's an inefficient symbol and easily confused with + when you're sloppy (as most mathematicians are).
Post 19 May 2011, 01:53
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
well... your 4th grade and mine were different... Very Happy (I bet you are older than me)
Post 19 May 2011, 02:47
View user's profile Send private message Reply with quote
neville



Joined: 13 Jul 2008
Posts: 507
Location: New Zealand
neville
Enko wrote:
Becouse depending on the model of the calc, they interpret diferently the "implied multiplication", this way, in some of them, you dont need to write extra brackets.
There should be no different interpretation of any multiplication, whether implied or explicit.
If you enter 6/2(2+1) into ANY calculator and it produces a result which is not 9, then it is just WRONG! And it should be given a firmware upgrade to fix the bug Evil or Very Mad

_________________
FAMOS - the first memory operating system
Post 19 May 2011, 06:31
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
typedef wrote:
well... your 4th grade and mine were different... Very Happy (I bet you are older than me)
17
Post 19 May 2011, 19:54
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
Tyler wrote:
typedef wrote:
well... your 4th grade and mine were different... Very Happy (I bet you are older than me)
17


19
OK. I'm older than you then.... Very Happy Very Happy

Two years difference.. I see why...

PS: So you are still in high school right?
Post 20 May 2011, 01:39
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
I didn't see this until now, so I'm going to respond to it anyway.

typedef wrote:
What happened to PEMDAS ?
I see ppl going crazy ?

Can you all do this :

Given F: 2, X: 2
-----------------------------------------------------------
Simplify: F( POW(2,X) + SQRT(100) + XF )
You really wanna play that game? Simplify d^2/dx^2(gamma(x^2)). Razz

Or, assuming proof questions are okay: Prove x^2-x is even for all odd x. Let a number be defined as "odd" if and only if it can be written in the form 2k+1, where k is an integer.
Post 20 May 2011, 14:55
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
Tyler wrote:
Prove x^2-x is even for all odd x.


IMHO, x^2-x is even for every integer x, not only for the odd numbers.
Post 20 May 2011, 16:48
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
did you know?......odd numbers are odd?......:Cool
Post 20 May 2011, 17:12
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
JohnFound wrote:
Tyler wrote:
Prove x^2-x is even for all odd x.


IMHO, x^2-x is even for every integer x, not only for the odd numbers.
It is, but if you can prove it's even for one parity, it's trivial to prove it for the other. Proving it for the other is just a waste of time, so I left it out.
Post 20 May 2011, 17:14
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
(x^2)-x = [(2k+1)^2] - (2k+1)
= (2k+1)(2k+1) - (2k+1)
= 2k(2k+1) + (2k+1) - (2k+1)
= 4k^2 + 2k
= 2(2k^2 + k)

Since whatever the k number is the number will always be multiple of two, then the expression will invariably resolve to an even number for any k belonging to the integer set.

I hope my participation here wasn't unwanted Razz (hey, you can still prove this by induction!)
Post 20 May 2011, 17:32
View user's profile Send private message Reply with quote
gabiz_ro



Joined: 20 Feb 2010
Posts: 67
gabiz_ro
Like someone says:
The brackets have highest priority, so it is safe to solve them in order to make the problem simpler.
But also who is tied to brackets: (hope you understand)
6:2(2+1)=6:2(3)=6:6 (because of brackets) =1 final answer
Post 20 May 2011, 17:36
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
first time seeing a colon as a division sign...lol
Post 20 May 2011, 17:46
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
x^2 - x = x(x - 1)

If x ∈ Z is even, i.e. x = 2m for some m ∈ Z then

x(x - 1) = 2m(2m - 1)

and the whole product is divisible by 2, i.e. even, what we denote 2|x(x - 1).

If x ∈ Z is odd, then x = 2m + 1 for some m ∈ Z and

x(x - 1) = (2m + 1)(2m + 1 - 1) = (2m + 1)2m

Again, we have 2|x(x - 1).

Hence 2|x(x - 1) for every x ∈ Z, i.e. x(x - 1) is even for every x ∈ Z.

P.S. By Z we denote set of the integer numbers.
Post 20 May 2011, 18:37
View user's profile Send private message Visit poster's website Reply with quote
Enko



Joined: 03 Apr 2007
Posts: 678
Location: Mar del Plata
Enko
typedef wrote:
first time seeing a colon as a division sign...lol


It´s used in many non-Anglophone countries.

Becouse: ÷ is much easier simplified as : and note /



But this is only valid in primary school... in high school, the only one used is ------- representing the division as fraction.
Post 20 May 2011, 19:43
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
Enko wrote:
But this is only valid in primary school... in high school, the only one used is ------- representing the division as fraction.


And "/" sign is "single line version" of "-----", for use in simple, one line expressions.
Post 20 May 2011, 20:20
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.