FUN Mathematics Algorithms!

This forum is for actual topics of discussion that do not fit the above categories.
Locked
danielwang
Village Idiot
Joined: Fri May 03, 2002 12:17 am
Location: Denver, CO Banned: Several times!
Contact:
Org Profile

FUN Mathematics Algorithms!

Post by danielwang » Mon Nov 17, 2003 10:48 pm

Path sums

In the tree below, the objective is to find the path, left-to-right, which yields the highest sum.

Image

The solution sieve, expanded, not optimized or simplified:

Take the largest number in each final choice of nodes, last column
1 4 2 1 2 1 4 2 -> (1/4) 4 (2/1) 2 (2/1) 2 (4/2) 4 -> 4 2 2 4
Add to the parent node value to simplify to largest possible branch value
4 2 2 4 -> 4+1 2+4 2+2 4+5 -> 5 6 4 9
Reduce the row again by eliminating the small node in each branch
5 6 4 9 -> (5/6) 6 (4/9) 9 -> 6 9
Repeating these steps, right to left, we continue:
6 9 -> 6+3 9+1 -> 9 10
To conclude at the largest possible path sum:
9 10 -> (9/10) -> 10

The path is 1 -> 5 -> 4; 1+5+4=10

Image

Tree sums

I was reversing the sieve for finding the lowest summing path (quite simple, just choose the lowest number instead of the highest), when I discovered this could also be applied to path products!

Simply multiply the highest numbers instead of adding, working your way right to left as usual. In this case, the solution is:
3 -> 4 -> 2 (left to right) ; 3*4*2=24

The next step?
This also works for exponents, as well, although you'll be dealing with some very large numbers. Seemed too simple, though. There must be something more challenging, like finding a formula for the instantaneous frequency of f(x)=sin(x^2), cryptography, patterns in prime numbers (impossible), or even more impossible, installing Linux on a GameCube (PowerPC = BAD processor, maybe M*c OS X?)

That was COOL.
Very fun. I wish to work for Clay Mathematics Instutute when I grad!
<a href="http://www.animetheory.com/" title="AnimeTheory" class="gensmall">AnimeTheory.</a>
<a href="http://www.animemusicvideos.org/search/ ... %20park%22" title="Seach videos NOT by danielwang" class="gen">Make sure you don't download videos that suck!</a>

User avatar
angelx03
Joined: Tue Jan 21, 2003 7:13 pm
Location: In school, Rochester NY mainly RIT; in home, Tampa, FL
Org Profile

Post by angelx03 » Mon Nov 17, 2003 10:54 pm

WHAT THE HELL! Didn't you show this at that racist thread of yours? :evil:
ImageImage
Image

danielwang
Village Idiot
Joined: Fri May 03, 2002 12:17 am
Location: Denver, CO Banned: Several times!
Contact:
Org Profile

Post by danielwang » Mon Nov 17, 2003 11:02 pm

angelx03 wrote:WHAT THE HELL! Didn't you show this at that racist thread of yours? :evil:
Of course!

But it can be used not only for tree node sum problems, but also for products, exponents and factorial node problems. It is a very simple, easily concieved and obvious principle, but I dare you to create a sieve that is more optimised than this.

Other than by compacting the steps in this, of course.

It's the best thing since I realized that a number, n, expressed to base b is evenly divisible by b if the value at the end of 0.

And even better than my impractical idea of interpreting a video stream as a solid and compressing it in a parametric vector format, allowing for frame interpolation and infinite scalaility.

I just love this stuff!
<a href="http://www.animetheory.com/" title="AnimeTheory" class="gensmall">AnimeTheory.</a>
<a href="http://www.animemusicvideos.org/search/ ... %20park%22" title="Seach videos NOT by danielwang" class="gen">Make sure you don't download videos that suck!</a>

User avatar
downwithpants
BIG PICTURE person
Joined: Tue Dec 03, 2002 1:28 am
Status: out of service
Location: storrs, ct
Org Profile

Post by downwithpants » Tue Nov 18, 2003 4:46 am

well, as long as youre having fun..
maskandlayer()|My Guide to WMM 2.x
a-m-v.org Last.fm|<a href="http://www.frappr.com/animemusicvideosdotorg">Animemusicvideos.org Frappr</a>|<a href="http://tinyurl.com/2lryta"> Editors and fans against the misattribution of AMVs</a>

User avatar
Savia
Chocolate teapot
Joined: Wed Apr 02, 2003 3:40 pm
Location: Reading, UK
Org Profile

Post by Savia » Tue Nov 18, 2003 7:36 am

Daniel, the shortest path algorithm can't be applied to longest path problems- it yields incorrect results a lot of the time, usually when it stops solving before considering a deviating path with a higher weight. A better solution is to replace all weightings on paths with the reciprocal and then apply the shortest path algorithm to find the route you want.
"A creator needs only one enthusiast to justify him." - Man Ray
"Restrictions breed creativity." - Mark Rosewater

