Algorithm Definition and 651 Threads
-
Division Algorithm for Polynomials in R[x] confusing me
I will be using /= to mean 'does not equal'. From my textbook: Division Algorithm: Let R be any ring and let f(x) and g(x) be polynomials in R[x]. Assume that f(x) /= 0 and that the leading coefficient of f(x) is a unit in R. then unique determined polynomials q(x) and r(x) exist such that 1)...- PsychonautQQ
- Thread
- Algorithm Confusing Division Polynomials
- Replies: 1
- Forum: Linear and Abstract Algebra
-
MHB Divide Binary Search Tree at Key k: Algorithm & Analysis
Hello! (Wave) Given a binary search tree $B$, I want to write an algorithm, that divides $B$ into two new trees $B_1, B_2$, so that the first one contains all the keys of $B$ that are smaller than $k$ and the second one contains all the keys of $B$ that are greater than $k$. Hint : Execute a...- evinda
- Thread
- Algorithm Analysis Binary Search Tree
- Replies: 10
- Forum: Programming and Computer Science
-
MHB Writing an Algorithm to Check Depth of Leaves in an Ordered Tree
Hello! (Wave) I want to write an algorithm, that implements an ordered tree(not necessary binary tree). It should check if all the leaves of the ordered tree (that is implemented from the binary tree) are at the same depth. Could you give me some hints how I could do this? (Thinking)- evinda
- Thread
- Algorithm Depth Tree Writing
- Replies: 65
- Forum: Programming and Computer Science
-
M
MHB What Are the Focus Areas in the Course Algorithms and Complexity?
Hey! :o I take the course Algorithm and Complexity and I have to choose one of the fields Computer Science(the operations of a computer), Computational Geometry or Cryptography. Could you give some information about these fields?? (Wondering)- mathmari
- Thread
- Algorithm Complexity
- Replies: 5
- Forum: General Math
-
B
How does the Karplus-Strong algorithm work?
http://en.wikipedia.org/wiki/Karplus%E2%80%93Strong_string_synthesis ok I just want to make sure I understand how this works. you have N with = fs/fo . fs is sampling rate = 44100Hz Fo is the note you want to play like 440hz then you make an array of N sizes and full it up with random value...- btb4198
- Thread
- Algorithm
- Replies: 2
- Forum: Electrical Engineering
-
B
C# Karplus-strong algorithm in c# with Naudio
Mod note: Added [ code ] tags to the following code. I wrote the karplus-strong algorithm in c# using Naudio. I plays the sound, but it does not stop. It should get to 0 and you should not hear anything. but I code get point where it just repeats the same value over and over. so I when in and...- btb4198
- Thread
- Algorithm Audio
- Replies: 16
- Forum: Programming and Computer Science
-
J
Check for Isomorphism in Hypergraphs
Hi, I was trying to check whether two hypergraphs are isomorphic to each other using MATLAB. I did the brute force method by permuting the vertices and check all the permutations one by one. This method is pretty slow. An idea suggested by my friend was to represent the hypergraphs as...- Jerrynap
- Thread
- Algorithm Isomorphism
- Replies: 1
- Forum: General Math
-
MHB What is the time complexity of the binary search algorithm?
Hello! (Wave) Index BinarySearch(Type A[1...N], Type value, Index low, Index high){ 1. Index mid; 2. if (high<low) 3. return -1 4. mid=low+(high-low)/2; 5. if (A[mid]>value) 6. return BinarySearch(A, value, low,mid-1); 7. else if (A[mid]<value)...- evinda
- Thread
- Algorithm Complexity Time
- Replies: 36
- Forum: Programming and Computer Science
-
MHB Learning to Write a Recursive Algorithm in Pseudocode
Hi! (Wave) I want to write a recursive algorithm as a pseudocode. How can I define the function? Which has to be its structure?- evinda
- Thread
- Algorithm
- Replies: 12
- Forum: Programming and Computer Science
-
A
Nesting Algo: Find Formula for List & Target (520)
Hey guys, I'm searching a formula for this kind of situation : We have a list of values (33,60,50,15,100) and a target (520). We want to know how many times each value can go in the target (close to) with those specifications : - Maximum 2 different value at the time - Minimum use of...- Arkamis17
- Thread
- Algorithm Formula
- Replies: 1
- Forum: General Math
-
Runtime of Seemingly Unpredictable Division Algorithm
Last week on my computer science assignment I had to write a division algorithm using only addition and subtraction to tackle a problem. My first attempt was the simple and naive repeated subtraction, although I quickly discovered it was not nearly efficient enough for how I needed to use it, So...- matineesuxxx
- Thread
- Algorithm C programming Division Runtime
- Replies: 7
- Forum: Programming and Computer Science
-
MHB Analyzing Time Complexity and Memory of Binary Search Algorithm
Hello! (Wave) I want to show that the $T(n)$ of the following algorithm is equal to $O(\log n)$. How can we do it, now that we have if, else conditions? (Thinking) int BinarySearch(int A[1…n], int y, int low, int high) { if (high < low) { return -1; //not found } mid = low + (high -...- evinda
- Thread
- Algorithm Binary Complexity Memory Search Time
- Replies: 10
- Forum: Programming and Computer Science
-
S
0-1 kNapsack problem FPTAS algorithm
I have the following 0-1 knapsack problem variant: I want to buy X units of a product at min cost, and there are m farmers that offer: - farmer 1: a11 units at cost c11, ..., a1n1 units at cost c1n1 ... - farmer m: am1 units at cost cm1, ..., amnm units at cost cmnm and I can choose at most...- StIgM@
- Thread
- Algorithm
- Replies: 1
- Forum: General Math
-
A
Implementing Shift and Add Algorithm for 3D Reconstruction of X-ray Images
Problem: In my class, we have been assigned a project where we must implement a shift and add algorithm to a set of xray images. There are 16 xray images of a finger joint taken with a 5 angle increment using a C-arm xray system. The xray images we will be given is from the second citation that...- Aaerion
- Thread
- Algorithm Shift
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
MHB Algorithm with ceil(n/2) comparisons
Hello! (Wave) I am looking at the following exercise: We say that a sequence of numbers $A=(a_1,a_2, \dots, a_n) , n \geq 3$, is strictly alternating if for each $i$, with $2 \leq i \leq n-1$, one of the following conditions stands: $a_{i-1}< a_i$ and $a_i>a_{i+1}$ $$$$ $a_{i-1}>a_i$ and...- evinda
- Thread
- Algorithm
- Replies: 5
- Forum: Programming and Computer Science
-
S
What's a general algorithm to build a supercell from a primitive cell?
Basically, I've written some code that take as inputs 1)Basis vectors 2)lattice translation vectors and computes the structure factor of the basis, producing a diffraction pattern. I'd like to begin incorporating subtle differences between atoms, so I want to compute the structure factor of...- SadScholar
- Thread
- Algorithm Build Cell General Graphene Primitive
- Replies: 1
- Forum: Atomic and Condensed Matter
-
MHB Applying Dijkstra Algorithm: Solving a Problem
Hello! (Wave) I want to apply the Dijkstra algorithm at an example. Dijkstra(G,s,v) 1. InitialValues(G,s) 2.S<-∅ 3.Q<-V // priority queue,with key the field d[] 4. while Q ≠ ∅ 5. u<-Extraction_of_Minimum(Q) 6. S<-S U {u} 7. for each v ∈ Adj[u] 8...- evinda
- Thread
- Algorithm
- Replies: 6
- Forum: Set Theory, Logic, Probability, Statistics
-
MHB Sentences about the Template algorithm
Hello! (Wave) Could you explain me some sentences,that are related to the following algorithm? Template algorithm(G) A<-∅ while A isn't a connected tree we define an edge (u,v),that is secure for A A<-A U {(u,v)} return A Let $G=(V,E)$ be an undirected...- evinda
- Thread
- Algorithm
- Replies: 3
- Forum: Programming and Computer Science
-
MHB What is the Template Algorithm for Minimum Spanning Trees?
Hello! (Wave) According to my notes: Template algorithm The algorithm keeps the invariant : "before each iteration,the set $A$ of vertices is a subset of some minimum spanning trees" at each step,where $A$ is an initial set of vertices. Template algorithm(G) A<-∅ while A isn't a...- evinda
- Thread
- Algorithm
- Replies: 13
- Forum: Set Theory, Logic, Probability, Statistics
-
G
Optimization Programming - Which Algorithm?
Hey guys! I need a little help in continuing my research i did this summer. So a little background information: This summer i conducted research at a REU where i focused on optimizing the power output of a wind farm by modeling wind turbine locations within a constrained space. I wrote a...- grantwilliams
- Thread
- Algorithm Genetics Optimization Programming
- Replies: 1
- Forum: Programming and Computer Science
-
S
Why does this algorithm (about computing a^n) work?
Homework Statement Here is the algorithm (which works perfectly) for computing a^n for any integer a and a nonnegative integer n in Pascal-style pseudocode.: k := n; b := 1; c:= a; {a^n = b * (c^k)} while k <> 0 do begin if k mod 2 = 0 then begin k := k div 2; c := c...- s3a
- Thread
- Algorithm Computing Work
- Replies: 14
- Forum: Engineering and Comp Sci Homework Help
-
D
Euclidean Algorithm Gaussian Integers
Hi, Just wondering when using the Euclidean Algorithm to find gcd of 4+7i and 1+3i. Where does 2 and 2+i come from in the follwoing? 4+7i = 2*(1+3i)+(2+i) 1+3i=(1+i)*(2+i) +0? I know you didvide them to get (5-i)/2 and then take closest Gaussian integer then not sure where to go.- dan280291
- Thread
- Algorithm Euclidean Gaussian Integers
- Replies: 6
- Forum: Linear and Abstract Algebra
-
Question about the Borwein fast algorithm for certain values of Gamma
I am reading through Borwein's paper, "Fast evaluation of the gamma function for small rational fractions using complete elliptic integrals of the first kind" and have a question. If we look at his algorithm's we see they are of this general form...- mesa
- Thread
- Algorithm Gamma
- Replies: 4
- Forum: General Math
-
Looking for Borwein's/Zucker's fast algorithm for the gamma function.
I have heard that the Borwein/Zucker algorithm for computing certain values of the gamma function is pretty awesome, but finding it online is proving elusive... Does anyone know the algorithm?- mesa
- Thread
- Algorithm Function Gamma Gamma function
- Replies: 4
- Forum: General Math
-
What is the CORDIC Algorithm and How Does it Work?
[SIZE="4"]Definition/Summary CORDIC (digit-by-digit method, Volder's algorithm) (stands for COordinate Rotation DIgital Computer) is a simple and efficient algorithm to calculate hyperbolic and trigonometric functions. It is commonly used when no hardware multiplier is available as the only...- Greg Bernhardt
- Thread
- Algorithm Method
- Replies: 1
- Forum: General Math
-
Fast tridiagonal matrix algorithm
I heard about fast tridiagonal matrix algorithm. I tried to find what is it but I can only find tridiagonal matrix algorithm. How is Fast tridiagonal matrix algorithm different? Thanks- ShayanJ
- Thread
- Algorithm Matrix
- Replies: 2
- Forum: Linear and Abstract Algebra
-
S
Generate a Formula for Square Spiral Algorithm | 10x10 Problem Statement
The problem statement Form a formula to generate every value in the 10x10 square spiral shown above. Use the variables: x = the column of the cell, y = the row of the cell, s = the size of the spiral (in this case 10). The formula must work for any size of spiral, where s is the width...- SwiftxStuff
- Thread
- Algorithm Spiral Square
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
P
Multiple birth and cut algorithm
Hi there I have found an algorithm within the literature that is known as multiple birth and cut. It is in a word fantastic! It seems like it has the potential to solve a problem I have been fighting with. I have been tasked with detecting nuclei in histopathology images and so far the...- physical101
- Thread
- Algorithm Cut Multiple
- Replies: 4
- Forum: Programming and Computer Science
-
J
How Does the Modulus Operator Work in Coin Change Algorithms?
only had a brief intro to algorithms like this Given an amount of money A between.01 and .99, this determines the breakdown of A into quarters (q) dimes (d) nickels (n) pennies (p) q:=A div 25 A:=A mod 25 d:= A div 10 A:= A mod 10 n:= A div 5 p:= A mod 5 I have to trace the...- jonroberts74
- Thread
- Algorithm Change Sequence
- Replies: 6
- Forum: Engineering and Comp Sci Homework Help
-
N
Optimal algorithm for scanning servers.
I'm writing a piece of software and need to find an optimal algorithm for scanning servers. Basically I'm given a list of N IP addresses, each IP address has two associated datetime values: The time the server was last known to be online and the time of the last connection attempt. Given these...- noelo2014
- Thread
- Algorithm Scanning
- Replies: 2
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
B
C# Can someone help me fix the loudness issue with my pink noise algorithm?
Can someone go over the pink noise algorithm for ? I am not really understand how to make pink noise this is what I did : for (int n = 0; n < sampleCount; n++) { Frequency_Start = rnd1.Next(8); Frequency_End = Frequency_Start * 2...- btb4198
- Thread
- Algorithm Noise
- Replies: 16
- Forum: Programming and Computer Science
-
V
Protein electrophoresis algorithm
Hello I'm trying to implement a application that will scan the electrophoresis gels and draw a graphic of the proteins: albumin, alpha1, alpha2, beta1, beta2 and gamma. The problem is that the resulted graphic is not as it should be. Albumin percentage is too low and the rest of the proteins...- victorqed
- Thread
- Algorithm Protein
- Replies: 7
- Forum: Biology and Medical
-
J
Algorithm to partition a complex equation into 2 master equations
My Calculus tool is coming along. The only thing left is to write some it's helper functions, such as the one described below: void CalculusWizard::partitionEquation(const std::string & eq, std::string & eq1, std::string & eq2, CalcWizConsts::eqOps & oper) { /* Given an equation eq, partion...- Jamin2112
- Thread
- Algorithm Complex Complex equation Master Partition
- Replies: 4
- Forum: Programming and Computer Science
-
A
MATLAB Optimization using genetic algorithm in matlab
For my B.Eng project, I'm optimizing the thermal efficiency of a boiler using genetic algorithm in MATLAB. I'm finding it very tough to write my fitness function, constraint equations and upload my initial population which is a set of data from my case study plant. for boiler thermal...- amos.ngwoke
- Thread
- Algorithm Genetics Matlab Optimization
- Replies: 8
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
Y
MHB How to figure out the shortest path using dijkstra algorithm?
- yakin
- Thread
- Algorithm Figure Path
- Replies: 2
- Forum: Set Theory, Logic, Probability, Statistics
-
M
Algorithm for assembling quadrilateral mesh in FEM
Hi all, I have co-ordinates of 4 vertices of quadrilateral for every element in mesh. I assembled such elements by moving single, separate point in whole domain and compared it's coordinate with all vertices of quadrilateral. Above technique work properly, but it required rectangle element...- mdn
- Thread
- Algorithm Fem Mesh
- Replies: 5
- Forum: General Engineering
-
J
Java Javascript squareroot algorithm and machine epsilon
So I made a little application to show the steps of approximating a squareroot using the Babylonian Method: http://jaminweb.com/squarerootCalc.html It's not working all the time. When I do the squareroot of 25 starting with an initial guess of 3.1, it works: Applying...- Jamin2112
- Thread
- Algorithm Epsilon Javascript Machine
- Replies: 23
- Forum: Programming and Computer Science
-
E
MHB Constructing a matrix version of the transformation algorithm?
Algorithms like the transformation algorithm: $(x, y)$ --> $(\frac{x}{k} + p, ay + d)$ are not generally used in mathematics. Instead, we use matrices. Multiplying matrixes: you multiply a row of the first matrix by a column of the second. Use the following example: $ \begin{bmatrix}x & y...- eleventhxhour
- Thread
- Algorithm Matrix Transformation
- Replies: 8
- Forum: General Math
-
J
I've reached a dead end in my algorithm
I'm trying to write a function that takes as parameters two strings, [FONT="Courier New"]textStart and [FONT="Courier New"]textTarget, and prints out the steps necessary to transform transform the first into the second, with the allowed steps being: (1) Add a character somewhere in...- Jamin2112
- Thread
- Algorithm
- Replies: 6
- Forum: Programming and Computer Science
-
1
Can someone explain Euclid's Algorithm to me?
My book is utterly useless - it vaguely gives me a history behind it, its motivations, and then lists an example in which it precedes to write a bunch of utterly false statements and then just.. spits out the answer. Can someone explain to me what on Earth is going on in the attached picture...- 1MileCrash
- Thread
- Algorithm Explain
- Replies: 4
- Forum: General Math
-
Division Algorithm: Understand Unique c & d
So, the division algorithm states that if a and b are integers with a>0 then there exist c and d integers such that 0<=d<a b=ac+d d and c are unique Now I don't understand d and c being unique. For example 4*3 + 3 = 15 where a=4 c=3 d=3 b=15 c and d are not unique, or maybe I don't...- chimath35
- Thread
- Algorithm Division
- Replies: 13
- Forum: Calculus and Beyond Homework Help
-
R
Solving Algorithm Homework: PrintSpaces(j+1) Error?
Homework Statement In the given picture below The Attempt at a Solution Im stuck after the begin How can I carry out the printSpaces(j+1) if the value of j wasn't given? Is there an error in the question or is there something that I am not seeing :/- Ronaldo95163
- Thread
- Algorithm
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
5
Algorithm for fibonacci sequence
Homework Statement create an algorithm for a Fibonacci sequence that will return the f value in f(n) = f(n-1)+f(n-2) Homework Equations f(n) = f(n-1)+f(n-2) The Attempt at a Solution I have tried several ways to create an algorithm that will sum the two previous numbers but always end up...- 5ymmetrica1
- Thread
- Algorithm Sequence
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
P
Can we view the hanoi tower algorithm as the following way?
the well known hanoi tower algorithm is as follow: public static void hanoi(int n,int a,int b,int c) ( if(n>0) ( hanoi(n-1,a,c,b); move(a,b); hanoi(n-1,c,b,a); ) ) my problem is : can we handle this algorithm in this method? we can regard three places as one place...- pqrs008jeff
- Thread
- Algorithm Tower
- Replies: 8
- Forum: Programming and Computer Science
-
J
Need help designing an algorithm for similarities between words
For fun, I'm trying to make a C++ program that takes a word from the user and comes up with an ordered list of suggested words, similar to the kind of thing you have on your cell phone when sending SMS messages. So far I have: An [FONT="Courier New"]std::vector<std::string> of the 5000...- Jamin2112
- Thread
- Algorithm Designing
- Replies: 2
- Forum: Programming and Computer Science
-
A
Comp Sci C++ Character Processing Algorithm
Homework Statement Hey guys! Thanks for taking the time to help me out, I really appreciate it. I am in my second semester of college, taking my first C++ course, and I had never programmed before this class so I am kind of stuck on a problem. I have almost the entire assignment figured out...- ActionPotential
- Thread
- Algorithm C++ Processing
- Replies: 15
- Forum: Engineering and Comp Sci Homework Help
-
O
Labeling Algorithms in LaTeX Thesis: Figures or Algorithms?
I am using latex for my thesis. Should I label my algorithms as figures, or algorithms? If algorithms, how do I reference them in the text? For figures I say, (Fig. 1). For algorithms? (Algo. 1), (Algorithm 1)? Thanks- oneamp
- Thread
- Algorithm Thesis
- Replies: 4
- Forum: STEM Academic Advising
-
MHB Algorithm for finding all the borders of R in all dimensions?
Hey Guys! To begin with, I apologize if I am using the wrong terminology. I've just begun learning about linear algebra. So I was working on a problem in the book "Introduction to Linear Algebra" by Gilbert Strang, fourth edition (problems 9 and 11 on p. 8). Problem 9: If three corners of a...- esis
- Thread
- Algorithm Dimensions
- Replies: 4
- Forum: Linear and Abstract Algebra
-
N
Algorithm for Generating Percentage Amounts
Hey guys, Not totally sure this thread belongs in this section, feel free to move. I'm trying to formulate an algorithm for an unusual problem. - Generate a pie chart with X number of wedges. - Each wedge is X percentage bigger then the one before it. - Percentage amounts of all...- natedgreat3
- Thread
- Algorithm
- Replies: 5
- Forum: Linear and Abstract Algebra
-
T
SVD Low-Rank Approximation Algorithm
I'm looking for a concise description of an algorithm for low-rank approximation via SVD. I've seen a number of articles referring to Lanczos method and finding eigenvalues but nothing going all the way to determining all the matrices involved in the low-rank SVD of a given matrix. Any...- TheOldHag
- Thread
- Algorithm Approximation Svd
- Replies: 8
- Forum: Linear and Abstract Algebra