[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 4 KB, 308x142, dasdf.png [View same] [iqdb] [saucenao] [google]
5470615 No.5470615 [Reply] [Original]

So im doing some programming and i would love if i could turn a/(b-c) into something without parenthesis.

For example i can turn (a-b)/c into a/c-b/c. And a*(b-c) into a*b+a*-c.

But is there a way to "remove" the parenthesis when the denominator is a parenthesisgroup with more than 1 different variables inside?

>> No.5470631

>>5470615
not always.

>> No.5470634

>>5470615
generically or for certain contexts? It's not always possible (obviously), but there's broad classes of fractions that fall to certain decomposition methods.

>> No.5470639

>>5470634
That's what i thought, if its not always then i can't use it anyway, thanks!

>> No.5470644

>So im doing some programming and i would love if i could turn a/(b-c) into something without parenthesis.
Why.

>> No.5470645

>>5470639
What are you doing this for?

>> No.5470649

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

>> No.5470656

>>5470645
It's more of a complex overall project, but this certain part would be to parse a string with parenthesis into a string without so my next parser could "read it". Finding out this information i will just be turning to different slightly more complex measures.

>> No.5470661

>>5470649
wikipedia is one of the shittiest sites when it comes to explaining how mathematic functions works.

>> No.5470670

33/(21-53)=33/-32
What context is there when this simplest form would not be the best one to use?

>> No.5470673

>>5470661
Sometimes.

There is one of those fucking supergeniuses that comes by my physics department sometimes to do a mentorship with the head of our department. He's this 13 yearold kid that's currently learning general relativity after he gets out of his regular school, I talked to him about it once and apparently he learned most of what he knows about tensor calculus and diffgeo from wikipedia.

That said, he's already so much of a giant outlier that none of his actions can be used as a realistic metric for the rest of us.

>> No.5470676

>>5470670
please stop posting.

>> No.5470680

>>5470670
you're a goddamn genius, the NSA needs your skills! Leave this board and go send them your thesis right now!

>> No.5470685

>>5470670
I think you should have read what i wrote in the OP. It explained it abit further. What do you do when its a/(b-c)? I already got my answer though.

>> No.5470694

>>5470673
I've learned alot of science mathematics and 80% of my programming from the internet, wikipedia has not helped me more than 5% of those times.

>> No.5470703

>>5470694

You'll notice
>That said, he's already so much of a giant outlier that none of his actions can be used as a realistic metric for the rest of us.

>> No.5470710

>>5470706
1/10, terrible. Unfortunately this board is so full of highschoolers these days I'm sure some smug asshole will fall for it.

>> No.5470706

33/21-53

BOY THAT WAS TOUGH

>> No.5470709

>>5470703
English isn't my main language so outlier was abit alien to me, googled and it made more sense.

>> No.5470713

>>5470709
Ah, that makes sense then. Carry on.

>> No.5470718

33 21 53 - /

>> No.5470717

>>5470710

Anybody have that "jokes exist not everyone is out to troll you" image handy?

>> No.5470721

things in the denominator don't need an overarching parentheses

>> No.5470726

OP. taking a reciprocal is not a linear function, so no, it can't be done

>> No.5470723

>>5470718
This is the correct answer

/thread

>> No.5470725

>>5470721
Care to elaborate?

>> No.5470728

>>5470718
+1

But what's your objection to parentheses OP? They're like little hugs! When I see (/ 33 (- 21 53)) I get a little hard.

>> No.5470731

>>5470725
what needs elaborating about my post?

>> No.5470733

>>5470717
If you were joking then your joke was awful. I don't think he was wrong to assume you were trying to provoke a response

>> No.5470735

>>5470718
>>5470615

This is the answer OP

http://en.wikipedia.org/wiki/Tree_traversal#Post-order

>> No.5470743

make 21-53 an integar. then next line 33/integer

profit!?!

>> No.5470745

Assuming this doesn't have to be done in one line:

a = 21/33 - 53/33;
x = 1/a;

No parentheses used, x is your desired value.

>> No.5470751

>>5470745
or
a = 21 - 53
x = 33 / a

>> No.5470754

>>5470735
No... No it is not.

>> No.5470761

>>5470731
I dont know, an example and explaining why it isnt needed? Can you write a/(b-c) in any way without parenthesis while still being equal to that equation?

>> No.5470764
File: 27 KB, 276x260, 1255216519226.png [View same] [iqdb] [saucenao] [google]
5470764

21 53 - 33 /

>> No.5470768

>>5470764

33 21 53 - /

did it backwards

>> No.5470779

>>5470761
a/(b-c)
x=b-c
y=a
line one declare x

OMFG NO PARENTHESIS
line two declare y
line three y/x

>> No.5470813

>>5470615
No, because then you will have an open parenthesis for no fucking raisin hanging out in your equation.

>> No.5471005

consider / , - etc. as functions from Z2 to Z, ie write
+ab for a+b
/+ab-cd for (+ab) / (-cd) = (a+b)/(c-d)
then you can write
/33,-21,53 for 33/(21-53)