instruction
stringlengths
35
29.1k
I have an object that is moving towards target points and I want to determine when it will reach or pass through them. I receive points in real time, which represent the current position of the object. The position is a 6-D vector. The data can be download from here Initial approach For each received point: Calculate ...
I am a research scholar currently working in computational complexity. I am working on a decision problem $P$ that is known to be W[2]-hard parameterized by the solution size on split graphs. As split graphs are chordal graphs, if a problem is NP-complete on split graphs, it is also NP-complete on chordal graphs. I won...
Given two sets of nonnegative numbers $X=\{x_1,...,x_n\}$ and $Y=\{y_1,...,y_n\}$, my problems consists in finding the partition $S \subseteq \{1,...,n\}$ and $\bar{S}=\{1,...,n\}\backslash S$ maximizing the following quantity: $$\frac{\displaystyle\left(\sum_{i\in S}x_iy_i\right)^2}{\displaystyle\sum_{i\in S}x_i^2}+\f...
I have a (2D) point cloud of reasonable size (say some thousands of points) and a set of (2D) polylines also of a reasonable size. I want to assess the discrepancies between the two geometries and for this I want to find the nearest point to every segment. This can be solved with the Voronoi diagram of the segments fol...
Since design ideas, and even the concept of Physical Design (exactly where you put your files), are such a broad topic, may I give a definite example and ask for feedback on the example? Suppose you are tasked with making a C++ application that does a whole bunch of complex mathematics. And, beforehand, you are given t...
I can't find this from surface search in the literature When one observes/simulates NFA after processing several characters, one has to consider both "internal states of NFA" (individual nodes) and "state of the whole NFA" - which nodes are active - that can be seen as state of DFA that that automata is equivalent to. ...
I know there are three barriers of computation; the thermodynamic barrier, the light barrier and the quantum barrier. Let’s say we figure out how to send signals FTL, learn how to get rid of excess heat and continue down the ladder of nanotech, picotech and femtotech. Is there a 4th barrier we might encounter at some p...
In the paper Tight Bounds for Lp Samplers, Finding Duplicates in Streams, and Related Problems, the authors consider the universal relation problem in 2-party communication complexity, which is defined as follows: Consider the following two player communication game. Alice gets a string $x \in \{0,1\}^n$, Bob gets $y \...
I’m curious about an embedding technique where every possible “tokenization” of a text gets an embedding - not just individuals words, but every single 2-gram, 3-gram, and n-gram. Does this exist? Or is it the bag of words approach? What I would really like is to explore in real time how the addition of a token changes...
I'm kind of struggling with this excercise. The obvious thing to try is to show that 3-COL $\leq_p$ 3-COL-$K_4$-FREE ($\leq_p$ stands for polynomial reduction). It is clear that 3-COL-$K_4$-FREE is in $NP$. The first thing that comes to mind then is to take the trivial reduction that maps a graph $G$ to itself, but thi...
We were taught to use reductions in order to show that a given L is undecidable. My question is, given some definition of a new L, is there a way to find a reduction $$ L\leq_mHALT $$ So that I can determine $L \in RE$? More specifically, given the quite common problem of the decidability of $$ L=\{\langle M\rangle | |...
A linear equation $Ax=b$ can be solved by reducing the matrix $A$ to upper triangular form by using Gaussian elimination or LU decomposition. If $A$ is symmetric and positive definite one can use Cholesky decomposition which is more efficient than LU decomposition. If the entries of $A$ are all integers one can use the...
On the 7th of June 2023, Google DeepMind released an article about AlphaDev. AlphaDev is an evolution of AlphaZero (used to beat world champions at Go, Chess and Shogi), and it can produce assembly code for a task if said task is represented as a game. All of this information can be found here. Now, they tested AlphaDe...
$FINITE_{TM} = \{\langle M \rangle\mid M\text{ is a TM and }L(M)\text{ is finite}\}$ $A_{MT} = \{\langle M,w \rangle \mid M\text{ is a TM and }M\text{ accepts }w\}$ I'm trying to prove that $FINITE_{TM}$ is not Turing-reducible to $A_{MT}$ by contradiction. Supposing it is, I get that there's an oracle Turing machine $...
A contiguous single polygon is specified by it's vertices $(v_1, \ldots, v_n)$, given in order such that the line between $v_i$ and $v_{i+1}$ is an edge of the polygon (there's also an edge between $v_n$ and $v_1$). For example, a triangle might look like $v_1=(0, 0), v_2 = (1, 1), v_3 = (2, 0)$. Anyways, given two poi...
I am trying to program a Turing machine that performs unary subtraction, $m-n$, but if $m<n$, the machine writes the $!$ symbol on the tape $|m-n|$ times. If $m=1$ and $n=3$, the machine would only leave $!!$ on the tape. Now, I have successfully created a machine that performs unary subtraction $m-n$ where $m<n$ and i...
I have read the GPT-1 paper, and my understanding is that it works as follows: $U$ is input tokens, $h_0=UW_e+W_p$, $h_i=\text{transformer_block}(h_{i-1})$ and the output is a probability vector $P(u)=\text{softmax}(h_nW_e^T)$, and the hidden states are the final latent layer before softmax, so the hidden states are $h...
Why does Java's HashSet have an underlying HashMap, not the other way around? HashMap could have contained an internal HashSet of Map.Entrys, and HashSet wouldn't have stored a reference to an internal "dummy" Object per each element (while implementing the hashtable data structure itself). Is there (could there be) so...
AFAIU, there are only two issues, that VM solves: Scarcity of RAM; Access control to "unknown" memory, where SW tries to read from or write to the memory it does not own or share with other processes. While p.1) is becoming a non-factor for more use-cases, than it probably was in the past, are there any solutions for...
I've had the following question on a test and I answered: 'False', my answer was incorrect and I'm trying to understand why. $VC = \{<G,k> |\ G =$ undirected graph with a vertex cover of size $k\}$ $IS = \{<G,k>|\ G =$ undirected graph with an independent set of size $k\}$ Ture or False: Assuming there exists a languag...
I'm trying to practice recurrence equations, so I'm trying to solve this typology by unfolding method. I was wondering if what I write below was correct and obviously the result: $T(n) = n^2 + T(n-4) = n^2 + [n^2 + T(n - 8)] = n^2 + n^2 +[n^2 + T(n-12)] = n^2 + n^2 + n^2 + [n^2 + T(n-16)] = ...$ In general we can say t...
I need to generate maze with 100x100 rooms. Each room connected only with 1 other room. Here are example of correct 2x2 mazes: +-+-+ |...| +-+.+ |...| +-+-+ And here are some incorrect 2x2 mazes: +-+-+ +-+-+ +...+ |.|.| +.+.+ +-+.+ +...+ |...| +-+-+ +-+-+ For scoring our 100x100 maze we use following system...
I have an upper row of $N$ equally spaced 'units' and a lower row of $N$ equally spaced 'units'. I would like to connect any of the upper row of units to the lower units via orthogonal connectors (consisting of horizonal and vertical line segments) such that although a horizontal and a vertical line segment, e.g. conne...
My goal is to solve the above-constrained minimization problem where my vector to be optimized is x. The matrix A and the vector y are known to me. There are a lot of non-PyTorch libraries like CVXPY and scipy.minimize that do it, but they are very slow when the matrices become large and I am going to run this algorith...
The "input-encoding problem" is where the binary representations of symbolic input variables to a Boolean function are chosen to minimize the decode logic complexity. The "Espresso-MV" software can be used to do this, here's one of the most cited papers on the topic by the developer, from the mid-late 80s. The relevant...
I am working on an NP-Complete problem, i.e., the dominating set. Given a graph $G = (V, E)$, a set $S$ is a dominating set if every vertex $v \in V \setminus S$ has at least one neighbor in $S$. I am looking for the complexity of the problem in trees. I have tried the greedy method to solve this problem. But, looks li...
Suppose we have a grid of points (which can also be very dense 10000x10000) like the one in the figure in which the points are marked with two different colors. What is the best algorithm from a performance point of view that allows me to reconstruct the outline of the red dots connecting the points of the grid itself...
I am studying for an MSc in AI and I am currently thinking about attending a bootcamp on a computer science subject. The motive is that I want to gain hands on experince on practical applications and the MSc course may be a bit too "academic". The question is: which subjects combine well with an MSc in AI. For example ...
I'm learning LTL (linear temporal logic) and we learned that a model $M$ and a starting position $q_0$ satisfies a LTL formula $\psi$ iff for every path $\pi$ starting at $q_0$ it is true that $\pi \models \psi$. I also learned that the Next ($X$) operator is dual to its negation meaning $X \neg p = \neg Xp$. This conf...
A denotational semantic for the lambda calculus can be given by solving the domain equation $$ D \simeq [D →_c D]_\bot $$ in the category of $\omega$-complete CPOs, where $→_c$ denotes the space of $\omega$-continuous functions. The existence of an (initial) solution to this domain equation is a classic result by Scott...
For the past two days I have been on a question to understand monads in the context of Haskell. A nice explanation I found is by Graham Hutton on the Computerphile channel see here. This explanation has also been paraphrased into this nice answer on stackoverflow. It makes more or less perfect sense to me, but I am hav...
OpenAI's technical paper on GPT-3 says that GPT-3 has 175 billion parameters. Several sites (here, here) claim that these parameters are stored as single-precision floating-point numbers and so require 4 bytes of memory per parameter, but I don't see any citations for those claims. At what precision are GPT-3's paramet...
Are there any references on theoretical computer science aimed at people with a background in research mathematics? For reference, I spend my time thinking about category theory and set theory most days. I've begun programming in haskell and it feels very intuitive now that I'm starting to get the whole 'type' syntax...
( Source: Introduction to the theory of computation, Michael Sipser, 3rd edition ) I know the computation-time of a non-deterministic Turing machine ( NTM ) which is a decider is defined to be the depth of its configuration tree. In the above example of showing that $ HAMPATH \in NP $ , where it's highlighted in red -...
As per the rules of JS, Arrow functions don't have an argument Object, like a regular function inside JS. But it is also true, that we can pass arguments to the Arrow functions like any other functions. What is the data structure at play here, if not an argument object, then how does an Arrow functions references the a...
I would like to understand better how associative memory works.In associative memory we have the tag and the actual data being stored.The tag describes where the data came from but what does this mean exactly?
A $k$-regular graph is one in which every vertex has degree k. A triangle-free graph is one in which any three vertices do not form a triangle. A dominating set $D$ of a graph $G$ is a set of vertices such that $\forall v \in (V(G)\setminus D)$, $v$ has a neighbour in $D$. Is anything known about the hardness of decidi...
I am unable to understand this proof L is recursively enumerable if and only if L is Turing recognizable If anyone can prove this, that would be great help
Algorithms/Data-Structures to calculate transitive call graphs in the presence of virtual dispatch? I am trying to write a program to analyze Java programs and figure out the transitive closure of the callgraph of each main method. Consider the program below: class Foo{ void runOne(); void runTwo(); } class Bar...
Given a spring system: where the total tension between the nodes should be minimized, it seems possible that a physics simulation of this graph does not arrive at the lowest energy state, getting stuck in a local minimum instead. Is finding a positioning of nodes that achieves the lowest energy NP-hard?
I have a question I need to give the NFA of the following language: L={w belongs to (a,b)*/w starts with aa or ends with aa} with or being not exclusive meaning I can have a word that starts with aa and ends with aa. I did this: but if I turn it into the DFA I get this: but with this DFA if we have the word "baab" i...
I've been trying to fully understand the paper "Wide Neural Networks of Any Depth Evolve as Linear Models Under Gradient Descent" (available here), but I'm stuck on the linearization part, specifically section 2.2. The idea is that in the infinite width limit, the individual neural network parameters' changes vanish wh...
My problem is: Given $n$ points in $\mathbb{R}^d$, I want to find a partition of these $n$ points into $k=2$ clusters. For each cluster, instead of computing the centroid as in the usual k-means problem, I construct the one-dimensional subspace (what I call a line) minimizing the sum of squared distances between the p...
In the context of $\mathsf{\#P}$ and $\mathsf{PP}$, we have $\mathsf{\#P}$-complete problems, for example $\mathsf{\#SAT}$, however the version that I saw proves this by showing a reduction that keeps the same amount of results but not the same probability. My question is, is it also complete under probability. What I ...
A total dominating set $S\subset V(G)$ is a set of vertices such that $\forall v\in V(G)$, $v$ has a neighbour in $S$. The minimum total dominating set of $G$ is a total dominating set of $G$ of minimum possible size. The minimum total domination number of $G$ is represented by $\gamma_t(G)$.It is known that MTDS is $N...
If I go into google browser and type in the name of a website, this is the application layer of the OSI. HTTP protocol is being used and is a request-response, so when exactly does my computer send the request to the server and when do I get the response? I understand the encapsulation of data until it gets to the phys...
I need to solve the following type of problem. I have a list of many connected lines forming a closed contour. These lines come as the output of a MarchingSquare algorithm. Consequently they are lines that have their start and end points on the sides of a grid. Furthermore, the lines never intersect except at the extre...
I have a degree in maths and i am interested in learning about Convolutional Neural Networks from a mathematical/ theory point of view. Can someone point me towards some resource. I already have a basic knowledge of Convolutional Neural Networks (and other Neural Networks)
Were w is any string composed over the alphabet $\Sigma = \{0,1\}$. For the first part of the exercise I've tried decomposing the problem into three different ones, mainly the first one is for the string before the 0 the second one for the 0 itself and the third for the rest of the string after the 0. This is what I c...
if by absurdly there is a 3/2-approximation algorithm for INDIPENDENT SET then does there exist a 3/2-approximation algorithm for VERTEX COVER? the implication should be true because independent is reduced to to VERTEX COVER, right?
Edit: Since this post is gaining traction, I feel the need to clarify that the purpose of this is to see if asymptotic and constant factor estimations calculated from high level code implementations of algorithms are reasonable approximations of the true version. I am not trying to predict the speed of code when runnin...
Based on the same question asked here: Bundle diameter calculation algorithm with different wire sizes? Best answer was this: https://scipython.com/blog/packing-circles-in-a-circle/ However, there are wires in electrical design that function as a "twisted pair". Is there a way to alter the existing code above to specif...
In the below Image, S is the starting point and E is the end point. Image link Now, the Title of the video says that its a Greedy Best First Search. However, while browsing stackoverflow, I came across this answer It says that Greedy Search doesn't go back up the tree - it picks the lowest value and commits to that. an...
I have formulated the below optimization problem. \begin{align}\nonumber \hspace{-3mm}&\text{(P) minimize}\!\sum_{i}\!\alpha_{i}w_{i}\!+\!\sum_{i}\sum_{j}\!c_{ij} p_{ij}\!\\ \text{s.t.} & \sum_{i}\! p_{ij} = 1 , \forall(j) \in \mathcal{J}\\ & \sum_{j} d_j p_{ij} \leq b_i w_{i} , \forall(i) \in \mathcal{I}\\ & p_{ij} \i...
If an optimization problem A is NP-hard and P≠NP, then does there exist an instance x of A such that no polynomial algorithm provides an optimal solution for x?
What I mean by this, is let $f \in GapP$, and let $k_n =min\{k|\forall x (s.t. |x|<n):2^k > |f(x)|\}$ for every $n$, can I assume there is a nondetermenistic machine $M$ that on input $x$ does at most $k_n$ coin tosses with results in $\{0, 1\}$, and that for every $x$: $f(x)=\#(M(x)=1) - \#(M(x)=0)$, where $\#(M(x)=a...
I'm new to computing and even newer still to AI model training. However I am wondering the role of the CPU during training of LLM. I'm aware that the CPUs are good for performing strings of complicated tasks one at a time while the GPU's parallelisation means that it can perform mutiple less complicated tasks at the sa...
I have this rather weird CPU architecture for which currently only an assembler exists. I won't go into too much details about this architecture as it is not publicly available. However, some quirks of it are: It can only address full 32 bit words in memory No shift operations No internal registers. It fully operates ...
"A galactic algorithm is one that outperforms any other algorithm for problems that are sufficiently large, but where "sufficiently large" is so big that the algorithm is never used in practice." Strassen algorithm works in $O(n^{2.8074})$. There is also the Coppersmith–Winograd algorithm which runs in $O(n^{2.37188})$...
I am trying to find the first and second-order partial derivatives of a function of four variables $S$ using pythons symbolic math package sympy. The issue is that sympy does not automatically see that certain pairs of partial derivatives, when evaluated at the same arguments, are in fact equal, and so cancellations do...
I need to find the empirical mode of a sample of numbers taken from a continuous distribution (i.e. floating-point data). I can think of using an histogram, but choosing an appropriate bin size does not seem so easy. I could also count the values in a sliding Parzen window, but again, which window size ? I could also c...
I am unable to get the bound on the maximum size of a graph of order $n$ with girth $g$. Is there any literature regarding this. I know that there is an asymptotic bound on the size of a graph $G$ with even girth $2k$ and order $n$. Is there a similar one for arbitrary grith? Thanks beforehand.
Given the SMALL FACTOR problem where: INPUT: an integer N and an integer k OUTPUT: yes ⇐⇒ N has a prime factor ≤ k. I know that SMALL-FACTOR problem ∈ in NP ∩ CO-NP. If it were NP-Complete we would have that CO-NP=NP. So how can I answer the above question?
When I calculate the entropy values of files compressed with Gzip, PKZIP, 7ZIP and Winrar, I find that the compression rate of Gzip is higher than the others. The entropy value is higher (indicating less redundancy) and the file size is smaller. Even for small files, the overhead of Gzip is lower compared to the other ...
It is related to this question: https://leetcode.com/problems/product-of-array-except-self/ And assuming we cannot alter the original array, but have to allocate a same size array to store the results, that is, if the input array is 200GB, we need to allocate a 200GB array. Input 800GB, allocate extra 800GB. Input 16TB...
I have a friend who works in education. Sometimes, they need to create customized "word lists" to help students practice reading. These lists are limited in length, and must contain sufficient instances of specific orthographic properties (at least 5 2-syllable words, 3 closed syllables, etc.). I've formalized the prob...
I have a problem that I am trying to model, but I am unable to capture one particularity of the system that seems to be crucial. I will try to give an abstract description first and then the toy model hoping that someone might have an idea or a reference suggestion. Description: There is a system and I can observe one ...
Sometimes as a hobby I like to think about different possible "fundamental" abstract computing frameworks, akin for instance to Turing Machines and Lambda Calculus. In particular, I've been interested in conceptions in which a small set of 0-argument functions themselves comprise the input/output/alphabet. I ended up t...
Find an asymptotic tight upper bound for the following recursion relation: $$T(n)=5T(\frac{n}{5})+\log^2(n)$$ I tried to solve it by applying iteration: $$T(n)=5T(\frac{n}{5})+\log^2(n)=5(5T(\frac{n}{5^2})+\log^2(\frac{n}{5}))=\ldots=5^kT(\frac{n}{5^k})+\sum_{i=0}^{k-1}5^i\log^2(\frac{n}{5^i})$$ Now letting $5^k=n$, ...
In maximum flow if you have double(antiparallel) edges you just add an intermediate node and break the edge in two with the same capacity. In minimum cost flow you can do the same but break the cost also in half or use div to break in half if not even(if cost is 9 for example you break it in 5 and 4). Is this a correct...
Take the Erdos-Renyi random graph $G(n,p)$, i.e. the random graph with $n$ vertices and where each possible edge has an independent probability of $p$ of being present. Recall that a $k$-matching is a disjoint union of $k$ edges. Let $X$ be a random variable equal to the number of subgraphs in $G(n,p)$ which are isomor...
How to find and return the maximum number of edge-disjoint trails of equal length $k$ of a directed weighted multi-graph $G=(V,E)$ between arbitrary start and end vertices? The start and end vertices may be different for each trail, although they need not be different. (I'd like the output to be the paths themselves,...
If P=NP then we have W[1]=FPT. Would it just imply $k$-sum conjecture fails for some large $k$ or $k$ can be as small as $3$?
I came across this language, where M denotes a Turing Machine: PALINDROMES $:= \{M \mid M \text{ accepts strings which are palindromes}\}.$ It is proven to undecidable. And, I know one can construct a Turing Machine that decides for strings, if they are palindromes or not. Further, a set A is decidable if and only if t...
If you were to define an altered AVL tree where the balance factor (the difference between the height of the left and right subtree) of a node must be less than or equal to the depth of the node (in absolute value), would it be balanced (h is in O(log n))? How would you prove so?
Schaefer's dichotomy theorem ensures than when a constraint satisfiability problem satisfies certain conditions, the problem is either in $\mathsf P$ or is $\mathsf{NP}$-hard. Suppose the following problem: Given a monotone CNF $f(X)$ and a 2-CNF $g(X)$ such that $|g(X)|\le \log_c^k |f(x)|$ (where $|f|$ stands for the...
How to construct DPDA for the following language $L=\{a,b\}^* \setminus a^nb^n \setminus b^na^n $ $L_1 = \{a,b\}^* \setminus a^nb^n =\{a^i b^j \, | \, i>j\}\,\cup\,\{a^i b^j\ \ | \ i<j\}\,\cup\,(a+b)^* b (a+b)^* a (a+b)^*$. At this step I got stuck. What is next? How to express additional difference $b^na^n$?
I'm studying recursion and a i have a doubt about the running time complexity of the binary search. I didnt understand this passage in my book : Initially, the number of candidates is n; after the first call in a binary search, it is at most n/2; after the second call, it is at most n/4; and so on. What if n is a odd ...
A central insight of Dijkstra's shortest path algorithm is that every subpath of the shortest path is also the shortest path of the subgraph. But is that also true for the longest path? In particular, I want to find the longest path of a DAG, and I don't know if it's completely different. My problem is to find the long...
I was wondering whether the transpose of graph maintains the same size of the minimal cut in a directed graph (digraph). This may be trivial as I haven't been able to find anything here or on Google when searching for different variants of the query "directed graph transpose minimal cut preservation\conservation". I de...
I'm pretty beginner in Coq. I want to formalize negative and positive occurrence of an atom in a proposition inside coq the definition is as down below: I want to define this property as an Inductive prop so I use it with more ease in proving theorems (such as interpolation) but the problem is positively occurrence an...
We refactor code lots of times as developers. Metaphorically, our program space is an infinite-dimensional Rubik's cube. Things can be rearranged, preserving the code's action, so a "symmetry structure" is at play. You can do things in code that can be factored sort of like distributive law in a ring, but there are w...
Given an undirected graph $G$, how to reduce this problem :"Judge whether every edge of $G$ can be given a orientation such that for every vertex $v$ in $G$ has input-degree of at most $k$" to a max flow problem? I tried the method in this link where input or output degree are the same because we can change all the ori...
Recently, I have taken a Computer Science exam for the course Operating Systems. One question was as follows: Which statements about real-time operating systems are true? I selected two options, but according to the exam answers, three options were correct for this question. The following option is also correct (quot...
With regards to algorithms does anyone could explain what's exactly a free-primitive? By chance is a free-primitive any kinda sorting? I've read about that from book Algorithms Illuminated Part 1: The Basics by Tim Roughgarden page 31.
Strong Exponential Time Hypothesis states that general SAT, where clauses are not limited in length, can't be solved in time $o(2^n)$. It's proven that DPLL algorithm requires $\Omega(2^n)$ time in the worst case. CDCL algorithms, however, use more sophisticated approaches to SAT solving, primarily by using partial ass...
Google DeepMind recently published a new paper which describes how they used a reinforcement learning to discover faster sorting algorithms. A summary of the paper is here and the paper is here. It appears the reinforcement learning model is trying to write list sorting functions in assembler which are correct and effi...
Wikipedia shows graph width $k$ as the degeneracy, an ordering of the vertices $v_1,\ldots , v_k$ for which, if we orient each edge $(v_i, v_j)$ towards $i$ where $i<j$, the maximal degree is at most $k$. However, I recently came across another definition: A graph $G = (V, E)$ has width $k$ if there exists a (vertex d...
I'm trying to solve the project planning problem using DLX and exact cover matrix, but I'm struggling to find the set of constraints (columns) and the set of options (rows) to achieve this. Here is a sample that represents the main constraints of the problem. Each project have a set of tasks $\{T_1, T_2, T_3\}$ Each p...
Let $n$ be the minimum possible size of a 4-regular graph with girth $g$. Consider a graph with a minimum degree of at least four with girth $g$, can I say that the size of such graph must be at least $n$ (as each vertex has at least four neighbours, making the graph more denser than a 4-regular graph; hence, in order ...
Note: This question assumes familiarity with cons-style linked lists (e.g., from Lisp or Scheme). It also assumes familiarity with snoc-style lists. Snoc is like cons, except it appends elements to the end of the list, instead of the beginning. A cons is car/cdr pair. Alternatively, some people use the terms head/ta...
Thanks in advance for assistance and patience with my hardware naivety Reading the below answer about the NMI on pin 6 for an Apple 6502, and the signal on the pin falls from high to low, how does this get recognized by the edge detector to CPU food chain? Is there "hardware polling" (each cycle check/read a bit, chec...
I want to find "interesting" elements in a sequence of symbols that are independent of their absolute position in that sequence. Formally, I have a window size $s \in \mathbb{N}$ and a finite alphabet $\Sigma$. I'm looking for a function $f: \Sigma^s \to \{0, \; ..., \; s\}$ that points to the first interesting positio...
Is there a proven upper bound on the number of possible sorting algorithms that cannot be reduced to another sorting algorithm? Sorting algorithms with "useless steps" wouldn't count because they can be reduced by removing the useless steps. I define a "useless step" as something that can be removed from the algorithm ...
I'm reading the chapter Radix Search of the book Algorithms (Robert Sedgwick). I've made a simple implementation and something isn't behaving as expected. In program 15.5 you can see that we start with an empty tree where the head is a null node. In figure 15.12 you can see that the null node is always the leftmost nod...
Imagine there's a boat with a fixed number of seats. The boat goes on a journey with n number of stops. Here is a diagram of the journey where n = 4 The squares represent a stop. The lines represent a trip. Trips occur from each stop to every other stop that comes after it. People may go onboard at the start of a trip...
I'm trying to do some research on graph search algorithms that are practically fast on relatively dense graphs. Besides the common ones like A* or Dijkstra's, what are some graph search algorithms that give a good enough jab at the shortest path while having performance advantages compared to Dijkstra's? The graph is w...
I have a grid of cells, X cells wide by Y cells high. Each cell has four corners, NW, NE, SW and SE. Each corner is shared with adjacent neighbors; i.e., a cell's SW corner is the NW corner of the cell just below it. In any grid of (X,Y) cells, there are (X+1,Y+1) corners. In this grid, each corner can be assigned an a...
I am working on Ramanujan graphs and have encountered something that needs a suggestion. Does the girth of a Ramanujan graph change if I delete one random edge from the graph? The question can also be as follows: are there at least two edge-disjoint shortest cycles in Ramanujan graphs? If yes, the girth does not chang...
In my reference, Exercise 0.4(e), Algorithms by Sanjoy Dasgupta, Christos H. Papadimitriou, and Umesh V. Vazirani, it is given that $$ \begin{bmatrix}F_n\\F_{n+1}\end{bmatrix}=\begin{bmatrix}0&1\\1&1\end{bmatrix}^n\begin{bmatrix}F_0\\F_1\end{bmatrix} $$ Prove that the running time of $fib3$ is $\mathcal{O}(M(n))$, wher...