mathematical

Interactive math proof system

I'm looking for a tool (GUI preferred but CLI would work) that allows me to input math expressions and then perform manipulations of them but restricts me to only mathematically valid operations. Also, the tool must be able to save a session and later prove that the given set of saved operations is valid. Note: I am Not looking for a sy...

Mapping two integers to one, in a unique and deterministic way

Imagine two positive integers A and B. I want to combine these two into a single integer C. There can be no other integers D and E which combine to C. So combining them with the addition operator doesn't work. Eg 30 + 10 = 40 = 40 + 0 = 39 + 1 Neither does concatination work. Eg "31" + "2" = 312 = "3" + "12" This combination operation...

Should code be short/concise?

When writing a mathematical proof, one goal is to continue compressing the proof. The proof gets more elegant but not necessarily more readable. Compression translates to better understanding, as you weed out unnecessary characters and verbosity. I often hear developers say you should make your code foot print as small as possible. Th...

Mathematical Equation Manipulation in python

Hi, Actually I want to develop a GUI app which displays a given mathematical equation. And when you click upon a particular variable in the equation to signify that it is the unknown variable ie., to be calculated. The equation transforms itself to evaluate the required unknown variable. for eg: a = (b+c*d)/e Let us suppose that ...

How to get rid of unnecessary parentheses in mathematical expression

Hi I was wondering if there is any known way to get rid of unnecessary parentheses in mathematical formula. The reason I am asking this question is that I have to minimize such formula length if((-if(([V].[6432])=0;0;(([V].[6432])-([V].[6445]))*(((([V].[6443]))/1000*([V].[6448]) +(([V].[6443]))*([V].[6449])+([V].[6450]))*(1-([V].[6446])...

Can we count Processing as Environment for Mathematical Modelling and Programming?

Can we count Processing as Environment for Mathematical Modelling and Programming? And If yes can we do the same for Eclipse (Java)? ...

solve mathematical equation with 1 unknown (equations are dynamically built)

Hi, I have to built dynamically equations like following: x + x/3 + (x/3)/4 + (x/3/4)/2 = 50 Now I would like to evaluate this equation and get x. The equation is built dynamically. x is the leaf node in a taxonomy, the other 3 nodes are the super concepts. The divisor represents the number of children of the child nodes. Is there a l...

Javascript points calculating system

I trying to create a points calculating system with javascript, but the problem is with the mathematical part. I have saved on the server the points number, and based on that number I want to decide the level. Sorry for my bad english, I cant explain very well :D. I want something like: level 1 need 0 points level 2 needs 100 points leve...

Detecting if an integer can be writen as a multiply of given integers

I have a set of given integers: A[] = { 2, 3, 4, 5, 6, 7, 8, 10, 15, 20, 25, 30, 40, 50, 100, 500 } I want to check if a given integer T can be written as a multiple of the numbers in A[]; EDIT CLARIFICATION: any number in A[] can be used.If used can be used only one time. EX 60 is a valid T.60=30*2. AlSO 90 is valid . 90=3*5*6 Check...

Algorithm for simplifying 3d surface?

I have a set of 3d points that approximate a surface. Each point, however, are subject to some error. Furthermore, the set of points contain a lot more points than is actually needed to represent the underlying surface. What I am looking for is an algorithm to create a new (much smaller) set of points representing a simplified, smoother...

Two Different Grammars Over One Set of Outputs

Hello everyone! Can you give me 2 different grammars which outputs the same set of words? Illustration: Given a grammar A and B over the alphabet {0,1}, if grammar A can produce the word 0101001, grammar B could as well. If grammar B can produce 0101111 then grammar A could as well. And if grammar A can't produce 01001 then B can neit...

Fast algorithm for line of sight calculation in an RTS game

I'm making a simple RTS game. I want it to run very fast because it should work with thousands of units and 8 players. Everything seems to work flawlessly but it seems the line of sight calculation is a bottleneck. It's simple: if an enemy unit is closer than any of my unit's LOS range it will be visible. Currently I use a quite naive ...

How to find original values back from the final result output of the sequential Xor procedures?

The problem is that I want to get the original values of B, or the original value of C or A. Here is the code: Dim strA As String = "A" Dim strB As String = "B" Dim strC As String = "C" Dim result As Byte = 0 ' Fetch the byte character code of strings and Xor them all into the result in a sequence. result = resu...

Generate series of 1,1,2,2,3,3,....

Hi all, I've an variable as page number (page) whose values increment by one each time. [Page numbering] But, now I need to customize this numbering to 1,1,2,2,3,3.. Can you suggest any formula for generate this kind of series? EDIT: (Answer) After playing with macros and VBA for some time I've figured out a way to generate this type...

Splitting a 3D model with respect to angle of cut

In 3D Max Studios, I recalled there is a function (I couldn't recall the name of the function, sorry) to cut a 3D model into two. For instance, you create a sphere, then you cut it in the middle, leaving 2 half spheres. Now, how about a human body? Imagine a samurai cutting up an enemy at the stomach, now that enemy's model will become 2...

Updating TOC with formula

Hi All, I've updated page numbers in my word document using a formula. Now page numbers have series like 1,1,2,2,3,3.. But, the numbers in TOC are still same as previous. I've tried updating them using "Update field" option available in MS Word 2007 & 2010. Can I use formula here also to change page numbers? if yes, how? Any help on t...

Selecting Randomly Lowest Weighted

There are plenty of SO questions on weighted random, but all of them rely on the the bias going to the highest number. I want to bias towards the lowest. My algorithm at the moment, is the randomly weighted with a bias towards the higher values. double weights[2] = {1,2}; double sum = 0; for (int i=0;i<2;i++) { sum += weights[i]; } d...

write an filter like photoshops's displace filter?

Hi, I want to write photoshop's displace filter in Java. Does anyone know where I can find some background information about this topic? ch ...