I need some help. I am having a hard time find the recurrence when given an algorithm in c++. The algorithm is a Max search: Its where the program goes through the array from first element to last, or last to first (depends on how you program it) to look for the largest value. In this case it...
This is my project of Spanning Tree by using Prim's Algorithm , I have to implies this problem (#4, PIC is attached) into Mathematica ( I have version 6 btw). Which we never learned in class. Its my Applied Math class, all we do/did is theorems. We never learned a single thing about this program...
Hi,
Can anyone tell me an algorithm to generate the stationary Gaussian distribution R(t) with
\langle R(t) \rangle = 0 (zero mean)
\langle R(t) R(t')^{T} \rangle = A \delta(t-t') , A = 2 \gamma k_B T m (autocorrelation)
?
What I just wrote is from the Wikipedia article "Langevin...
That is to say, how does one go about it for a non-separable partial differential equation?
Let me preface by saying that I am not asking for an answer of perturbation theory, variational theory, mean-field theory, or some sort of self-consistent guess-and-check method (i.e., coupled...
Hello there, I'm developing a 4x Space Opera game. For my galaxy generation algorithm I'm using an improved version of the "Accrete" one, which I'm sure some of you may have heard.
It generates fairly believable planets. Rocky ones are placed in the inner system, while gas giants in the outer...
I've written a program in c language in terms of the GR SVD algorithm. To my dispointment,its performance is worse than the svd of matlab. I wish to get to know which algorithm the MATLAB used. Who may tell me? Thanks.
So I implemented a tridiagonalization algorithm, however I don't know if the result that I am receiving is accurate. Does anyone know of an easy way of testing this? I suppose it is possible to scour around for code, but it would be difficult to find matching code. So if anyone knows anything...
If you run Grover's algorithm on the first qubit of any of the Bell states, does it destroy the entanglement? If not, wouldn't it be a way to communicate faster than light?
Well I understand what is happening - the tortoise moving 1 step, and the hare moving 2 steps and finally coinciding at a point. But I want a mathematical proof of this - ie; when you have 2 counters moving in a cycle, one going 1 step, the other 2 steps, then they finally meet at a point.
Hello Everyone,
This is my fisrt post! I have been suggested that this forum's members may be able to help me, this thread was orginially posted in another forum, they have re-directed me towards this community! :
{original post}
Hi guys,
I've been doing some background hobby...
I wrote a program to find the number of digits of an integer, but I always get the wrong result. Could someone point out the error? Here's the source code:
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int i=53443;
cout<<log(i);
return 0;
}...
I've got a small assignment to do on graphs but it's a bit frustrating that no standard algoritms such as Dijkstra, Bellman-Ford, etc. can be used or at least I don't know how could they help.
Given a graph one is to find shortest path through N points. That's it. Starting point can be...
I'm trying to figure out this little problem. I'm trying to figure out which algorithm is being used.I know the set of numbers is being used to generate the 5 digit number. I believe a Pseudo random number generator algorithm is being used. I know the set of number are being used as the seed...
Hi
I am currently studying Information Theory. Could I please have anyone's ideas on the following question:
Using the Euclidean algorithm, show that coprime numbers always have multiplicative inverses modulo each other.
I tried the following proof, using Fermat's little theorem, let me...
Let's say I have some algorithm with complexity O(n^k) for some constant k. and let's say it runs in some time T. Now, I want to implement a divide and conquer approach for this algorithm, by dividing the problem in half each recursion. So basically, the first time i run my algorithm it will run...
For a system with minimum cut set (C1,C2,C3),(C4,C5,C6) and (C4,C5,C7), Using the F-V algorithm, calculate the first and second order approximations given P[C1] =P[C1] =
P[C2] =0.107, P[C3] =0.168,P[C4] =P[C5] =0.0478,P[C6] =0.0921,P[C7] =0.102
Answers, Ist order= 0.002366919, 2nd...
Hi I have a question, I have to save to file the matrixs generated by an algoritm in Matlab. So i was wondering if is it possibile and how, to use in the filename a variable of the algoritm.
Let's say "i" is the counter of my cicle and i would like to save the matrix generated at every cicle...
How might I prove a Division Algorithm for the Real numbers?
That is to say, if x, \alpha \in \mathbb{R}, then x=k \alpha + \delta for some k \in \mathbb{Z}, \delta \in \mathbb{R} with 0 \leq \delta < \alpha where k, \delta are unique.
I am posting an integer factorization algorithm that I have developed. I am hoping for feedback on any obvious flaws that I might have missed before writing a computer programme to test it out.
Thanks in advance
Visu
can someone recommend a good algorithm design book? like the end all be all of algo design? so that i don't have to read anything else cause I'm not a cs major just someone who wants to be decent at programming
Hi
I am reading Hoare's original paper where he derives the complexity of quicksort. I am trying to figure how he derives the expectation for the number of exchanges (sorry if this is a very CS-specific question):
\frac{(N-r-1)(r-1)}{N}
\frac{N}{6}+\frac{5}{6N}
I can't see...
Hi
The purpose of this question is to find the shortest path from nodes c to f.
I have attached the question using the below headings:
Homework Statement
An image showing a graph can be seen in the attachment
Homework Equations
The Attempt at a Solution
A table can be...
how can i solve this problem?
[ x1= a (mod 100) , a= 20 (mod 37) ]
[ x2= b (mod 100) , b= 15 (mod 37) ]
[ x3= c (mod 100) , c= 18 (mod 37) ]
must be ; x2= a.k + y (mod100)
and
x3= b.k + y (mod100)
i need find b and c.. thank you best regards..
Homework Statement
I am going to use the velocity verlet algorithm to simulate the position, velocity and acceleration at time t of some particle.
Homework Equations
We got the Langevin equation: a(t) = -v(t)/tau - U'(x) / m + F_f(t) / m
Where tau is the mass divided by the friction...
Hi all, i understand the following however i don't know how to put this on matlab.
any help or hints will be very appreciated.
The following algorithm enables us to identify the prime number up to a given integer N, by eliminating all non-primes in that interval. It starts from a lower end...
I am an undergraduate student studying mechanical engineering. We are doing a project called the labyrinth cutter, we're constructing a piece of artwork consisting of a a gantry connected to a cutter head. The cutter is supposed to cut out a labyrinth to a piece of music.
I decided to use the...
Has anyone here taken this class before? I've been in this class for two weeks, and I still can't get a feel for how difficult or time consuming it may be. My instructor keeps mentioning discrete mathematics (which I haven't taken), although it wasn't a prerequisite for the course. Additionally...
okay new problem here. I am doing a Monte Carlo simulation to estimate pi. The question deals with throwing darts randomly at a board with a radius 1 with a square inscribed in it. I have done a script that randomly selected a number b/w -1 and 1. Then I was supposed to generate the results of...
Is there an algorithm which is O(1) or O(log n) (basically a very fast algorithm) which can tell whether there is a path from a node A to a node B in a graph?
Thanks
Hi Ho!
It is easy to observe that to get all factors of an integer n, one does not need to try whether a divides n for 1 < a < n.
But, rather using the following observation:
Suppose n is 24, then
24 / 1 = 24
24 / 2 = 12
24 / 3 = 8
24 / 4 = 6
-------------(!)
24 / 6 = 4
24 / 8...
Hello there,
I have to fit a one term exponential curve: y = a*exp(-b*t), and I have to implement the fitting procedure in a C program. Some days ago I discovered the GSL (GNU Scientific Library), and I told myself better later than never ;-)
When reading the GSL documentation and the...
I've been assigned a relatively funky physics project, and the process of writing the algorithm for said project has completely stumped me.
I have chosen to research the Oerlikon 20 mm auto-cannon, and have done all of my research and am at the point where I am supposed to write an...
Homework Statement
The assignment was to design an algorithm that asks for a user's height in feet and inches and their weight in pounds. The output of user's height and weight is suppose to be the user's height in meters and the user's weight in kilos. So I'm basically just suppose to convert...
hey I have a quick question about this. I was trying to understand the QFT operator, so I manually used shor's algorithm to factor 15. I used 2 for the random number. My results seem a bit weird tho. below are the probabilities of observing each number (the correct answer is 4, since the...
decimal to radical algorithm?
does anyone know if there is a method of writing a decimal number in its simplified radical form?? I really would like to know if there is
can someone point me to some resources to help find deterministic time and space for algorithms? Is there any software I can download which will help me determine these? Also is there any software which will help me come up with a growth function? Perhaps plotting data etc.
Hi there, I'm trying to right a program for class that 1st assigns random single precission floats from 0 to 1 to the elements 1-d array and then sums them up. Next I'm supposed to compare to this thing called the Kahan summation algorithm for different values of N (array size) using the...
hey, from what I've read here: http://www.quantiki.org/wiki/index.php/Shor%27s_Algorithm , I understand most of the algorithm. The one thing that I don't get is what the quantum Fourier transform does to the input register. Can someone either explain how this works or what exactly it does?
ok so I thought of this factoring algorithm, and I did some quick analysis on it (attached picture, time is in seconds * 5). It appears to be polynomial. However, when I see the basic brute force factoring algorithm I think that's also polynomial. So before I get excited over nothing. Can...
Have you ever written a perceptron learning algorithm?
http://en.wikipedia.org/wiki/Perceptron
Which language did you use? Would it be overly complicated to try to write it in C++ (compared with, say, MATLAB)?
Ciao all,
Is there a generic algorithm to compile the probability P(A)
of any propositional formula A (provided that we have only the probability of each atoms constituting A)?
For example, we have that A= a1 and not (a2 and a3 and ( not a4 and not a5 and not a6 ..) , or any other...
Hey everyone.
Before I get started on the actual problem, here's a quick background story:
Last year my math teacher gave out passwords to check grades online. They were constructed in the following manner - 1st initial, 2nd initial, random 1 digit number.
The students in the class...
Hi guys, I have another weak problem here if you would care to help, please.
I am trying to convert between the julian day and the gregorian date, and I found a eally good website:http://www.ortelius.de/kalender/calc_en.php
The only problem is that when I run into the centennial cycle...
Homework Statement
I need to calculate the relative error of the nearest neighbor algorithm. The book says it is the difference between the worst and nearest neighbor solution to the nearest neighbor solution. Does the mean that for example I have CITY A, find the fastest way to back to city...
Does anyone here know of any fast algorithms to diagonize large, symmetric matrices, that are mostly zeros? (by large I mean 300x300 up to several million by several million)
About a year ago I came up with an idea for a compression algorithm which could potentially compress any type of data (pictures, movies, text, ect) with equal ability, and could potentially compress it to 1/1000 or less of its original size. It is such a simple idea that I am sure that if it...
if people in administration were educated and understood the genetic replicative algorithm/game theory as it applied to all life, would this knowledge result in an means of administration that would mean better quality of life for all people? Or would there be some counter-intuitive effect which...
Hello. I've got a simply ballistics program with a very simply algorithm to deal with air friction. However, I am trying to find a mathematical forumula equivalent. Here is the algorithm:
G = accel due to gravity (universal constant)
F = projectile air friction factor (constant for a given...