Algorithm Definition and 651 Threads
-
T
Algorithm for dB vs time graph for one frequency from FFT?
I'm doing a physics experiment for school, for which I am measuring the reverb time for specific frequencies in a room. What I did was record a 1000 Hz sound, and some time after it, and looked at its FFT on Audacity to see the intensity of just 1000 Hz at a given time. Manually, I can do this...- tyiuo
- Thread
- Algorithm Db Fft Frequency Graph Sound Time
- Replies: 4
- Forum: Programming and Computer Science
-
Is There an Error in My Q Deep Learning Algorithm? Need Help Troubleshooting!
[mentor note: code blocks added for readability and syntax hilighting] Hey all, been trying to implement a Q deep learning algorithm, having an issue though, its not working, after 100 000 game plays and using 1000 iterations to train each step (although i have tried lower numbers for both)...- Superposed_Cat
- Thread
- Algorithm
- Replies: 1
- Forum: Programming and Computer Science
-
B
Pseudocode for Karplus-Strong algorithm
Does anyone have some Pseudocode for Karplus-Strong algorithm?- btb4198
- Thread
- Algorithm
- Replies: 1
- Forum: Programming and Computer Science
-
A Problem with a convolution algorithm
Hi. I've been reading "Statistical Mechanics Algorithms and Computations". And I came to a problem while processing Algorithm 1.26 (I attach a link at the end). I don't get why the weights are the way they are, specially I can't understand the sequence {1/2l,1/l,...,1/l,1/2l}. Does anyone...- Uriel
- Thread
- Algorithm Convolution Statistical mechanics
- Replies: 4
- Forum: Other Physics Topics
-
L
MHB Prim's algorithm for minimal spanning tree
Quite stuck on this how do i do this and how do i document each step?- LearnerJr
- Thread
- Algorithm Tree
- Replies: 2
- Forum: Set Theory, Logic, Probability, Statistics
-
M
I Why does +bc become negative in the proof of the Euclidian Algorithm?
In this video, at 5:35 He has d/(a-qb) for the first part. I was not sure how he got that. Why is it not d/(a+qb)? Because d/a and d/bc implies d/(a+bc) Why does +bc become negative?- MienTommy
- Thread
- Algorithm
- Replies: 1
- Forum: General Math
-
MHB Is it the algorithm the optimal one?
Hello! (Wave) I want to write an optimal algorithm that solves the following problem: Someone chooses a number from the set $\{ 1, \dots,1000\}$ and I have to find it. I can ask if the number that was chosen is $< , > , \leq $ or $ \geq $ from a number and the possible answers are yes or no...- evinda
- Thread
- Algorithm
- Replies: 20
- Forum: Set Theory, Logic, Probability, Statistics
-
Proving n^2 + 3n^3 is Θ(n^3) for n >= 0
First off I'm studying for an exam tomorrow, this isn't homework. Also, I've already written the proof and verified I've gotten the correct answer. I'm here to ask some questions about the solution that I am not completely confident I understand. Here's the problem: Prove that n2 + 3n2 is Θ(n3)...- benarceneaux
- Thread
- Algorithm Algorithms Analysis
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
A
I Simon's Algorithm: Solving the Mystery of f(x+s)
Hi all, I am sure some of you have heard of Simon's algorithm that calculates a secret string s when given a black box. Basically, let's say we have a qubit x that is n digits long. Now the black box contains a function f that outputs f(x+s) where s is the mystery string and + is bit-wise modulo...- Aakash Lakshmanan
- Thread
- Algorithm Quantum computing
- Replies: 1
- Forum: Quantum Physics
-
S
Djikstra's algorithm with distance 1 between every node
Does anyone know whether there exists a specialized Djikstra's algorithm for when every node has the same distance between it? Or to think of it another way, an algorithm for simply finding the minimum number of moves to get from 1 node to another? e.g. in the following A - B - C...- SlurrerOfSpeech
- Thread
- Algorithm Tree
- Replies: 4
- Forum: Programming and Computer Science
-
CNC acc/dec look ahead algorithm
Homework Statement I`m having some trouble with an acceleration/deceleration look ahead algorithm I`m trying to implement in a CNC controller written in C#/F#, specifically the algorithms treatment of time. Homework Equations The white paper can be found at...- lionliam96
- Thread
- Algorithm
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
Python Exploring Algorithmic Composition and MIDI Programming with Python
Python is the only programming language I know, and I know there is a huge library of MIDI music out there. I want to play around with machine learning and algorithmic composition to see what I can produce. So, what books should I read to be able to do this? What I am looking for is: Books to...- Avatrin
- Thread
- Algorithm Book recommendations Music Programming Python
- Replies: 1
- Forum: Programming and Computer Science
-
S
Largest permutation of elements in the range 1,....,N
with at most k swaps. (In other words, like the largest number formed by swapping k digits.) Example. A=[4,2,3,5,1], k = 1 ---> [5,2,3,4,1] I'm wondering why my algorithm is failing the test cases which I'm unable to see. using System; using System.Collections.Generic; using System.IO...- SlurrerOfSpeech
- Thread
- Algorithm Elements Permutation Range
- Replies: 9
- Forum: Programming and Computer Science
-
S
Algorithm to find the smallest substring containing a set of....
characters in a specified amount. I've been working on this for 10+ hours and can't seem to get it right. It passes all the unit tests I've written, but when I use it in the context of the program I'm writing it fails. The idea is like ACTAGACC { A : 2, C : 1} ------> 4, because smallest...- SlurrerOfSpeech
- Thread
- Algorithm Set
- Replies: 2
- Forum: Programming and Computer Science
-
S
Largest number formed by replacing k digits
I'm wondering if you guys can help me figure out where I'm going wrong here. The prompt is Given k and an n-digit number, help Sandy determine the largest possible number she can make by changing k digits. Full prompt here: https://www.hackerrank.com/challenges/richie-rich My solution is...- SlurrerOfSpeech
- Thread
- Algorithm
- Replies: 3
- Forum: Programming and Computer Science
-
A Barabasi-Albert Algorithm for Generating Scale-Free Graphs
I've been working on implementing the Barabasi-Albert model in C++. Barabasi-Albert networks are supposed to be scale-free -- that is, their degree distribution is supposed to be power-law distributed. In order to test whether my program was working correctly, I plotted the degree distribution...- dholbach
- Thread
- Algorithm Graphs
- Replies: 2
- Forum: Atomic and Condensed Matter
-
S
JavaScript Algorithm to return all subarrays of a given array
I can't find this exact algorithm anywhere on the internet. What I'm trying to implement is the following function // Returns all subarrays of the given array, not including the empty array // ex. [a,b,c].subarrays() = [ [a], [b], [c], [a,b], [a,c], [b,c], [a,b,c] ] Array.prototype.subarrays...- SlurrerOfSpeech
- Thread
- Algorithm Array
- Replies: 8
- Forum: Programming and Computer Science
-
Counting floating point operations in an algorithm
Hey guys, another question regarding MatLab here. In this assignment, I need to create a function of 'k' to count the number of floating point operations in the algorithm that I've made. Here is my code so far: expAk = zeros(1000, 1000); load('CA3matrix.mat'); times = zeros(15, 1); for j =...- JesseJC
- Thread
- Algorithm Counting Floating Operations Point
- Replies: 17
- Forum: Engineering and Comp Sci Homework Help
-
I Making a quantum computer do Shor's algorithm
I think I understand quantum superposition and entanglement, and a qubit. I just finished reading Scott Aaronson's brilliant blog post "Shor I'll Do It" that allowed me to understand Shor's Algorithm and how it relates to QM. But now I'm missing the next step. How does one "wire up" a number...- anorlunda
- Thread
- Algorithm Computer Quantum Quantum computer
- Replies: 1
- Forum: Quantum Physics
-
M
A Algorithm creates representative set of data
Hi all, I have algorithm to analyze and make it easier to implement in programming language (Python). We have table with data and we want to select only representative part. It looks like: ID_PRODUCT | CARDINALITY | SET VARIANCE WITH THIS ELEMENT AND ABOVE 10 ---------------- 110...- mundek88
- Thread
- Algorithm Data Set
- Replies: 1
- Forum: Set Theory, Logic, Probability, Statistics
-
S
Proof of optimality of algorithm
Homework Statement Given an array of positive integers A[1, . . . , n], and an integer M > 0, you want to partition the array into segments A[1, . . . , i1], A[i_1 + 1, . . . , i2], . . . , A[i_k−1 + 1, . . . , ik], so that the sum of integers in every segment does not exceed M, while...- Sebastian Martinez
- Thread
- Algorithm Proof
- Replies: 9
- Forum: Engineering and Comp Sci Homework Help
-
Why does this sorting algorithm properly sort the array?
Homework Statement Consider the following sorting algorithm for an array of numbers (Assume the size n of the array is divisible by 3): • Sort the initial 2/3 of the array. • Sort the final 2/3 and then again the initial 2/3. Reason that this algorithm properly sorts the array. What is its...- TheMathNoob
- Thread
- Algorithm Proof Sorting
- Replies: 12
- Forum: Precalculus Mathematics Homework Help
-
A
MHB Master algorithm design and upper bound proof
Hello, I am currently preparing myself for exams and I have a past exam question which I can't solve. This question concerns online learning and the following picture illustrates it: Is anyone able to help me out and propose a solution to this question?- akerman
- Thread
- Algorithm Bound Design Master Proof Upper bound
- Replies: 2
- Forum: Programming and Computer Science
-
J
Finding a Local Minimum in a Complete Binary Tree with Log(N) Probes
Homework Statement Consider a complete binary tree T with n nodes (n = 2^d − 1 for some d). Each node v of T is labeled with a distinct real number x. Define a node v of T to be a local minimum if the label x is less than the label y for all nodes m that are joined to v by an edge. You are...- Jairo Rojas
- Thread
- Algorithm
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
J
Find p in a Sorted Array with Unique Property | O(log n) Algorithm
Homework Statement Suppose you are given an array A of n distinct integers with the following property: There exists a unique index p such that the values of A[1 . . . p] are decreasing and the values of A[p . . . n] are is increasing. For instance, in the example below we have n = 10 and p =...- Jairo Rojas
- Thread
- Algorithm
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help
-
A
MHB How Does the DeBoor Algorithm Calculate Coefficients for Spline Fitting?
Hi, I'm trying to implement the DeBoor algorithm for Spline fitting to data points. In the subroutine BSPLPP (which is used to convert the B representation to PP representation), the COEF array is of the size (k,l). But for a kth degree polynomial, the number of coefficients should be (k+1). I...- anjuantop
- Thread
- Algorithm
- Replies: 1
- Forum: Programming and Computer Science
-
Recursive Algorithm, does it look correct
Homework Statement Homework Equations s1=1,sn=(sn-1) +n, and n>=2 The Attempt at a Solution It looks correct, but I'm not sure it'll work for negative values.[/B]- Kingyou123
- Thread
- Algorithm
- Replies: 25
- Forum: Precalculus Mathematics Homework Help
-
A What is the closed-form solution using ALS algorithm to optimize
C \in \mathbb{R}^{m \times n}, X \in \mathbb{R}^{m \times n}, W \in \mathbb{R}^{m \times k}, H \in \mathbb{R}^{n \times k}, S \in \mathbb{R}^{m \times m}, P \in \mathbb{R}^{n \times n} ##{S}## and ##{P}## are similarity matrices (symmetric). ##\lambda##, ##\alpha## and ##\beta## are...- kevin2016
- Thread
- Algebra Algorithm Closed-form solution Derivative Matrix algebra Optimization
- Replies: 1
- Forum: Differential Equations
-
Efficiently Finding Cycles in a Graph: A Scientific Exploration
Homework Statement Homework Equations Recursion, graphs, DFS The Attempt at a Solution To try to solve this algorithm, I first need to find all the basic cycles in the Graph G. When I have these cycles, I can simply pick the smallest edge in each of them and add them to the set F, while...- wololo
- Thread
- Algorithm Cycles Graph Programming Recursion
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
Algorithm gives wrong answer, what's wrong?
I have a point inside of a triangle and I want to move it to a position on the hypotenuse in the direction normal to it. The triangle's tip is located at position (l, b), the original point inside of it is located at (x, y). The triangle's sides have lengths w and h. That makes the measure of...- newjerseyrunner
- Thread
- Algorithm
- Replies: 2
- Forum: Programming and Computer Science
-
M
Shor's algorithm, definition of modulo
Hi guys, My question shouldn't take too long to be answered but I simply can't find anything using a google search. It's more of a problem from number theory rather than a physical one. I am referring to the Wikipedia article to Shor's algorithm and I still can't get my head around how the...- mupsi
- Thread
- Algorithm Definition
- Replies: 12
- Forum: Set Theory, Logic, Probability, Statistics
-
X
Why is the complexity class expression this?
I'm trying to understand complexity class algorithms off of my professor's lecture notes, but I still can't get a hang of it. void sort(int a[], int N) { //N is the length of the array for (int base=0; base<N; ++base) for (int check=base+1; check<N; ++check) if...- Xari
- Thread
- Algorithm Class Complexity Expression
- Replies: 1
- Forum: Programming and Computer Science
-
S
Issue with behavior of ray-plane intersection algorithm
I'm trying to determine the point, in 3D space, where an arbitrary line/ray intersects with an infinite plane. Using an article on Wikipedia, I tried to reproduce the presented formulas in code. This seems to work fine so long the ray is emitted from the origin of the coordinate system (0, 0...- STENDEC
- Thread
- Algorithm Behavior Intersection
- Replies: 7
- Forum: Linear and Abstract Algebra
-
Verlet algorithm: Why am I getting this output?
Hi! I am currently trying to write a code in C to simulate the orbit of planets around the Sun in the solar system. I am using the velocity Verlet approach and finding that my code produces no acceleration in the ##y##-direction (aside from for ##t_n = 0##,) and that the planet just flies off...- H Smith 94
- Thread
- Algorithm Errors Gravitation Orbits Output Simulation
- Replies: 8
- Forum: Programming and Computer Science
-
Is there any algorithm to find coincidences between 2 lists?
Hello I need to find coincidences between items in 2 lists. The lists have disordered items, so the first idea I had was to sort the items in the correct order and then finding the coincidences would be easy. The main problem is the big amount of items in the lists. I was using "double-linked...- ORF
- Thread
- Algorithm
- Replies: 12
- Forum: Programming and Computer Science
-
Comp Sci C++ search algorithm with 3 sublists
Homework Statement This is the assignment instructions:[/B] In C++, code a search algorithm that searches a list of strings for a particular song. The searching algorithm will have two inputs: the playlist, which is a string array that contains a list of songs in alphabetical order; and a...- iamjon.smith
- Thread
- Algorithm C++ Search
- Replies: 17
- Forum: Engineering and Comp Sci Homework Help
-
MHB Solving System of Restrictions with Simplex Algorithm
Hello! (Wave) I want to apply the simplex algorithm that finds the vertices of the following system of restrictions: $$2x_1+3x_2-x_3+4x_4=8 \\ -x_1+2x_2-6x_3+7x_4=3 \\ x_i \geq 0, i=1,2,3,4$$ I took at the beginning the basic feasible solution non degenerate solution $(1,2,0,0)$ and I wrote...- evinda
- Thread
- Algorithm System
- Replies: 25
- Forum: Set Theory, Logic, Probability, Statistics
-
Demon algorithm for microcanonical ensemble
I simulated a microcanonical ensemble of 10 ideal gas particles in one dimension and yielded the expected normal distribution of velocities. However, I still did not get how the algorithm works. The demon has non-negative energy content and the demon together with the system constitutes a closed...- gre_abandon
- Thread
- Algorithm Demon Ensemble Microcanonical ensemble Sampling
- Replies: 3
- Forum: Atomic and Condensed Matter
-
MHB Algorithm Type: Postorder Tree | Correct?
+ / \ / \ * - / \ / \ 2 3 * +...- barbara
- Thread
- Algorithm
- Replies: 1
- Forum: Set Theory, Logic, Probability, Statistics
-
Landmark Algorithm for Graph Isomorphism
Quanta Magazine published this article on a potentially new algorithm for graph isomorphism by Prof Laszlo Babai of the University of Chicago: https://www.quantamagazine.org/20151214-graph-isomorphism-algorithm/ There's a reference to the Arxiv preprint here: http://arxiv.org/abs/1512.03547v1- jedishrfu
- Thread
- Algorithm Graph Isomorphism
- Replies: 3
- Forum: Programming and Computer Science
-
Tree Data Structures & Minimax Algorithm for Games
Homework Statement Homework Equations Tree data structures. I think it might also have something to do with minimax algorithm, but it was only mentioned once and never discussed extensively in class so I doubt it is required. The Attempt at a Solution [/B] If both players play as well as...- wololo
- Thread
- Algorithm Data Games Structures Tree
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
S
Is this considered a valid sorting algorithm?
Let me know if I've invented a valid [FONT=Courier New]O(n) sorting algorithm. public void Sort ( this List<T> L ) { // Check every second whether L is sorted // Given enough time, natural bit flips will eventually make L sorted while ( !L.IsSorted() ) Thread.Sleep(1000); }...- SlurrerOfSpeech
- Thread
- Algorithm Sorting
- Replies: 8
- Forum: Programming and Computer Science
-
Algorithm to find the minimum spanning tree on a planar graph
Homework Statement I have the following algorithms: Prime MST with array, Prime MST with priorityq and Kruskal with priorityq. I have to choose the best algorithm to find the minimum spanning tree on a planar graph. A planar graph has the property in which the number of edges is in O(number of...- TheMathNoob
- Thread
- Algorithm Graph Minimum Tree
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
W
Can the Velocity Verlet Algorithm Prove Energy Conservation?
I've read that this algorithm conserves energy if the system it's applied to conserves energy. I can't find a proof, and it's not a particularly obvious statement, so how would you prove it?- whatisreality
- Thread
- Algorithm Velocity
- Replies: 1
- Forum: Mechanics
-
S
Help me nail the final post to the fence of this algorithm
I'm writing a class to format console output and the trickiest method in this class so far is the one for printing a table. I'm having it act like an HTML table in how text fits public static void PrintTable ( string[][] cells ) { // Outputs content in cells matrix...- SlurrerOfSpeech
- Thread
- Algorithm Final
- Replies: 3
- Forum: Programming and Computer Science
-
G
Optimization algorithm to apply to my system?
I am at the moment working on a project in which I try to minimize the annual running costs of a chemical manufacturing plant. To predict annual running costs I created a model with over 50 inputs, including things such as the type of chemicals and equipment used at different points in the...- GregoryB82
- Thread
- Algorithm Apply Optimization System
- Replies: 2
- Forum: Programming and Computer Science
-
B
Does this algorithm guarantee equaprobable outcomes?
Suppose you have a list of numbers, say ##{1, 7, 9, 4, 5, 6}##. You store the first number, and then iterate through this list. For each number in the list, you flip a coin. If it is heads, you swap that element in the list with the number you stored. If tails, you do nothing. Either way, you...- Bipolarity
- Thread
- Algorithm
- Replies: 4
- Forum: Set Theory, Logic, Probability, Statistics
-
P
Iterations in the Euclidean algorithm
Homework Statement Let m and n be natural numbers. Suppose ## min(m, n) \geq 2^k ## for some natural number k. Show that the Euclidean Algorithm needs at most ## 2k ## iterations to calculate the gcd of m and n.The Attempt at a Solution [/B] So far I think I need to show that for all the...- Panphobia
- Thread
- Algorithm Euclidean Proof
- Replies: 5
- Forum: Precalculus Mathematics Homework Help
-
Average complexity -- worst case of an algorithm
Homework Statement a Write an algorithm to find the median of three distinct integers a,b,c b Describe D, the set of inputs for your algorithm, in light of the discussion in Section 1.4.3 following Example 1.9. This section discusses Average complexity for an algorithm which involves an...- TheMathNoob
- Thread
- Algorithm Average Complexity
- Replies: 8
- Forum: Engineering and Comp Sci Homework Help
-
Solving the a7 + b7 = c7 + d7 Equation Using Heap Algorithm
Homework Statement We have four integers a,b,c,d each of which are >= 1 and <= n, and are asked to write an algorithm to find all possible solutions to the following equation: a7 + b7 = c7 + d 7 The algorithm should use a heap of at most n elements, and should have worst case runtime of O(n2...- NATURE.M
- Thread
- Algorithm
- Replies: 14
- Forum: Engineering and Comp Sci Homework Help