instruction
stringlengths
35
29.1k
What i call center is the point which minimize the distance to every points of a specific cluster. From what i know we can look for a concrete point in the cluster get an approximation of the center. For any space with a metric $d$, look for point which minimize the sum of distance to all others points $argmin_{x \in ...
I seek the neural network (NN) which satisfies the 100 equations (i=1,2...100) $\sum_{j=1}^{2000} NN(A_{ij},B_{ij},C_{ij})=Q_i$. Where A,B,C are 100x2000 matrices So I know Q, A, B and C How can one find the NN? (ie train it using this data) I have a second datset to test it on. I also have MATLAB neural network too...
I have the following PDA: And a given solution for his languages ${L}_{\mathrm{End}}(M_2)$ and ${L}_{\mathrm{PDA}}(M_2)$ with $ \mathrm{L}_{\mathrm{End}}\left(\mathrm{M}_{2}\right)=\left\{\mathrm{a}^{\mathrm{n}} \mathrm{b}^{\mathrm{m}} x\mid \mathrm{n}, \mathrm{m} \in \mathbb{N}^{+} \wedge x \in\{\mathrm{b}, \mathrm{c...
Under Huffman Encoding, if one character occurs more than 1/3rd of the time, is it guaranteed that there will be at least one character whose codeword is of length 1? I thought of 2 cases where this might be true, but they're not exactly proofs - Case 1: There is only one character which occurs more than 1/3rd of the ...
while reading I found this: Present/Absent bit – Present or absent bit says whether a particular page you are looking for is present or absent. In case if it is not present, that is called Page Fault. It is set to 0 if the corresponding page is not in memory. and Valid and Invalid bit are present in the page table ...
I am trying to compute the (pure strategy) Nash equilibria of some discrete auctions. More precisely, let us define the strategy of each player as a function mapping from every valuation that they might have to their bid (i.e. the 'bidding function'). Let us suppose that each player's valuation is drawn from some finit...
How can one model the following condition in an integer linear program? $$ y = \begin{cases} 1 & \text{if } x > 0\\ 0 & \text{otherwise}\end{cases} $$ Where $y \in \{0,1\}$ and $x \in \mathbb N$.
I'm being asked the following Find a language $L$, such that $L \notin \mathbf{P}$, but $L^* \in \mathbf{P}$ For the $L \notin \mathbf{P}$-part I have to show that there is no polynomial Turing Machine that could accept $L$. I've been struggling with this problem for quite a while, so I would appreciate any help wit...
Let's say we have a set of products $M$, a total of $|M|=n$ that we want to buy. However, we can only buy one product at a time, so that we need a total of $n$ time-units to buy all items. Each product $p\in M$ has a base price $b_p$, as well as an inflation rate $r_p$. At time unit $t$, product $p$ therefore has the p...
It has been claimed in this paper (page 2 last paragraph) that Matrix powering is equivalent to determinant computation. https://www.cse.iitk.ac.in/users/manindra/algebra/depth-four.pdf Does anybody why is this the case?
We have $n$-players in a game. We have a population of players we can choose from. Each player score is a normally distributed random variable and each player has a cost to add to the team. We are limited to $n$-players and the total cost must be less than or equal to $m$. The total score for a team is calculated as th...
From page8 of the slide, I think $E$ is all the edges in the graph $G$. But why is $c_f (u, v) = f (v, u)$ if $f (v, u)$ is not in $E$? Why do we care about edge that is not in $E$?
There is a simple-looking problem. Given integer coefficients $c_{0}, c_{1}, c_{2}, \dots, c_{n - 1}$ of polynomial $$ p(x) = c_{0} + c_{1} x + c_{2} x^{2} + \dots + c_{n - 1} x^{n - 1} $$ and integer value $x$, find last digit of polynomial value at point $x$, or, equivalently, $p(x) \mod 10$. My approach was to use H...
We know that the FW all pair shortest path is a Dynamic Programming (DP) approach to solving the problem. Being a DP, it smartly evaluates all possible options before deciding the final option at each stage. I have manually evaluated and traced a 5 node graph with this algorithm. The actual graph is not important here....
$\textbf{BPP}$ is usually defined in terms of probabilistic polynomial-time TMs which have an error probability of at most $\frac{1}{3}$. Furthermore, using the Chernoff bound it can be proven that the definition of $\textbf{BPP}$ is robust (i.e., the class remains the same) if we require the error probability to be up...
I have a iterative algorithm $(\theta_n,w_n)$ which I am showing converges to $\{(\theta,\theta):\theta \in \Bbb R\}$. The iterative algorithm is of the form : $\theta_{n+1} = \theta_n + a(n)[h(\theta_n,w_n)]$, $w_{n+1} = w_n + b(n)[g(\theta_n,w_n)]$ I want to know whether there could be any practical application of t...
I just read Marvin Minskys' "Form and Content in Computer Science" and found myself confused with the following paragraph: A startling discovery was made about multiplication itself in the thesis of S.A. Cook [3], which uses a result of A.L. Toom, as discussed in Knuth [4]. Consider the ordinary algorithm for mu...
So consider a person located at point $c$ (let's say $c=140$). Given a set of other points, for example, $P = \{100, 50, 190\}$. The cost of traveling to a point $P_i$ is then $|c-P_i|$. Points can be traversed in any order, so let's do them in the order of the example set. This leads us having to travel the distance $...
So if I have lst1 = [a, b] and lst2 = [x, y] the result would be: [x, y, a, b] [x, a, y, b] [x, a, b, y] [a, x, y, b] [a, x, b, y] [a, b, x, y] I'm thinking about doing something recursive where I take the first element of a list, place it at the start, then recursively take the next element of that list and shift it ...
If the alphabet is $\{0,1\}$, then is the string '010' regular? I think it is regular because DFA and regular languages are equivalent and this string has a DFA but at the same time it seems to contradict pumping lemma which implies not regular. Here is what I mean. For pumping lemma first we have to take $w$ only in ...
I have read the definition in of Third_normal_form here , which shows The third normal form (3NF) is a normal form used in database normalization. 3NF was originally defined by E.F. Codd in 1971.[2] Codd's definition states that a table is in 3NF if and only if both of the following conditions hold: The relation R (...
I was wondering about a result in the Sipser book which states that any $f(n)$ space bounded Turing machine also runs in time $2^{O(f(n))}$. Is this because a configuration consists of a state, a position of the head and the contents of the work tape, which is $\vert Q \vert \cdot f(n) \cdot \vert \Gamma \vert ^{f(n)}$...
I was reading about programming paradigms and I have a question about the state when speaking about Imperative languages. What does it mean to change the program's state? Is it just an abstract idea? I know that C is in the Imperative paradigm (In fact in the Procedural paradigm), so it has a state, but I don't underst...
I just got to look at the Implementation of Dijkstra using adjacency list and priority queue. The time complexity is $O(E\log V +V)$, I tried looking for the proof but couldn't find one. Any help will be appreciated.
I've read that when Turing-Church thesis is applied to the universe and physics, one of the three interpretations that we can use and is defended by some important physicists is that: "The universe is a hypercomputer and then it is possible to build more powerful machines than Turing machines. For this it would be eno...
I'm creating an algorithm to calculate every number in an array using only addition and numbers we've created - in the shortest amount of steps. That's confusing so here is an example: input: [5, 11], used numbers (start with 1): [1] 1+1=2, used: [1, 2] 2+2=4, used: [1, 2, 4] 1+4=5, [1, 2, 4, 5] 5+5=10, [1, 2, 4, 5, 10...
Showing that a language is not regular is straight-forward, because all one needs to do is find an infinite set of inputs which has an injective mapping to the set of equivalence classes which compose that language. How does one show that the set of equivalence classes of $L$ is finite? For instance, how would one show...
My goal is to show, that a given language is not a regular one by using the Properties of Regular Languages. The language is $ A \triangleq\left\{w \in \Sigma^{*} \mid |\left.w\right|_{b} \neq|w|_{c} \wedge|w|>0\right\} $ with $ \Sigma \triangleq\{a, b, c\} $ My idea is to use this clearly non regular language (whi...
I've got the following problem: I've got chessboard with fixed size N x M I've got list of pieces, like 2 queens, 2 rooks (It can be any piece with exception of pawn). I need to find every combination where none of the pieces is in a position to take any of the others For example for chessboard 3 x 3 and 2 rooks and ...
The problem is to prove or disprove the existence of $C$, s.t., $|c| = 6,\forall c\in C$; $|C| = 32$; $d(c_i,c_j)\geq2,1\leq i<j\leq32$. ($d$ stands for hamming distance) I tried to construct a satisfying code. The best I can get is to let $C = C'\times C'$, a concatenation of $C' = \{000,011,110,101\}$, which is of si...
In page 12 of the slide, it states flow across a cut $(S, T)$ is $f(S, T) = \sum_{u\in S} \sum_{v\in T} f(u,v) - \sum_{u\in S} \sum_{v\in T} f(v,u)$. I think the first part $\sum_{u\in S} \sum_{v\in T} f(u,v)$ is the amount of flow entering the network at the source node. The second part $\sum_{u\in S} \sum_{v\in T} f...
I have a question where I need to find a path from node 1 to node N in an undirected graph given weights in O(A Log^2 A). The total cost of each path must not exceed T amount of total weight. For no1, you cannot use this path because its total cost is more than 13. For no2 and no3, you only can use no2 because the maxi...
So this is the Master theorem for Merge Sort: $$ T(n) = 2T(n/2) + \Theta(n). $$ I am not able to understand why is the time complexity for sorting and merging $\Theta(n)$. Is sorting $O(1)$ and merging $O(n)$?
I know, for a disjunctive clause of the form $x_1 \vee ... \vee x_i$, the number of assignments satisfying it is simply $2^i - 1$, but what about for a general formula? Is the number of satisfying assignments be calculated polynomially? In Papadimitriou's Computational Complexity (p. 301), when explaining an approximat...
Partition an undirected graph of $n$ nodes into $k$ subgraphs so that total vertices inside all subgraphs is maximum. Restriction: all subgraphs have the same number of nodes (so $k$ divides $n$); $k$ is given initially. I'd like to receive pointers to the solution as well as papers or blogs related to or expanding o...
Euclidean algorithm is given below: gcd($a$,$b$):   if $a=0$, return $b$   otherwise, return gcd($b \bmod a$, $a$) Let us first argue that the algorithm terminates. The reason is that each time the number is decreasing, and there is a well-ordering defined on the set from which number $a$ and $b$ are defined. Questi...
Consider a prime finite field $\mathbb{F}_p$ of quite large characteristics $p$, for example $\log_2(p) \approx 256$ bits. I would like to know an approximate quantity of multiplications in $\mathbb{F}_p$ amounting the same bit complexity as one inversion in $\mathbb{F}_p$. Of course, this depends on many factors, henc...
Given array $A$ of length $n$, we call it almost sorted if there are at most $\log n$ indices satisfying $A[i] > A[i+1]$. Find an algorithm that sorts the array in $O(n\log\log n)$. My attempt: Create an array $B$ of size $\log n + 1$. Go through the array $A$, recognize the $\log n$ pairs, and insert them into $B$....
I've read that a program can crash if it tries to access addresses with no memory allocated. But, how is it possible that an address has no memory allocated? When does it happen?
After running Dijkstra on this graph from S, which shortest paths will be incorrect? This graph has a negative weight, so which shortest paths will be incorrect? after my first attempt I got that Y and Z have wrong shortest paths, but that's not true. Can anyone explain why?
In "Can programming be liberated from the Von Neumann Style?", John Backus states: The main reason FP systems are considerably simpler than either conventional languages or lambda-calculus-based languages is that they use only the most elementary fixed naming system (naming a function in a definition) with a sim...
Both in school and out, I have only ever encountered dynamic scoping paired with dynamic typing. Is there any published work (even if just academic, not yet implemented in a "real" programming language) on doing static type verification with dynamic scoping? It seems to me that it should be possible if the type checker...
For sorting $10^9$ unique 9-digit numbers, would radix sort or counting sort be faster, and why? I know that radix sort is $O(nk)$ and counting sort is $O(n+k)$, but can’t understand how to apply this.
So, this is how I solved $\displaystyle T(n-1) \approx{} T(n-2) $ $\displaystyle T(n) = T(n-1)^2 $ Add log in both sides $\displaystyle log(T(n)) = 2log(T(n-1)) $ $\displaystyle Let\:\: log(T(n)) = S(n) $ $\displaystyle S(n) = 2(S(n-1)) $ We know that from Fibonacci s...
Given a carpet of size a * b [length * breadth] and a box of size c * d, one has to fit the carpet in the box in the minimum number of moves. A move is to fold the carpet in half, either by length or breadth. One can even turn the carpet by 90 degrees any number of times, won’t be counted as a move. Example: Box = 6 * ...
Let's say our Σ is 0 and 1. I want to disprove the following: There can be Turing Machines that accept only 1's, i.e. 1, 11, 111, etc. Therefore, all languages that have strings of 1's are recognizable. My first step to proving this is by providing a language such as $One$, that accepts only if $w$ contains only ...
For an undirected graph $G$, let us denote $\gamma(G)$ the chromatic number of $G$. Let us define for positive integer $n$, the language $$ L_n = \{\langle G\rangle : \gamma(G) = n\}. $$ This is the language of undirected graphs with chromatic number $n$. I think $L_n \in \mathrm{P}^{\mathrm{NP}}$, for any $n$. My ...
I am wondering if there is an instance where FIFO results in less page faults than LRU. For example: 2,6,5,7... In this string, if I have to complete it by giving 3 additional terms, can I prove FIFO shows less page faults I have proved how LRU can show less Page faults. But I cannot think of the initial problem stat...
I'm doing a problem where I need to find the $≡_A$ equivalence classes of the language $$A = \{ 0^{n}x \mid n \in \mathbb Z^+, x \in \{0, 1\}^*, \text{ and } \#_0(x) ≥ n \}. $$ The best way I've learned to find the equivalence classes from a formal language is to create an automation and minimize it. Is there a convent...
As far as I know, only C, C++, and Objective-C (in most used languages) need a linker when compiling, languages like Java and C# don't have one, and it seems more and more modern languages do not have a linking stage nowadays. Why? If there's no linker, the code cannot turn into machine code, so languages without a li...
Suppose I have a quad-edge data-structure, and I want to be able to perform the operations of DCEL (twin, next, prev) on the quad-edge data structure. Let the current edge I am operating on be e. I know that e.twin would simply be e.rot.rot. I am just unsure about next and prev. (Quad-Edge visualization given below.) ...
I am having trouble determining the language from a given context free grammar. I've been given a hint that there are 2 parts to the language but can't figure either out. $$G= (\{S,A,B,C,D,E,Z\},(0,1),R,S),$$ $\quad S\to E\mid Z$ $\quad E\to A\mid C $ $\quad A\to 01B\mid 0A\mid\epsilon$ $\quad B\to 1B\mid 10A $ $\quad...
Last night I thought about the following problem: Given any map (for example from Germany), how to find the spot which is furthest away (in every direction) from the nearest (any) town/village? I thought about how one would proceed to figure out in which problem class this problem belongs to and how to prove that. ...
There is a list of N stocks. In M days, the stock price is given. Assume that each stock has only 1 price per day. Assume that these prices are constant. We start with an amount of money K. For each day we can buy and sell an arbitrary number of stocks. In the last day, we have to sell all the stocks we have to get bac...
I have read Crossword Puzzles and Constraint Satisfaction by Connor, Duchi and Lo and I am trying to implement this variation of crossword solving algorithm. I can't understand the bit array data structure described on page 3, under "Lexicon". Could someone please give me an example? PS: I have already implemented an ...
I have read that the POWER9 processor is an SIMD processor. I have also read that most supercomputers are MIMD based. So is the SUMMIT supercomputer SIMD? And if it is can you name a supercomputer that is MIMD?
I have the following simple algorithm to find the smallest element of an array $A$ of numbers: m = A[0]; For i = 0 to A.length() do if m < A[i] then m = A[i]; end end return m; The complexity of this algorithm is $O(n)$ where $n$ is the length of $A$. I would like to prove the correctness of this algor...
There is wikipedia page about square-free words, and there are a lot of theorems about these words, and examples of infinite square-free words. I am wondering: why are we interested in these words? Are there real-life applications of these words? Why are square-free words more useful to consider than other words?
The term "Ironic complexity" was coined by Scott Aaronson for the stuff Ryan Williams does in the area of complexity theory. Could anyone tell me what kind of problems and approaches does Ryan Williams work upon? And is there a survey or course on it for self-study?
While learning Median of Medians algorithm i came across the following lemma ; "For any recurrence of the form $T(n)<=T(an)+T(bn)+O(n) $, if $(a+b)<1$ the reccurence will solve to $O(n)$" (Which means $T(n)$ is bounded by $O(n)$ for some constant $ $ for any $ n>n_0$ ) So i was trying to prove it (since i could not fi...
Given a directed graph G and a starting vertex $v$ and a cutoff weight $w$, I want to find a simple walk with net weight < $w$ that visits as many nodes as possible. Currently, I have a recursive function which is incredibly slow, is there some sort of heuristic function for such a problem? For my particular purposes, ...
Let's say we have $L_1$ which is a regular language and $L_2$ which is not. I understand that if $L_1 \cup L_2 = \Sigma^*$ then $L_1 \cup L_2$ is a regular language. Does that implicitly mean that if $L_1 \cup L_2 \neq \Sigma^*$ then $L_1 \cup L_2$ is non-regular?
Given a graph $G=(V,E)$, and positive and negative edge weights, negative path problem asks if there is a simple path with negative total weight from $s$ to $t$ where $s,t \in V$ My approach was to reduce this from the Hamiltonian path and I know I should somehow force the solver to go through as many vertices as it ca...
Suppose we have a total ordering over elements $a_1,a_2, ..., a_n$, meaning there is permutation $\pi$ such that $a_{\pi(1)}<a_{\pi(2)}<...<a_{\pi(n)}$. But we don't know $\pi$. What we know is a set of random observations from pairwise order of the elements. The observation matrix $B\in\{0,1\}^{n\times n}$ is generat...
I'm looking at the reccurrence $$T(n) = T(n/2) + T(n/3) + n,$$ which describes the running time of some unspecified algorithm (base cases are not supplied). Using induction, I found that $T(n) = O(n\log n)$, but have been told that this is not tight. Indeed, assume inductively that $T(k) \leq Ck\log k$ for all $k<n$ (a...
I have the language $ A_{1} \triangleq\left\{a w c^{l} d^{m}\mid l \in \mathbb{N} \wedge m \in \mathbb{N}^{+} \wedge w \in\{a, b\}^{*} \wedge |\left.w\right|_{a}=l+m\right\} \operatorname{with} \Sigma \triangleq\{a, b, c, d\} $ and I have no idea which word I should use to prevent a case distinction. My first idea was...
How to generate CFG for this language? $ L = \{ w \mid w \in \{ (, [, ], ) \}^* \text{ s.t. } $ In any prefix of $w$, no. of ( is more than no. of ), and no. of [ is more than no. of ]. $\}$ Thus, ([(), [()[] etc. are valid. I have tried, $ S \to (S \mid (S)S \mid [S \mid [S]S \mid \epsilon $ But, this does ...
I'm doing a problem where I need to find the equivalence classes of the language below: Let A = {x ∈ {0, 1}* | #(01, x) = #(10, x)}, where, for a, b ∈ {0, 1}*, #(ab, x) is the number of places in x where an a is immediately followed by a b. So I can start to see some equivalence classes. 1* and 0* both are in A, becaus...
In the ARM Architecture pipelining stages, we know that the instructions pass from fetch to decode and so on? But, from where does the fetch unit get the instructions?
I am picking up from this thread for which I have no privileges to comment on: Is C actually Turing-complete? I was wondering if there's any progress on this and what the conclusion actually was. This is not a duplicate of the Is-c-actually-Turing-Complete but a continuation, with the following third possible solution ...
First of all, it's my first time in #ComputerScience at StackExchange so, my apologies if I'm making some newbie mistake when asking this question. So, I'm currently researching algorithms for finding the maximum common subgraph isomorphism and after reading a lot of papers I'm still confused about what is the state-of...
Note: this question was marked as a duplicate in favor of this question/answer which attempts to provide a generic formula for translating code to mathematics. Unfortunately I didn't find that response useful as I don't have a good understanding of maths and so all I see is complex symbols that don't mean anything to...
How can we show that the term $\Omega = (\lambda x.x\ x)\ (\lambda x.x\ x)$ does not have a normal form? Building on this, what is an example term different than Omega that is not normalizing (meaning a term that every reduction sequence starting from it is infinite)?
I am learning lambda calculus from the book https://www.irif.fr/~mellies/mpri/mpri-ens/biblio/Selinger-Lambda-Calculus-Notes.pdf and do not understand the meaning of the following symbols. The definition of the lambda terms is: Lambda terms: $\mathit{M,N} ::= x | (M N) | (λx.M) $ The question is, what do $\mathit{M}$ ...
I know that the general strategy to do the correction of an algorithm is as follow : if the algorithm is recursive then prove the correctness using induction if the algorithm is iterative (using a for loop for example) then find an invariant Finding an invariant is sometimes hard while induction is easy. So since ...
I've just began a course on logic and learned the following : De Morgan's laws Normal forms How to represent a logical formula (using or, and, not operators) using binary trees How to get the conjunctive normal form of a formula It's obviously not much, but the subject interested me a lot and it was enough to ...
Consider the following computational problem (or rather, task): Given: An array of $A$ of (not necessarily distinct) elements from a fully-ordered finite domain An ordered sequence pivot values $p_1 \ldots p_m$ (i.e. such that $i < j \implies p_i < p_j$). Output: A partition of $A$ into $m+1$ parts (be they sets or...
What is the normal form of the following lambda term? I'm stuck between two answers and I just wanted to know which one is correct. $$\lambda y. (\lambda x.x)\ y$$ Possible Answer 1: $\lambda x.x$ Possible Answer 2: $\lambda y.y$
It is known that in the case of a Regular Language $L$ , the pumping lemma can be extended to apply to any sufficiently long subword of the language, ie, if $uwv \in L$ and $|w| \ge p$ then we can perform the usual breakup of $w$ as $w=xyz$ such that $uxy^izv \in L$. Can we similarly extend the pumping lemma for conte...
I have to transform the following grammar into a non left recursive grammar: S → aSb | bAS A → AaA | bAA | AAa | bAb This is what I came up with: A → bAAA’| bAbA’ A’ → aAA’| AaA’| ε S → aSb | bAS As far as I can tell, there is no more left recursion because none of the leftmost symbols on the RHS are the same as the...
I have a tri-partite graph with three sets of vertices source, bridge and destination nodes. I want to find the shortest path between every vertex in the source set to every vertex in the destination vertex. Also, all vertices in the source set are connected to all vertices in the bridge set, and all the vertices in de...
I was reading about tge Turing machine. I also came across with the Shakespeare programming language. After trying to understand the basics of the PL, I thought that it must be non-Turing complete. On some page I found out that I was wrong and Shakespeare is actually "turing complete". I didn't find how can I create wh...
I can't make out what is the avantage of it comparing with the port designed I/O Is it faster? Is it more reliable? Is it cheaper?
We say that a binary tree : $B(l, x, r)$ is increasing if $x$ is smaller than all the nodes of the binary tree and if $l$ and $r$ are also increasing trees. One way to merge these kind of trees is as follow (we denote by $E$ the empty binary tree) : merge ($E$, $B(l, x, r)$) = $B(l,x,r)$ merge ($B(l, x, r)$, $E$) = ...
I have heard about all these Man-In-The-Middle Attack preventions and I am wondering, how this can possibly work if the man in the middle only listens to your stream and does not want to change the message itself. Can the man in the middle not just take the keys swapped by the opponents, change the keys and then decry...
I want to understand the dynamic programming equation of https://en.wikipedia.org/wiki/Bertrand%27s_ballot_theorem theorem. it is this If i number of people voted for A and j number of people voted for B then dp[i][j] counts the number of ways voting can happen. dp[ i ] [ j ] = dp[ i ] [ j - 1 ] + dp[ i - 1 ] [ j ] . ...
Given an acyclic graph, how can I build a lambda calculus term such that this graph is the term's Böhm tree? If the Böhm tree is a finite tree (so the result is a strongly normalizing term). If the Böhm tree is an acyclic graph, but not necessarily a tree (so the result may not be normalizing). If the Böhm tree is not...
Say I have an array and I want to add those values to something else. What is the space complexity if I incrementally take one of those values off the first list and add it to the second? For example, I'm trying to convert a list to a string. I know that if I do the following, the space complexity will be O(N): a = [1,...
I usually do it via topological sort and wonder if there is a simpler way to generate a linear extension from partial orders without consider the graph of the relation.
After many years, I have been revisiting the venerable old Halting Problem and the self-referential / diagonalization “party trick” that shows that there is no Turing Machine able to solve it. I was bothered by the fact that it was, and continues to be, stated in an untyped manner, and thus is a bit sloppy for my tast...
As the title states, how do you prove that $A$ is productive? With $W_{x}$ I mean the set of points in which the turing machine with index $x$ halts. The standard approach that I follow is functional reduction: first I construct a partial recursive function $\psi(x,y)$. Then through the s-m-n theorem I build a partial ...
I have two functions, $$ f = n^{1.6} $$ $$ g = n^{1.5} $$ I thought this is $ f=\theta(g) $, since $ f $ is asymptotically tight bound of $ g $, if $ n $ goes to infinity. However, the answer is $ f = \omega(g) $. Can anyone explain why it is $ f = \omega(g) $ ? Thanks in advance!
I am looking for a fast solution to the assignment problem for large cost matrices (5000x5000 or larger). The Hungarian algorithm is $O^3$, which is impractical for any moderately large problem. Are there similar algorithms but sub-optimal and fast, possibly in R (or Python)? The problem I'm working consists of findin...
I'm looking for an data structure that supports efficient random prefix matching queries (pattern) over a previously known set of words (dictionary). The dictionary is expected to contain about 10,000 words of varying length (I haven't calculated average word length, but I don't expect any word to be more than 80 chara...
Let $A$ be a DFA over a finite alphabet $ \Sigma$. Find an algorithm that indicates if $A$ accepts a palindrome and give the complexity of this algorithm. Here is my solution: If we denote $^t A$ the transpose of the finite automaton then in order to see if $A$ accepts a palindrome we need to look at the product aut...
shorter version of the original question (as requests in comments) What is the algorithm to handle missing apostrophe as it is done in auto-correct feature of Android virtual keyboard? (If it helps / makes sense, feel free to give info about how such feature handles the detection and 2 words being written without any s...
We know from Kleene's recursion theorem that if $f$ is total recursive, there must be an integer $n$ for which $\varphi_n=\varphi_{f(n)}$. My question is: for every $f$ total recursive, is there a computable (total) procedure that computes such a point? ie: $\exists g.\forall f.\varphi_{g(n)}=\varphi_{f(g(n))}$.
A query is any mapping $I:STRUC[\sigma] \to STRUC[\tau]$ that is polynomially bounded. A boolean query is a map $I_b: STRUC[\sigma] \to \{0,1\}$. A boolean query can also be thought as the susbset: $$ \{ A \in STRUC[\sigma] \ \mid \ I_b(A) = 1 \} $$ From this definition of query, used by Immerman in his book "Descr...
I need to solve the following recurrence relation: $T(n) = n^{3/4}(^{1/4})+ n $. Obviously, the master theorem doesn't apply here so I was using the substitution method. I used $x=\log n$ and $F(x)=T(e^x)$. I was able to get to $F(x)= e^{3x/4} \cdot F(x/4)+ e^x$. However, the master theorem still doesn't apply at this ...
How to generate a random combination of $k$ numbers from $n$ choices in $O(k)$ time and space, if we can generate a random number between 1 and $O(n)$ in $O(1)$ time? I know only 3 algorithms: with $O(n)$ time and space, $O(k\log k)$ time and $O(k)$ space, $O(k)$ average time and $O(n)$ space. Is it even possible to so...