Algorithm Definition and 724 Threads

  1. S

    I Find the "ringing" frequency from sum of multiple overlapping transients

    I am looking for an algorithm that will get the best estimate of the ringing frequency of a system subjected to impulse excitations at random times. The individual responses might look like this: And the total which I would like to analyze would be like:
  2. Vanadium 50

    How Can We Efficiently Parallelize the N-Queens Problem?

    A colleague has a parallel algorithm problem. There is a similar, more familiar problem that also uses backtracking, so lets discuss that. The problem is called n-queens. You have an nxn chessbaord and the goal is to place n queens on them so that no queen attacks another: no two queens are on...
  3. Ziqi

    Algorithm Engineer in EDA Industry

    I am an algorithm engineer working on inverse lithography in an EDA company. The modeling in inverse lithography involves much optics. I hold a PhD degree from ECE department at University of Florida, but optics is not my background. Thus, I need a place to have discussions of physics problems...
  4. P3dr0

    A Non-sinusoidal waveform model

    Hi, I am a ninth-grade student from Portugal with nothing to do, and I have decided that I want to build a simple regression algorithm in Desmos (the online calculator) to fit random binary inputs and maybe predict the next binary digits (although that part may take a considerable amount of...
  5. R

    Challenge: Find the minimum amount of draws possible for a list of integers

    Hello. Sorry if the title is a bit vague. I'm doing this challenge (google foobar) and even though it's not very elegant to ask for help, it's not like I'm going to win any kind of prize for it. In any case I'd like some suggestions since my current solution fails 2 tests on 5. The most...
  6. H

    An Algorithm Challenge (finding the five fastest horses out of a large group)

    As a Bedouin schiek you own twenty-five horses. You want to find the three fastest. You have no clock or other device that measures time. Your racing field is wide enough that five horses can race unimpeded, so you can race five at a time and see how they place. You don't want to abuse your...
  7. H

    Ingenious Algorithm Riddle: Imposs. Even w/Answer

    Hardly anyone would think of this solution. I even wonder how anyone would come up with the question. And it is even more amazing that the questioner and solver were not the same person.
  8. L

    I Questions about Grover's algorithm for quantum searches

    Hi! I have studied Grover's algorithm for quantum search and I just want to make sure that I understood it correctly: to make a number k of calls to the oracle one needs to have k physical copies of the gate producing the oracle. In quantum circuits there are no loops, hence a physical gate...
  9. C

    I Is an algorithm for a proof required to halt?

    I know that when giving an algorithm to prove something we need to prove two things about the algorithm ( there’s another option which is to show time-complexity but that’s optional since it’s irrelevant to the proof): 1. Correctness 2. That it halts But there are also algorithms/procedures...
  10. M

    Gauss-Jordan Elimination algorithm steps

    For this problem, For (i) the solution is, However, I am somewhat confused how to follow the steps of the Gauss-Jordan Elimination algorithm from there. Do I have to eliminate the coefficients from ##x_2## and ##x_3## respectively from row 1 and the -5 coefficient from row 2 in the exact...
  11. sHatDowN

    Algorithm problem involving 3 points and 3 lines in the x,y plane

    1- Coordinates of two points are given in x and y plane. A(x1,y1), B(x2,y2) Calculate the angle between the two lines passing through each of these points with the origin of linear coordinates. 2- If a line passes between the two points A and B above, does point C lie on this line? C(x3,y3) how...
  12. D

    I Smoothing algorithm for real-world data

    Hi 🙂 I'd appreciate your help. I have a bunch of livestock with an ear sensor on each, that sends me data about how much heat is going out of the ear. I wanna take this data from each livestock and smooth it. My question is, how to know which smoothing algorithm I should use to get an...
  13. M

    Use the Euclidean algorithm to find integers ## a, b, c ##

    Let ## a, b, c ## and ## d ## be integers such that ## 225a+360b+432c+480d=3 ##. Then ## 75a+120b+144c+160d=1 ##. Applying the Euclidean algorithm produces: ## gcd(75, 120)=15, gcd(120, 144)=24 ## and ## gcd(144, 160)=16 ##. Now we see that ## 15x+24y+16z=1 ##. By Euclidean algorithm, we have...
  14. shivajikobardan

    Comp Sci Diffie Hellman Key Exchange Algorithm? (x,y value)

    I'm not asking it from "will it be secure" point of view, rather I'm asking textbook kind technically correct or not. This is the algorithm (in the 3rd step of right figure, it should be generate y, typo) I took p=23,g=5. And picked x=4,y=5 I got the secret key as 12 and both got 12, so it...
  15. shivajikobardan

    Comp Sci Solve ax+by=GCD(a,b) for RSA Algorithm Cryptography

    It starts at 6:16 It's the part where he's pointing his hand in this picture. I didn't get it although it's pretty mechanical, so I'd like to learn that technique as this is really useful in RSA algorithm(rather than having to memorize some values). I've been searching for a method like that...
  16. Bob Walance

    B Shor's algorithm on a Google Sheet

    Here is a spreadsheet that demonstrates how Shor's algorithm works. The user first enters a number 'N' that has only two prime factors. Then, the user enters a random integer 'x'. Shor's algorithm does the rest in the factorization of N. A different value for 'x' must be tried if the factoring...
  17. N

    ART algorithm - Image Reconstruction

    My answer: The ART algorithm is a row-action algorithm. I tried to draw it, but I am not sure whether it will answer the question
  18. M

    Use the binary exponentiation algorithm to compute....

    First, consider ## 19^{53}\pmod {503} ##. Then ## 53=(110101)_{2}=2^{5}+2^{4}+2^{2}+1=32+16+4+1 ##. Note that \begin{align*} 19^{2}\equiv 361\pmod {503}\\ 19^{4}\equiv 44\pmod {503}\\ 19^{8}\equiv 427\pmod {503}\\ 19^{16}\equiv 243\pmod {503}\\ 19^{32}\equiv 198\pmod {503}.\\ \end{align*} Thus...
  19. A

    Comp Sci For which of the following purposes is the Banker’s algorithm used?

    I am new to the operating system and I want to know, Is it right Banker's Algorithm is mainly used to prevent deadlock? I picked this question from https://www.interviewbit.com/operating-system-mcq/ and I think it is also used for Solving deadlock, Can anyone know, Is this right?
  20. C

    Comp Sci Number of trees in a Fibonacci Heap without CASCADING-CUT

    I know that the maximum number of trees in a heap will be when all the trees are of smallest order as possible. Then, after performing CONSOLIDATE operation on the heap, all the newly created trees in the heap will be of different orders. Since in a different exercise I showed that the minimal...
  21. Oldman too

    New algorithm for real time voice camouflage

    An interesting approach to those eavesdropping devices in your life. https://arxiv.org/pdf/2112.07076.pdf ABSTRACT Automatic speech recognition systems have created exciting possibilities for applications, however they also enable opportunities for systematic eavesdropping. We propose a method...
  22. Monsterboy

    Comp Sci Using Single Source Shortest Path Algorithm to find the longest path

    This is the weighted, directed acyclic graph I created in JavaScript class WeightedDirectedGraph { constructor() { this.adjacencyList = {}; } addNode(node) { if(!this.adjacencyList[node]) { this.adjacencyList[node] = []; } } addEdge(node1, node2, direction, weight) {...
  23. B

    Coding Viola-Jones Algorithm in C#: Q&A

    I am coding the Viola-Jones algorithm in C# and I have a few questions. For finding an eye, after I have my integral Image, I am passing a 24 X 24 Rectangle across the whole image from left to right and top to bottom. I subtract the black area from the white. So right now, I am solving for the...
  24. chopnhack

    Comp Sci Functional Dependency Solving Algorithm for Minimal Cover

    Step 1: Reduce RHS into singletons F = {AB->C, C->A, BC->D, ACD->B, D->E, D->G, BE->C, CG->B, CG->D, CE->G} Step 2: Reduce LHS redundant attributes ACD->B has closure of A: A, C: C,A and D: D,E,G since A is in the closure of C we can remove A from ACD->B making it CD->B no other LHS could be...
  25. shivajikobardan

    Comp Sci Genetic algorithm knapsack problem

    Here is a solution, part of which doesn’t make any sense to me-: ->Why did we select c3,c1 and c3,c2 for 2nd generation? -> why did we select os1,os2,c3,c2 for 3rd generation? (And what the heck is happening here? We are already in 3rd generation when even 2nd one is not complete? -> then we...
  26. shivajikobardan

    MHB Debugging Algorithm Logic: 2 Iterations & Finding Right/Wrong Answers

    https://lh3.googleusercontent.com/J-M_R31KFl76aXCRE4sxzAWI6iAldXG9fMI2k4YRMZo6vZY0w1DPUfV7tLc1w5IsVQX8uUkjgThzROZrbb3bc6kluAEmyiH63Z4BsXKT5Xr7X7mLxOwbR1L0y3ttoLitS6bOnwz- Here is a solution, part of which doesn’t make any sense to me-: ->Why did we select c3,c1 and c3,c2 for 2nd generation...
  27. shivajikobardan

    Comp Sci What is uniform crossover in genetic algorithm crossover operation?

    https://slidetodoc.com/genetic-algorithms-an-example-genetic-algorithm-procedure-ga/ slide is taken from here. is this done total randomly or is it done pseudorandomly. I mean is there some forumula for randomness used in this case? i learned about single point and double point crossover but...
  28. shivajikobardan

    Comp Sci I need a solved numerical example on genetic algorithm for 1 iteration

    Really need this. Tried googling but not many. 1 or 2 are there. I want this algorithm solved by hand to some problem. IDK what kinds of problems exists. but one is knapsack problem. there is analytics vidya's tutorial but I want something else, more direct, more clear...Any resource you can...
  29. shivajikobardan

    Comp Sci Confused about DFS algorithm in action (not an issue with the pseudocode)

    The DFS in action doesn't relate to the pseudocode as you can see it. My confusion starts from dfs in action, step 4. I could write essay about it, but you can see it yourself as well and spot that algorithm and dfs in action doesn't match up properly. or is it only me? This is not a homework...
  30. riay00

    I How to create a fair distribution algorithm?

    Hi, I am a math noob and need to understand what is the best mathematical formula for fair distribution. The problem statement is as follows: We choose 2 numbers at a given time to distribute donations at a particular instance in time (The numbers from 1-6500 represent community members...
  31. mathbalduino

    Algorithms for Traveling Purchaser Problem (TPP)

    Hey guys, how you doing? Im here to ask for you help. I am writing my bachelor paper as an implementation/review of the TPP algorithms out there. Almost every paper that I read references the Ramesh algorithm, that returns an exact solution for TPP problems, but I just can't find the algorithm...
  32. shivajikobardan

    MHB RSA algorithm to encrypt "abcdefghij"

    Say p=5, q=11 z=(p-1)*(q-1) =40 d relatively prime to z, so d=27 de mod z=1 27e mod 40=1 e=3 $C=M^e mod \; n$ For d, M=4 C=$4^3 mod 55$ Am I right here?
  33. A

    MHB Want to use probability algorithm for my web app

    I'm a freelance web developer and right now I'm stuck into a mathematical(probability) issue where I'm developing an answer filtering tool. This tool works as follows: 1) There are six questions that the user will be asked 2) Based on the answer of first question, my server will decide which...
  34. P

    I Notation of the approximation in quantum phase estimation algorithm

    I'am interested in the notation of the approximation in quantum phase estimation algorithm. In the literature there are different definitions, which I divide into two cases here. Both different in their definition of the ##\delta##. In both cases I start with a quote of the source and show an...
  35. M

    A HHL quantum algorithm and the phase estimation

    In HHL algorithm, does the controlled unitary (Hamiltonian simulation part of Quantum phase estimation) depend on Hermitian matrix coefficients and how?
  36. P

    I Measurement of a qubit in the computational basis - Phase estimation

    Hello, I have a question about the measurement of a qubit in the computational basis. I would like to first state what I know so far and then ask my actual question at the end.What I know: Let's say we have a qubit in the general state of ##|\psi\rangle = \alpha|0\rangle + \beta|1\rangle##. Now...
  37. Theia

    MHB Algorithm to arrange N people into groups of K

    Hi all! I've been trying to find a reasonable way to solve following problem: N people meet each others in groups of K people such that no one meets more than once. If I'm not mistaken, this requires two things: N must be divisible by K N - 1 must be divisible by K - 1. Let's assume these...
  38. S

    Comp Sci A Question about modulus R in Rabin Karp Algorithm

    Hello, I am learning trying to set up a code that searches for a certain pattern in the text by implementing Rabin-Karp Algorithm. When setting up the Rabin Karp hash function, I have been told that I should set a value q in order to lower the time complexity of the function, and that q should...
  39. M

    MHB Booth algorithm for multiplying signed numbers

    Hey! 😊 The algorithm of the Booth for multiplying signed numbersrs of fixed complement representation decimal point by 2 is implemented by multi-consecutive digit stain control of the multiplier, so after each test the algorithm proceeds by $N$ digits (e.g. for $3$-bit control step $N$ is...
  40. M

    I Question about Grover's algorithm

    Hello! I am just getting started learning about quantum computing so I apologize if this questions is trivial, but I am a bit confused about the Grover's algorithm. As far as I understand (I read it from here), assuming there is just one solution, you start with N qubits, you put them in an...
  41. Arman777

    Python Algorithm for Converting Strings: Find the Best Option

    Let us suppose I have a string in this form, string = 'CıCCkCnow CwCho CyCou CaCre but CwChat CaCm CıC' Now I won't to take each word between 'C' and convert it into an upper case letter. For example, the above string should turn into new_string = 'I know Who You Are but What Am I' what kind...
  42. B

    Evaluate the complexity of this graph coloring algorithm

    Hello everybody, I should evaluate the complexity of this graph coloring algorithm. To do this, I use the adjacency matrix in which the graph nodes are the elements on the diagonal, while the elements outside the diagonal indicate if a node is adjacent to another ##(A_{i,j} = 1)## or not...
  43. Wrichik Basu

    I Numerically solving Time-independent Schrödinger eqn. using Shooting algorithm

    I have to solve the 1D Time-independent Schrödinger equation (TISE) using the shooting algorithm. As far as I understood from this video on Shooting method for solving BVP, I will have to solve the problem by using IVP solvers (like RK2 or RK4 methods), and guess a value for the derivative of...
  44. B

    Crosstalk Algorithm - Optical system

    I have a camera that take pictures of square boxes that are really close to one another. There is a light that is Illuminating the boxes but when I try and isolate a single but in my picture, I am reading higher values then what I should be. If I remove the other boxes and only do one box, I am...
  45. Admiralibr123

    I Algorithmic model for primary decay chains

    I have seen "radioactivedecay.py" python library which employs measured experimental data for its calculations. I have seen models that solve the system of differential equation with numerical algorithms to predict the proportion of nuclides at any given time. But I have yet to see a...
  46. F

    Find Z-bus using Z building algorithm using MATLAB code

    I tried to write to the code, but I got confused in line 46 & 59.Every new added bus increases the dimension of the Z matrix, and since we have 3 busses, the dimension of Z should be [3x3]. I formed a for loop in case of adding a new bus to add a new row and new column (increases the...
  47. Mark44

    Fast reciprocal square root algorithm

    I ran into an interesting video on Youtube yesterday, about a fast way to compute the reciprocal of the square root of a number. I.e., to compute this function: ##f(x)= \frac 1 {\sqrt x}## The presenter is John Carmack. If you search for "Fast Inverse Square Root — A Quake III Algorithm" you'll...
  48. Arman777

    Python MCMC algorithm -- understanding some paremeters

    Recently I have shared a question about a program called SimpleMC and how to run it. Running a Github File on VS code for windows 10- File system problem ( | Physics Forums I am trying to understand an MCMC program. I manage to run it, but I am trying to understand the meaning of the some...
  49. TimeSkip

    I God's algorithm as undecidable?

    I posted in the same sub-forum about complexity in mathematics and whether it is determinate. Seemingly, the consensus is that there's no definitive way in assessing a proofs complexity in a manner that is rigorous in regards to any other theorems or otherwise stated in a systematic way other...
  50. Wrichik Basu

    Python What's wrong with this Python program on Euler's forward algorithm?

    Here is the function that I have written: import numpy as np def ode_euler_forward(odefun, y_initial, x_range, num_steps): """ Solves a system of non-stiff ODEs using Euler's forward algorithm. Parameters ---------- odefun : callable(x, y1, y2, ...) The function...
Back
Top