A Freudian slip is where you say one thing, but mean your mother.

User avatar
J-0080
Joined: Thu May 01, 2003 7:37 pm
Location: Mid-West Side Laying On: Fangirls
Org Profile

Post by J-0080 » Tue Nov 18, 2003 7:45 am

*slams head into desk*

Are you trying to just make up for lost time Daniel. :?

*slams head into desk*
paizuri wrote:There's also no need for introductions because we're generally a friendly bunch and will welcome you with wide open arms anyway.

User avatar
BogoSort
Joined: Wed Mar 14, 2001 12:10 pm
Location: Right behind you with a knife!
Contact:
Org Profile

Post by BogoSort » Tue Nov 18, 2003 9:27 am

Ok, since you're obviously a brilliant mathematician danielwang, here's a problem for you to solve. I know a bit about CMI, and I'm sure that if you're capable of solving this on your own, they'd definately want you there. So here's the problem:

Can you find a polynomial time algorithm that determines if a given boolean formula in CNF(conjunctive normal form, aka products of sums) is satisifiable(aka made true)?

For example:
(x+y)(~x+y) is satisfiable since it's true when y=1
(x+y)(~x)(~y) isn't satisifiable since it can never be made true.

Solving this problem would be a very good demonstration for the intellect that you enjoy showing off to the world.

User avatar
Inept_Jedi
Joined: Tue Nov 04, 2003 2:17 pm
Location: Manhattan, Kansas..the armpit of the US
Org Profile

Post by Inept_Jedi » Tue Nov 18, 2003 10:49 pm

Holy crap..that reminds me of some of the problems we used to do in Quantitative Management class. PERT, CPM and shortest path..blech..bad nightmares about that junk.

*shudders*

danielwang
Village Idiot
Joined: Fri May 03, 2002 12:17 am
Location: Denver, CO Banned: Several times!
Contact:
Org Profile

Post by danielwang » Tue Nov 18, 2003 11:03 pm

BogoSort wrote:Ok, since you're obviously a brilliant mathematician danielwang, here's a problem for you to solve. I know a bit about CMI, and I'm sure that if you're capable of solving this on your own, they'd definately want you there. So here's the problem:

Can you find a polynomial time algorithm that determines if a given boolean formula in CNF(conjunctive normal form, aka products of sums) is satisifiable(aka made true)?

For example:
(x+y)(~x+y) is satisfiable since it's true when y=1
(x+y)(~x)(~y) isn't satisifiable since it can never be made true.

Solving this problem would be a very good demonstration for the intellect that you enjoy showing off to the world.
I apologize, I didn't intend to gloat. I was just enjoying myself, no doubt.

The problem you've given is likely out of my reach. The only things I know about boolean and CNF is that it's logical transforms, supposed to be denoted by spiky things V and ^ right?
Will try, though, looks like a great way to spend the weekend.

About that CMI mention. NOT LIKELY!
37 years and declare a major, and 1000000000$s of tuition
then graduate, until I get a rat's chance in hell of tenure.
Now where can I get those 100000000000$s?
<a href="http://www.animetheory.com/" title="AnimeTheory" class="gensmall">AnimeTheory.</a>
<a href="http://www.animemusicvideos.org/search/ ... %20park%22" title="Seach videos NOT by danielwang" class="gen">Make sure you don't download videos that suck!</a>

danielwang
Village Idiot
Joined: Fri May 03, 2002 12:17 am
Location: Denver, CO Banned: Several times!
Contact:
Org Profile

Post by danielwang » Tue Nov 18, 2003 11:10 pm

Savia wrote:Daniel, the shortest path algorithm can't be applied to longest path problems- it yields incorrect results a lot of the time, usually when it stops solving before considering a deviating path with a higher weight. A better solution is to replace all weightings on paths with the reciprocal and then apply the shortest path algorithm to find the route you want.
That;s even worse!

Now you're saying, use that darn sieve to find the shortest path, except instead of nodes, I make the biggest numbers the shortest paths? And naturally the shortest path will then be the biggest sum of numbers.

NOW I know WHY "The Professor In The Upper Sanctums of Level 5, Science Building" has that 50-pack of chalk and dry erase markers.
- There goes my aspirations about doing math research.

Ah well. Liberal arts could be worse.
<a href="http://www.animetheory.com/" title="AnimeTheory" class="gensmall">AnimeTheory.</a>
<a href="http://www.animemusicvideos.org/search/ ... %20park%22" title="Seach videos NOT by danielwang" class="gen">Make sure you don't download videos that suck!</a>

Locked

Return to “General Off Topic”