Hi, I'm pretty useless when it comes to math and I have a problem I need help with.
This has nothing to do with schoolwork, it's in fact about alcatel and the ticketextractor. I have two values that needs to be calculated in a c# application according to a formula specified in their documentation:
"The global callid is equal to: callid1...
Given two vectors X and Y, I have to find their correlation, i.e. their linear dependence/independence. Both vectors have equal dimension. The result should be a floating point number from [-1.0 .. 1.0].
Example:
X=[-1, 2, 0]
Y=[ 4, 2, -0.3]
Find y = cor(X,Y) such that y belongs to [-1.0 .. 1.0].
It should be a simple construct...
Hi, I'm trying to find the sum of the prime numbers < 2,000,000. This is my solution in java but I can't seem get the correct answer. Please give some input on what could be wrong and general advice on the code is appreciated.
Printing 'sum' gives: 1308111344, which is incorrect.
edit:
Thanks for all the help. Changed int to long and ...
My mac laptop has 1,024,000 pixels.
What's the simplest way to turn my display completely black and go nuts with writing little programs to twiddle pixels to my heart's delight?
To make it more concrete, say I wanted to implement the Chaos Game to draw a Sierpinski triangle, at the pixel level, with nothing else on the screen.
What are ...
This is a maths problem I am not exactly sure how to do. The vector is not aligned to an axis, so just rotating 90 degrees around x, y or z won't necessarily give me the other axes.
...
What I mean is like have to user input a string with multiple variables and get the value of those variable. Like a simple quadratic formula: x^2 + 5x + 10. Or in java: (Math.pow(x,2)) + (x * 5) + 10The user would then enter that and then the program would solve for x. I will be using the BeanShell Interpreter class to interpret the stri...
I would like to implement a frac function in C# (just like the one in hsl here http://msdn.microsoft.com/en-us/library/bb509603%28VS.85%29.aspx) but since it is for a very processor intensive application i would like the best version possible. I was using something like
public float Frac(float value)
{
return value - (float)Math.Tru...
how can i create method which return sqrt of given nunber? for example sqrt(16) returns 4
and sqrt(5) returns 2.3... please help i am using java and know Math.sqrt() API function but i need method itself
...
Hi all - this is (I think) a relatively simple math question but I've spent a day banging my head against it and have only the dents and no solution...
I'm coding in actionscript 3 - the functionality is:
large image loaded at runtime. The bitmapData is stored and a smaller version is created to display on the available screen area (...
Hello,
I have the following problem, I am trying to find the following distances (F1 and F2):
This is what I have as of now:
def FindArrow(self, X1, Y1, X2, Y2, X3, Y3):
self.X1 = float(X1)
self.Y1 = float(Y1)
self.X2 = float(X2)
self.Y2 = float(Y2)
self.X3 = float(X3)
self.Y3 = float(Y3)
#center coords of...
I'm writing a piece of client-side javascript code that takes a function and finds the derivative of it, however, the regex that's supposed to match with the power rule fails to work in the context of the javascript program, even though it sucessfully matches when it's used with an independent regex tester.
The code is extremely bare-bo...
i'm attempting to build a tiny (or perhaps not so tiny) formula that will contain numbers between a set min and max, but also loop these numbers so they are not clipped if they are outside of the range. so far, this is what i have.
min1 = 10
max1 = 90
val1 = 92
//will make 11, which is what i want since it loops
formula: min(max(min...
Hi, everybody.I am a senior student in CS.I have not much idea about what to do with my senior project.I think any idea will be very helpful to me.I'm very much interested in algorithms and the math behind them.Thanks for any project idea with this subject.
...
i have these 2 functions i got from some other code
def ROR(x, n):
mask = (2L**n) - 1
mask_bits = x & mask
return (x >> n) | (mask_bits << (32 - n))
def ROL(x, n):
return ROR(x, 32 - n)
and i wanted to use them in a program, where 16 bit rotations are required. however, there are also other functions that require 32 b...
hi all,
I'm curious how to do normalizing of numbers for a ranking algorithm
let's say I want to rank a link based on importance and I have two columns to work with
so a table would look like
url | comments | views
now I want to rank comments higher than views so I would first think to do comments*3 or something to weight it, howev...
How to create a function, which on every call generates a random integer number? This number must be most random as possible (according to uniform distribution). It is only allowed to use one static variable and at most 3 elementary steps, where each step consists of only one basic arithmetic operation of arity 1 or 2.
Example:
int myr...
I have a number of rectangular elements that I want to position in a 2D space. I calculate an ideal position for each element. Now my problem is that many elements overlap as very often the ideal positions are concentrated in one region. I want to avoid overlap as much as possible (doesn't have to be perfect, though). How can I do this?
...
I hope this is the proper location to ask this question which is the same as this one, but expressed as pure math instead of graphically (at least I hope I translated the problem to math correctly).
Considering:
two vectors that are orthogonal: Up (ux, uy, uz) and Look (lx, ly, lz)
a plane P which is perpendicular to Look (hence inclu...
Hi,
I'm using .NET 4's System.Numerics.BigInteger structure.
I need to calculate the square (x2) of very large numbers - millions of decimal digits.
If x is a BigInteger, What is the time complexity of:
x*x;
or
BigInteger.Pow(x,2);
?
How can multiply such big numbers in the fastest way using .NET 4 BigInteger? Is there an imple...
I am using the NPV() function in VB.NET to get NPV for a set of cash flows.
However, the result of NPV() is not consistent with my results performing the calculation manually (nor the Investopedia NPV calc... which matches my manual results)
My correct manual results and the NPV() results are close, within 5%.. but not the same...
Man...