I am trying to write a code to guess the secret number. For example, if I have a secret number called 412.
My code will take the inputs as
120 - 0
312 - 2
439 - 1
where the numbers on the right gives the position of the correct digit at the correct location. I have thought some codes but it...
Hi. I have a collection of points in 3D space. I'm using MATLAB to find all pairs of points within a certain range from one another. Right now I'm using rangesearch(X,X,r), where X is the collection of points and r is the range.
These points are the locations of atoms and I am attempting to...
Hi. I have graph which I am analyzing in MATLAB. I would like to determine sections of the graph which could be removed from the rest of the graph by removing only 2 edges. (The graph represents the network of atomic bonds from a simulation of silica, and I am attempting to locate strands of...
Hi,
I don't get what the conditions below exactly means.
Its which u they are talking about? Is the u the parent or children? Does it mean u = B? and the children are A,C,D?
if u is in the quadtree rooted by v:NW then u:x < v:x and u:y ≥ v:y;
Thanks,
The Aircraft Recovery Problem: consists of finding solutions for a disrupted aircraft flight schedule such that a set of constraints is satisfied, namely continuity, turn-round time, scheduled maintenance, and airport departure/arrival capacity. My approach consists of finding the domains for...
I am trying to understand the following deduction:
"The conditional phase shift can be represented by the unitary operator 2|0> <0| - I:"
for eq. 4a) I was expecting to be:
[2 |0><0| - I] |0> =
2 |0> <0|0> - I|0> = 2|0> - |0> =
|0>
as for eq. 4b I can't understand it at all. Why does the...
I have been struggling for over a month now with a problem I cannot fix. I would really appreciate any comment or guidance. Thank you!
I am considering an Ising-like model with N agents that han hold one of the following 3 states, represented by vectors:
state + : vector (1 0)
state 0 : vector...
Marching Square - article
In the "Linear Interpolation" section This article discusses how to interpolate the values when the lines are oblique.
For example, for Case#2 it has the following calculation:
I have written the following source code to implement the Marching Square algorithm...
These days there is a question confuses me if it can be real or not.
2-3 years ago when I was looking around papers about computer sciences on the web, I came across to a sceintific paper which mentions an algorithm about analysing your language even it's a foreign language. So when you speak...
If I give you 9 digits ##u_1, u_2, \dots, u_9##, is there an operation/set of operations you can perform to check whether all the digits from 1 to 9 are represented in that set? Just asking because my solution was a boring brute force check.
I don't think anything useful becomes of the product...
I've been trying to learn about Shor's algorithm by writing out implementations of the circuit for modular exponentiation, ##{ a }^{ x }\; ({ mod }\; N)##, to find the period ##r## for small numbers such as:
##(N=15,\quad a=11)\quad \longrightarrow \quad r=2##,
##(N=35,\quad a=13)\quad...
I want to write code walk around the array recursively. For some reason I cannot share my code. Let's say I have a array like this: arr[4], I want to look 012 123 013 or 01 12 23 02 03 13. In code I write I can look 012 123 or 01 12 23 but I cannot look 013 or 02 03 13. What algorithm should I...
I'm trying to simulate a simple series reaction stochastically using Gillespie's algorithm. I found this file:
What is this 'propensity function'? Say for example I have the simple reactions:
A --(k1)--> R
R--(k2)--> S
are these 'propensity functions' the rates (a wild guess)? I mean;
α1 =...
To simulate the trayectories of solar systems around a black hole (i.e. a galaxy) I have 3 classes in C++: cSystem, cBlackHole and cGalaxy. cSystem assigns initial values of position, velocity, etc to a solar system. cBlackHole does the same but just for the black hole. And cGalaxy mixes...
Trying to understand Booth's Algorithm. There's some YouTube videos online but I decided I'd try by reading Booth's original paper http://bwrcs.eecs.berkeley.edu/Classes/icdesign/ee241_s00/PAPERS/archive/booth51.pdf
Can anyone explain what is meant by "sum of existing partial products"? (Page 3...
Hey there,
There are plenty of proposed implementations of Shor's algorithm which require different numbers of qubits, ##q##, to be able to factor a number ##N## of size ##<2^n##, i.e. a number of length at most ##n## bits. Most of these require ##q## linear in ##n##; for example, this...
I need to write a code for my simulation for which I have to create bcc lattice. Can anybody suggest how I can start since I am jumbled up this 3d lattice coordinate writing?
Hi,
I want to know if the algorithm to find prime number has running time O(sqrt(N)) or O(log^2N). log^2N is better than sqrt(N). Also for large values can it become a pseudo polynomial algorithm?
Zulfi.
Hi All
Here is an interesting algorithm for up-scaling images:
https://arxiv.org/pdf/1511.04587.pdf
It has 20 3x3x64 (some I have read use 3x3x16) convolutions. Now my understanding of convolutions means, the first produces 64 images from the 64 filers, then in the second convolution each of...
I am trying to understand the verlet algorithm but I am kind of stuck.
I guess first we are findind the ##v(t + 1/2h)## then we are leaving it there and starting a loop for 8.78 ?
Also I did not understand the meaning of the equation 8.78 ? We are never using ##v(t + 3h/2)## ? Or in the...
I'm creating a type of image processing software and I have a need to get the color that best represents text once I have identified the pixels in a region of text. I've tried using simple strategies like "averaging" the pixels or taking the most common pixel, but these produces bad results
An...
The only restrictions are:
-There are N points randomly distributed over an X-Y plane and it is necesary to pass every point at least 1 time, in order to get the path of the minimun distance throught all of them.
-If does not matter how many times you pass any of this points.
-You have to pass...
Recently I have been reading up about the logical operations OR, AND and XOR. Whilst reading about XOR I cam across a method using XOR to find the missing number in a given array, but I just can't understand how or really why it works. The algorithm is displayed below.
A = [2, 3, 1, 4, 6, 7]...
Consider a function ##f\in\mathcal{C}^2## with Lipschitz continuous gradient (with constant ##L##)- we also assume the function is lowerbounded and has at least one minimum. Let ##\{x^k\}_k## be the sequence generated by Gradient Descent algorithm with initial point $x^0$ and step-size...
Consider a function $f\in\mathcal{C}^2$ with Lipschitz continuous gradient (with constant $L$)- we also assume the function is lowerbounded and has at least one minimum. Let $\{x^k\}_k$ be the sequence generated by Gradient Descent algorithm with initial point $x^0$ and step-size $0<\alpha<2/L$...
Hi at all!
I need to implement the Pivoted Cholesky Decomposition in C++ and I know that is possible implement it without rows permutations.
Where can I find the algorithm described clearly and/or codes example in other language to replicate in C++?
Thanks!
Use the formal definition of Big-Oh to prove that if f (n) and g(n) are nonnegative functions such that f (n) = O(g(n)), f (n) + g(n) = Ω(g(n)).
By the definition of Big-Oh:
If f(n) and g(n) are non-negative functions such that f(n) = O(g(n)) there must be positive constants c and n0 such...
I'm trying to count running time of build heap in heap sort algorithm
BUILD-HEAP(A)
heapsize := size(A);
for i := floor(heapsize/2) downto 1
do HEAPIFY(A, i);
end for
END
The basic idea behind why the time is linear is due to the fact that the time complexity...
I am new to data science and I am trying to create an algorithm for the DBSCAN. I can label each point as core-border-noise. But after this step I am stuck. How can I separate the density reachable cores and create clusters from these points ?
In many books on number theory they define the well ordering principle (WOP) as:
Every non- empty subset of positive integers has a least element.
Then they use this in the proof of the division algorithm by constructing non-negative integers and applying WOP to this construction. Is it...
In many books on number theory they define the well ordering principle (WOP) as:
Every non- empty subset of positive integers has a least element.
Then they use this in the proof of the division algorithm by constructing non-negative integers and applying WOP to this construction. Is it possible...
Hello,
I'm working on a discrete mathematics for computing paper and am stuck on what a symbol is trying to convey. Sorry if this seems like a stupid question (I feel stupid for not being able to work it out myself), I've just started this subject and am still getting used to it.
My question...
I am trying to develop an equation or algorithm to determine the roulette curve that results from rolling a curve over another fixed curve.
A general method to determine the roulette using any two curves, rolling and fixed, seems to be presented here...
Hi,
Kindly consider the Question 4.8 on the following link
http://parallelcomp.uw.hu/ch04lev2sec18.html
##t_s## = start up time
##t_w## = per-word transfer time
m = size of message
p = number of processors
The total time for communication for ##logp## steps is:
##T = (t_s + t_w*m) * log_2 p##...
SmarterEveryDay is posting a series of videos (this is the first one) on Youtube Video Identification hacking, what it is and how it affects what we see online. Its really good even though the notion of manipulating the Youtube algorithm is very disturbing.
gcd(f_n,f_{n-1})
gcd[f_{n-1},f_n - f_{n-1}]
gcd[(f_n - f_{n-1}), (f_{n-2} - f_{n-1})]
gcd[(f_{n-2} - f_{n-1}),f_{n-3} - f_{n-2})]
gcd[(f_{n-2} - f_{n-3}),(f_{n-4} - f_{n-3})]
.
.
.
gcd(f_2,f_1), where f_2 = 1, f_1 = 1
I assume LateX is not working yet. Not sure if I am on point here or not...
Hi,
I had thought that "hill climbing method" is a general terminology to refer to methods such as perturb and observe and incremental conductance. The same is also said here, "The hill climbing based techniques are so named because of the shape of the power-voltage (P-V) curve. This technique...
Hi everyone,
I'm a computer scientist (not a physicist), so I will ask a computer scientist's question.
In all the descriptions I found of Grover's algorithm, there is an element that is puzzling the computer scientist in me: it seems that you need to tell the Oracle about the position of the...
Hi everybody,
I've read some pages in Nielsens "Quantum Computing" book, it's very interesting, but especially at Grover's algorithm, there occurs a question for me. It is said that a phase shift is performed, which is defined as follows:
##|0\rangle \rightarrow |0\rangle \\ |x\rangle...
Good day everybody,
I'm currently working on the Grover algorithm. You can also illustrate this process geometrically and that's exactly what I have a question for.
In my literary literature one obtains a uniform superposition by applying the Hadamard transformation to N-qubits. So far that's...
Hey everyone,
I wasn't sure if this belonged in the general math forum or not, so I posted it here instead (mods - feel free to move if it belongs elsewhere).
What I want to know is how to properly write out a computer algorithm in proper math notation. Take this code for example:
Height...
I have a data set of samples, and I made up some variables that filter out unwanted samples from the data set.
Say each sample has values ##\vec{x}=x_1, x_2,..., x_n##, and I know the values of ##\vec{x}## for each sample.
Also, if I sum up all of the samples, I get a value, ##Z##, which tells...
I've heard that Fortune's Algorithm is the fastest algorithm yet found to generate a voronoi diagram. I am far from being able to understand it, but I got interested in it because I want to learn about procedural generation. My question is, what sort of mathematics would I have to be familiar...