instruction
stringlengths
35
29.1k
I am given 2 sets of n 2D Points. I need to find the segment set S where each of the n segments has its start and end in the first and second set respectively. The requirement is that each point must be used only once and that the set S must be the one with the lowest number of collisions between each pair of segments....
I read that it is undecidable whether, given a CFG $G$, $L(G)$ is regular. And there exists no algorithm that, given a CFG $G$ such that $L(G)$ is regular, outputs a DFA that accepts $L(G)$. My question is, why is regularity decidable for DCFLs and undecidable for CFLs?
I am creating a class to store large integers in a residue number system. I want each "integer" to be 4-12GB in size and be comprised of 64-bit moduli. These moduli must be pairwise coprime to each other. However, in order to maximize the maximum integer I can store, I want the average moduli to be at its greatest. I c...
You know that Rice theorem is applicable to check decidability of RE language. Also we know that all regular, deterministic context free, context free, recursive languages are RE languages. $Q_1:$ So my question is that could I apply Rice theorem to check decidability of for example emptiness, membership etc of CFL lan...
I have a set of objects and a set of comparison results for some of them. I want an algorithm that returns the next comparison I should make to two objects towards having a way to know the full order of all objects. If the order of all objects can be already known I should get the objects ordered. Requirements: ask for...
I know from [1] that the lower bound for the maximum hitting time of simple random walk on a dynamic graph is $\Omega(2^n)$. Smoothed analysis has been applied to the maximum hitting time [3] and gives us a $k$-smoothed lower bound of $\Omega(n^{5/2}/\sqrt{k}\log{n})$; a significantly weaker lower bound. In [3] they gi...
My definitions of reliability and availability are as below respectively . reliability := property of failure interval . availability := property of occupancy rate . I want to show the differences between reliability and availability using some example but currently I've been failing to come up with it . I came up with...
urestricted -> turing machine context-sensitive -> linear bounded automaton (LBA) context-free -> pushdown automaton (PDA) regular -> finite state machine Hi, I am kind of confused about relation between LBA and PDA. Is the stack in pushdown automaton bounded (not using infinite space)? If not, how can a LBA ac...
Recently, I came across several parameters of graphs. So I know in general graphs, it might be hard to compare between them, but I'd like to try and see which upper/lower bounds can be made. Some parameters are: arboricity $a(G)$, maximal degree $\Delta(G)$, degeneracy $d(G)$, minimal degree $\delta(G)$, chromatic numb...
Recently I'm studying 3SAT problem, which is a NP-complete problem. I feel that it's easy to find a boolean formula which is satisfiable,but how about boolean formulas which are unsatisfiable, namely 3-co-SAT problem. Can you help me provide some examples of 3-co-SAT? The definition of 3SAT problem is supplemented here...
Membership problem of Recursive languages are decidable. My approach: Let $L$ be a recursive language and $M$ be the Turing Machine that accepts it. For string $w,$ if $w ∈ L,$ then $M$ halts in final state. If $w ∉ L,$ then $M$ halts in non-final state. (halts always!). That's why Recursive languages are decidable fo...
I'm stumped on how you would describe a language which is a* except for aa, so the following is acceptable: a aaa aaaa aaaaa ... It's for part of the below DFA
I have a collection of points $C := \{x_1, \ldots, x_{60 N}\}$ in 3D space. I am looking for a partition of $P$ of $C$ with the following properties: Each of $P$'s sets contains $60$ points, i.e., $P = \{p_1, \ldots, p_N\}$ where $p_i = \{x_{j_1}, \ldots x_{j_{60}}\}$. The set of centroids $\{c_1, \ldots, c_N\}$ where...
Background: I'm trying to solve this leetcode problem: regular-expression-matching. My approach is to implement a LL(1) parser generator, might be overkilling for this problem but it's just a brain exercise. I only have entry level knowledge of parser theory, so excuse me if this is a silly question that I ask. So, the...
I have a set of variables $\{x_i\}$ that I want to optimize according to some objective function. However, I would like that $$(x_i-x_j)^2 \geq d^2\ \ \ \mathrm{for\ all}\ \ \ i,j$$ Which is a lower bound quadratic constraint, turning the problem non-convex. Is there anyway to formulate this constraint to be convex, fo...
I have seen proofs of this particular problem in a few articles/papers (which lead to a ZKP 2 nuclear warheads are similar), but I find a problem in the proof with the marbles - surely the proof doesn't work because the experiment cannot be repeated. Proof outline: The prover claims a pair of cups each contain $n$ mar...
Yesterday I came up with a divide-and-conquer algorithm about all subarrays of length k of an array of length n. Outline: function solve(array, k): if array shorter than k: return default value left = solve(left half of array, k) right = solve(right half of array, k) middle_crossing = combine(left hal...
What are some ways with which we can improve the speed of dynamic RAMs?
Given a set of strings, and a pattern - we want to compute the subset of those strings that have that pattern as a subsequence (not substring). Everything I've read of suffix trees refer to computing substring, not subsequences. Are suffix trees appropriate for matching subsequences as well? Or are there better datastr...
I'm having trouble understanding why RB tree insertion is called more effective in all sources. It's said that AVL trees require "more rotations" than RB trees, but from what I've learned I can't see it. AVL trees always require one or two rotations, after which the affected subtree gets rebalanced and therefore the wh...
Consider as an example the following setting. A set of universities want to keep track of the joint list of students. Ideally, each university will have a "consistent" copy of this list, and whenever some student joins/leaves any of the universities, all the lists get updated accordingly. Alternatively, we may consid...
Suppose we have matrices $A_0,⋯,A_{n−1}$ (you can say $n $ matrices). Matrix $A_i$ is with dimension $d_i\times d_{i+1}$. If we would like to find all possible permutations to find the best parnthesization possible, that would take $4^n$ time complexity, any idea here please? For example, $B$ is $3x100$, C is $100 \tim...
Let $S= \{ b_{11}, b_{12}, b_{21}, b_{22}, b_{31}, b_{32},\dots, b_{n1}, b_{n2} \}$ be a set of $2n$ balls grouped in $n$ pairs, and $T = \{ B_1, B_2, \dots, B_m\}$ be a set of $m$ bins with capacities $\overline B_{1}, \overline B_{2}, \dots, \overline B_{m}$, respectively. Considering that each ball is stored in exac...
If you take Brainfuck and modify '<' to move the tape head to the beginning of the tape, would this modified Brainfuck still be Turing complete? It feels like it should be, but I can't wrap my head around how you'd emulate a Turing machine using (or proper Brainfuck for that matter). It feels like you'd need to come up...
In integer-only computation, a fraction like 5/2 is rounded down to 2. Is this any extra work at the ALU level, or, is the way it does division, at the level of logical gates, automatically outputting the rounded down result as standard?
I read from this question that counter automata is a push down automata with only one symbol allowed on the stack (plus a fixed bottom symbol). My question is counter machine means counter coexist with stack? I mean "DFA $+ 1$ counter" is same thing with "DFA $+1$ stack" . For example to generate this language $\{a^n ...
Say I have two sets of intervals sorted by time $I_1=[(x_1, y_1),... (x_n, y_n)]$ and $I_2 = [(a_1, b_1)... (a_m, b_m)]$. where $x, y, a, b$ are times in seconds. None of the intervals within $I_1$ intersect, i.e. $x_1 < y_1 < x_2 < y_2 < x_3....$ and same holds for $I_2$ $a_1 < b_1 < a_2 < b_2 < a_3....$ There is howe...
Clark et al. proved that the clique problem is polynomial-time solvable in unit disk graphs. Does anyone know if this result holds still if the disks are allowed to be different sizes? Or do such "non-unit disk graphs" in fact constitute all graphs, and thus the clique problem is NP-hard again? (I've been able to draw ...
If you have a Boolean function $f: \{0,1\}^n \rightarrow \{0,1\}$ on $n$ variables, you can represent this function as a $2^n$ vector indexed by the input space such that $ f_x = f(x)$. For concreteness I assume that $f$ is ordered as 00, 01, 10, 11, etc. Is there an easy way to tell if $f$ is has full degree? For most...
The universal Turing machine is the standard theoretical model of a stored-program computer. While in one sense as general as possible (Turing completeness), it doesn't explicitly contain many of the more advanced features of real-world/practical stored-program computers and their operating systems that have been devel...
Suppose L is a regular language over the alphabet $\Sigma$. I need to prove that $$ L'=\{x_0\cdots x_n:x_0x_0x_1x_1\cdots x_nx_n\in L, \ \ x_i\in \Sigma\}$$ I thought I could take a DFA which computes L, and take each accepting state, together with the state before it along an edge labeled 0, and the state before that ...
I would like a hint for this homework question. The problem is to come up with a divide and conquer solution for finding the maximum sequence of 1s in a given a binary matrix of order $n$. The sequences can only happen horizontally or vertically. I know the naive solution for this that consists of going through the row...
I need an algorithm that can take an uncompressed audio file and determine the frequencies of the sounds represented by the audio file. (Let's say there are at most 6 sounds as an example)
Given complete metric weighted graph $G=(V,E)$ with $n$ vertices. Are there an algorithm that partition $G$ into to disjoint part $(C_1,C_2)$ that sum of heaviest edge $e\in C_1$ and heaviest edge $e'\in C_2$ minimized? I seek for a paper that include an algorithm for above problem that run it's algorithm in $O(n^2)$,...
I'm making an application of MobileNetV2 and according to their article: We train our models using TensorFlow. We use the standard RMSPropOptimizer with both decay and momentum set to 0.9. We use batch normalization after every layer, and the standard weight decay is set to 0.00004. Following MobileNetV1 setup we use ...
Context-sensitive languages have context-sensitive grammars, and context-free languages have context-free grammars. Using context-free grammars, we can decide the finiteness and emptiness of context-free languages. Why can't we decide these properties of context-sensitive languages in the same manner, using context-sen...
I would like to know the best way to approach the time complexity analysis of the following algorithm. I have come up with 2 approaches so far. We have a std::map<int,vector<int>> (Balanced Binary Search Tree). Each of the std::vector<int> will be called a route. Algorithm: 1. while(true) 2. We pick the first two route...
Here is the grammar given on the wikipedia: $$ S \rightarrow T \;|\; U \\ T \rightarrow VaT \;|\; VaV \;|\; TaV \\ U \rightarrow VbU \;|\; VbV \;|\; UbV \\ V \rightarrow aVbV \;|\; bVaV \;|\; \epsilon $$ I can understand how $V$ generates strings with equal number of a's and b's. I want to prove that $T$ g...
We know that RE language is the collection of unrestricted grammar which is known as type-0 grammar that's why emptiness, finiteness of every RE languages is undecidable. My question is how I check decidability "the Turing machine makes move left or not" on particular input string. I have found some internet contents ...
Given a context-free grammar $G$ for a language $L$, where $L$ contains strings of length greater than 2, show that there exists some context-free grammar $G'$ which generates $L$ such that every rule of $G'$ has the form $$A\to x_1 x_2$$ where $x_i$ is either a terminal or non-terminal and $A$ is a terminal. I know ...
Why timeout in TCP is not a predefined fixed value? I know there is a set value of 15 for a timeout value but I was asked why timeout in TCP is not a predefined fixed value which I couldn't find an explantion for.
A. routing B. flow-control C. congestion control D. All of the above My guess is flow-control only because routing and congestion is part of the network layer. The network layer is the third later and it provides data routing paths for network communications. I'm still not sure if I am right though.
I am looking for a list of algorithms that depends on sorting / relative ranking / argsorting, not for a list of sorting algorithms. I want to study and illustrate the importance of fast sorting in other algorithms. I am looking for something rather exhaustive (or at least covering my - not so - niche field: data scien...
I have been asked to write an algorithm which determine whether a DAG is semi-connected. (Recall that a DAG is semi-connected if for any pair of vertices $x,y$, there is either a path from $x$ to $y$ or a path from $y$ to $x$.) My idea that that a DAG is semi-connected iff it has a unique topological sort. Therefore, I...
In graphs with odd cycles, the maximum weight of a fractional matching may be higher than that of a standard matching. For example, in a cycle of length 3, where all edges have weight 1, the maximum-weight matching contains a single edge so its weight is 1, but the maximum-weight fractional matching contains 50% of eac...
Suppose $L_1$ is reduces to $L_2$ in polynomial time, $L_1\leq_p^\mathsf{}L_2.$ we know that if $L_2$ is RE then $L_1$ is also RE and $L_2$ is REC then $L_1$ is also REC. And also I know that if $L_1$ is REC then $L_2$ is RE and REC is false. Because by taking counterexample $L_1=\emptyset$ and $L_2=$halting problem....
I'm asked to write an algorithm which determine all points which appear in a "edge-simple" path connecting node A and node B, i-e a path which doesn't go 2 times in the same edge, but it can go multiple times through a same node, including node A and node B. In this simple example, with node A=0 and node B=1, all point...
What are some nice/natural examples of languages not contained in $P/\mathit{poly}$, preferably decidable ones? I'm interested in unconditional results rather than examples such as the Karp–Lipton theorem, which states that SAT is not in $P/\mathit{poly}$ unless the polynomial hierarchy collapses.
t <- n while t>1 do t <- log_2(t) I tried to do it this way: $f^\text{(1)}(t)=\log_2(t) \\ f^\text{(2)}(t)=\log_2\log_2(t) = \log_2^{(2)}(t) \\f^\text{(3)}(t) = \log_2^{(3)}(t) \\ f^\text{(j-1)}(t) = \log_2^{(j-1)}(t) \\ f^\text{(j)}(t) = \log_2\log_2^{(j-1)}(t) = log_2^{(j)}(t) $ I consider $f^{(j)}(t...
please help me with this one. (a formal answer would be much appreciated) ∀L1, L2 ⊆ Σ: (L1 · L2)^c = L1^c · L2^c when · represents concatination and ^c the complement language. do not know if languages are regular. Thank you
In several proofs of the expected lookup length in an open addressing hash table, an assumption is made (which is said to follow from the "simple uniform hashing assumption": Given a hash table with n slots and m keys in it, the probability that any particular slot is occupied is m/n. I'm having difficulty creating a...
Suppose we have the following equation: $$k_{i + 1} = (k_i + 2i + 1) \bmod{n}, \quad k_0=k, \quad i\ge 0$$ Show how we can we replace the mod with one comparison and occasional subtraction. Attempt: I understood elsewhere that occasional here doesn't mean one subtraction. So, to replace modulo, the only way that I un...
Depending on where I look, some places (https://courses.engr.illinois.edu/cs473/sp2009/notes/19-maxflowalgs.pdf) describe EK algorithm as choosing the st path with largest bottleneck value, while others (wikipedia) describe it as the shortest path from $s$ to $t$. I'm not sure if they are the same, and I haven't been a...
Imagine we are running a program on a modern operating system, such as Linux or Windows. After running for some time, the program's time slice is up. A different program (process) starts to run again. That is, we have had a context switch. During a context switch, does the MMU have to be updated? Maybe what I am really...
I'm stuck on this proof for the theorem eqblist_true. So far what I have is: Theorem eqblist_true : forall l1 l2, eqblist l1 l2 = true -> l1 = l2. Proof. intros l1. induction l1 as [| l1']. - intros l2 H. simpl in H. destruct l2 as [| l2']. + reflexivity. + discriminate H. - simpl. intros l2...
How would you get an optimal schedule to solve matrix chain problem where you only need to obtain the diagonal? (assuming the resulting matrix is square) First computing the matrix product and then extracting the diagonal can be suboptimal. Consider diagonal of outer product of two vectors uv'. We could get the diagona...
Given that $A$ is $NPC$ problem. And I need to check "if $D$ belongs to $NP$ and $D\leq_p^\mathsf{}A$ then $D$ is $NPC$" is true or not? My approach: Since $D\leq_p^\mathsf{}A$, therefore $A$ is at least as hard as $D$, and given $A$ is $NPC$, consequently $D$ could be like easy problem $P, NP. $ And to prove $D$ is ...
I have two PDAs one with $\{a^i b^j \mid i > j\}$ and the other $\{a^i b^j \mid i < j\}$. I know how to combine these two PDAs non-deterministically. My question is how do I combine these two PDAs into one deterministic PDA? What's the process and could I get a visual example of how to do it?
Are they exactly 32bits for a 32-bit CPU?
Googling "large horse walks into house" also returns results that contain "large horse in a house" and "the house has large horses". How is Google able to return near-matches and not just direct matches? What are the methods that search engines use to perform such queries so quickly? I know about phrase search and prox...
Are they exactly 32bits for a 32-bit system ?
In the papers introducing The Bandit Gradient Algorithm as Stochastic Gradient Ascent, the following relationship: is always considered as a preliminary and lacks proof for it. Does anyone know how does this relationship come about? ($\pi_t(x)$ is the probability of choosing action $x$ at time $t$ and $q_*(x)$ is the ...
I'm trying to see if the language $L/w = \{x\mid wx\in L\}$ is regular given that $L$ itself is regular. It seems to me that if $L=L(A)$ for the NFA $A = (Q, \Sigma, \delta, S, F)$, then the NFA $A'$ should accept $L/w$, where $A' = (Q', \Sigma, \delta', S', F')$. Each component is defined as: $Q' = $ all states in $Q...
QUESTION: Can we Implementing priority queue with hash table please? As I understand, dictionary/hash table does not have sorting mechanism inside. It adds pairs of $<key,value>$ to hash table. So the keys in PQ would correspond to keys in hash table, however, keys are added such that elements are assigned a priority (...
I will be working on a project soon and as I'm clearly not a star (see what I did?) in CS, I'm not sure what to think about this. To put it simply, the problem is the following: We want to go from point A to point B, nice and simple, we can easily find the shortest path. Each cell on our grid has a certain value, let'...
I recently learned AVL Trees but I still lack a complete understanding of the concept. I understand that an AVL tree is a Binary search tree that checks for the height of the tree, but I still don't understand how I would apply that to the question. Any help is appreciated!
I have been asked as an exercise how to prove that this is not a regular language. first I tried to use the pumping lemma, but I got stucked. Th erxercise hust said to prove thata this isn't a regular language, I would appreciate if the answer could e given step by step, I really wnat to understand how it works . Thank...
Given a simple graph $G(V,E)$, what is the LP formulation for the minimum edge covering? Minimum weight edge covering would also work here. If there are none, then that is an answer too. I took a class on Theory of Algorithms and Operations Research last semester, and remembered there was an IP formulation for the mini...
I am working on some binary-search-tree research and was surprised to find no mention of an algorithm to join two Scapegoat Trees. This is where two trees $L$ and $R$ are joined to create a single tree $T$, given that all values in $L$ are less than all values in $R$ and that all values are unique. For this problem, th...
There is a lot of information on time complexity analysis. For example, we know that for calculating the time complexity we study the number of operations (e.g. traversal, swapping, comparisons etc.) an algorithm performs. I have not been able to lay my hands on the considerations for space complexity analysis. Q) Wh...
I would like to clarify to myself the way that an algorithm that proves the statement in the title works: I think the idea should be like this: We assign the input values to the bit nodes We calculate the incoming edges values for each logical operator node We finally get to the output node, and we have our result Wh...
I have a directed graph $G$ with a set of nodes $N$ and a set of edges $E$ with the following property : if $(A\to B)\in E$ and $(B\to C)\in E$, then $(A\to C)\in E$, for all nodes $A,B,C$. I would like to find the subgraph $G'$ with the same set of nodes $N$ and a set of edges $E'$ such that: The "connectivity" (not ...
I have recently read the definition of $coNP := \{L \ \mid \ \overline{L} \in P\}$, where $L$ denotes a language. However, I am wondering what the difference between $P$ and $coNP$ is, since an elementary result of the theory of Turing Machines is that if $L \in P$, then $\overline{L} \in P$. So is $P = coNP$ or is the...
I am wondering why the following "proof" of $coNP = NP$ does not work: $\subseteq:$Let $L$ be a language in $coNP$, that means there is a non-deterministic Turing Machine $M$ that decides the complement of $L$, denoted by $\overline{L}$, in polynomial time. Then the Turing Machine $N$ that decides $L$ in polynomial tim...
how can you find if a regex call is a subset of another regex call on an predictable set of data I have a string (chess Forsyth–Edwards Notation (FEN) stringrnbqkbnr/pppp1ppp/8/4p3/3P4/8/PPP1PPPP/RNBQKBNR w KQkq e6 0 2) If I use /(.)/g it matches the super set of any possible chess position, i.e. /(r/)/g matches r/ , a...
I recently learned about the one-way 2-party model of communication complexity in some lecture notes. It seems that all algorithms studied in this model are either deterministic or randomized Monte Carlo, i.e., they fail with some nonzero error probability. This made me wonder if there is an obvious reason why we don't...
Without restriction (e.g. continuity or convexity are not guaranteed), we're given an W x H raster-based shape that needs to be placed on an infinite tiling of M x M squares. The shape can placed at any integer positional offset within those squares. The goal is to minimize the number of squares containing any part of ...
I came across this post about how we can get to all shortest paths from source (u) to destination (v) . If the algorithm is working in O(E + V), why can't we use it (after slight modifications) for weighted graphs? Why do we use a priority Queue in Djikstra's Shortest path Algorithm?
I just read this Why doesn't Python need a compiler? I know that Python isn't absolutely compiler or interpreted but it is both of them it's maybe an interpretive, high-level, and all-purpose programming language. Python uses PVM(interpreter) and Bytecode(that is output of a compiler). after all, why do we classify Pyt...
I am looking to prove the following: Each binary tree with $n \ge 2$ nodes has an edge whose removal results in two trees, each having at most $\lceil (2n-1)/3 \rceil$ nodes. I am not sure how to approach this, or find some way to detect such an edge. Would appreciate any hints.
How to find a saddle point in a binary tree. where saddle point is a node in a tree whose value = min(the node and all its ancestors) = max ( the node and all its descendants)
My question I have two complexity classes, $L$ and $Mod_kL$. I'm confident these classes satisfy $L\subsetneq Mod_kL$, as I'll explain below but you can take for granted for a moment. From these two classes I defined new classes, by allowing arbitrary processing of half the inputs for some fixed partition of the inputs...
Can there be a computer without software (only hardware) which can produce meaningful output? "Software" would be for example an operating system (whether in the level of "firmware" or not). "Meaningful output" would be for example anything useful for the user, but a practical example might be the solution to any "mat...
Question: Describe an efficient algorithm that, given a set $\{x1, \cdots, x_n\}$ of points on the real line, determines the smallest set of unit-length closed intervals that contains all of the given points. Attempt: If we sort the points in any order we would like to start with, we will get $S=\{y_1, \cdots, y_n\}$. ...
I was reading distributed algorithms (by Nancy lynch) and there is a part that I would kindly like to get a simpler explanation for. I know the book mentioned no algorithm can solve mutual exclusion between n processes with less than n variables. But I fail to fully understand the proof, can someone please give a sligh...
Question: Given integer $n \geq 2$ and two lists of size $n$, $A$ and $B$, of non-negative integers, determine if there exists an $n \times n$ matrix whose $i$-th row has $A[i]$ $1$s and whose $j$-th column has $B[j]$ $1$s. If it does exist, then find it. My attempt: An extremely inefficient algorithm would be to fin...
This is my homework question Given an array A[1..n] of n integers, we want to decide if there exist i and j, where 1 ≤ i , j ≤ n, such that A[i] + A[j] = α for a given value α. Give an O(n^2) algorithm to solve the problem. Can anyone understand what the question like to ask?
Can someone please give me an example of two algorithms, one where "Big-O" is the most appropriate expression of how time complexity grows with input size, and one where this would be Θ? Can you please be very clear about whether the statements refer to best, average or worst case, and about implicit assumptions about ...
Given a 3SAT problem with the additional constraints that: No clause or set of clauses is the 3SAT instance is 'redundant'. Thus, this 3SAT cannot eliminate any clauses. For any/every clause, the triplet of 3 variables in it are guranteed to occur in at least 1 other clause. What is the computational complexity of ...
Assuming we have a K-Partite DAG (edges are directed from one level to the next) with edge weights either 0, 1 or 2. We are looking for the shortest path between a node from group 0 to group k-1 (path of length k). Is that correct that the algorithm will pick a path with minimal number of edges of weight 2? If so, how ...
I've taken the following steps to prove that the minimum pumping length (PL) of the above language, $L= 01^*0^*1$: Set a PL. I chose $p=2$ Choose a string from $L$ where $|w|\geq p$, I chose $w=011$. $|w|=3 \geq p=2$ Split the word, $w$ into constituent parts, $x,y,z$ such that the following are true: $y\neq\varepsi...
Actually, I know that there are many examples showing how this is a contex-free language, but I can't find any that show it isn't regular. I would appreciate if I could have a solution step by step for this case Show that {xy : x,y ∈ {a,b}*, |x| = |y|, x ≠ y} is not a regular language
I'm new here on the site, I'm a final year student in computer science. In a machine learning course, there was a question on a test that I could not understand. The question goes like this: Suppose that $ F\subseteq\{0,1\}^\Omega $ is some collection of Boolean functions over $\Omega $. Define $\Omega'=\Omega\times\{...
Are there any methods for computing the "similarity" between two algorithms? Intuitively, selection sort and merge sort are more similar to each other than merge sort and radix sort. I want a formal method that computes an algorithm similarity metric. I know similarity is vaguely defined here. I'm interested in any pub...
What algorithm can be used to find a balanced edge in a binary tree? If we remove that particular edge, the tree is split up nearly equally. Each tree will have at most $\lceil{(2n-1)/3}\rceil$ nodes.
I am looking at a variant of TSP in which rather than visiting every node, there is a given collection of (possibly overlapping) subset, and the salesman must pass through one node from each subset. Concretely, I have a graph with vertices $V$ and a family of subsets $S = \{S_1, S_2, ..., S_n \}$. I'm looking for a sim...
We all know that the RUN Time of most of our program are Big O of linear time, quadratic time, cubic time or log time. But Can this be in unusual or uncommon poly time like $x^6-y$ or cosine function time ?
I wish there were more, but the subject pretty much captures my whole question. Is there a non-Turing-complete model (some constrained term rewriting system or automaton or what have you) which is known to be able to enumerate the prime numbers, all of the prime numbers (well, til you pull the plug on the algorithm), a...
Which of the below choices is related to the number of instructions a CPU can handle at one time? A) 32bit word size B) 3GHz clock speed I think should be (A). 2^32 instruction at one time?
According to the formal definition of an instance, it is a set of input data containing the values of the parameters of some problem (What is an instance of NP complete problem?). So, two problems may formally have the same class of instances, as long as they share the same parameters, even though they might have, e.g....