instruction stringlengths 35 29.1k |
|---|
Suppose that $[U] = [0,...,U-1]$ is the universe from which all elements will be taken, and $A$ a hash table of size $m$.
A hash function $h:[U]\rightarrow[m]$ is truly random if
For any set of distincts elements $\{x_{1},...,x_{k}\} \subseteq [U]$ and any set of values $u_{1},...,u_{k} \subseteq [m]$ we have $Pr_{h}... |
I am trying to prove that
$\qquad L=\{\langle M\rangle \mid M \text{ is a TM }, \exists w. \text{ in } M(w) \text{ the head moves only right and } M(w)\!\uparrow \}$
is decidable.
I thought about the following solution:
Lets build $\hat{M}$, a TM that will decide L:
M on input $\langle N \rangle$:
1. $\Sigma^{Q+1} $... |
We all know that for insertion() operation in AVL tree following can happen:
We traverse down the tree from root to appropriate node and there insert the key and then for maintaining height balance we have to check heights of the ancestors of the newly inserted node and in doing so, we could end up traversing up to the... |
I have seen proofs of Ladner's theorem which detail the construction of languages in NPI assuming P $\neq$ NP. However, I was wondering if there are any other constructions using the fact that sparse sets cannot be NP-complete assuming P $\neq$ NP (Mahaney's Theorem). Specifically, is it definite (assuming P $\neq$ N... |
I know that if one-way functions exist then there are certain universal one-way functions that exist, but to my knowledge they are too impractical to implement (which is the main reason why they are not being used in modern cryptographic protocols). However, if one-way functions exist are the modern implementations (l... |
If I understood correctly, Hamming codes assume the uniform correction among all the bits. This means all the bits have the same weight in terms of correction.
Are there any error correcting codes out there that assume non-uniform error correction probability among the bits? For example, I want a error correcting code ... |
I just learned about recurrences and I just can't solve this problem. I have this recurrence relation:
$$
T(n) = \begin{cases}
k\cdot T(\frac{n}{k}) & n > 0\\
1 & n = 0\\
\end{cases}
$$
where $k$ is a constant number.
I tried drawing a recurrence tree or replacing for lower $n$s but no success. I hope you can help me w... |
Let the language $$L = \left\{ \langle G \rangle \ |\ L(G) = \{1,\ldots , 1000\}, \text{ G is a CFG }\right\}$$
Prove that $L \in R$.
Well, I think that for a start we need to check whether or not $L(G)$ is infinite, so we only need to check if there's a word $w\in L(G)$ such that $n \le \left|w\right|\le 2n$
Suppose... |
Several papers(1 (originator), 2, 3) suggest the use of Hierachical Softmax instead of softmax for classification where the number of classes is large (eg many thousand).
I haven't been able to get clear in my head what this means the actual final layer and output/labels of the neural network are.
For (plain) softmax t... |
Lets say we have a graph $G$ with $|V|$ nodes. We wish to select $k$ such nodes while optimizing the following attribute:
maximize: for each $i$ and $j$, where $i \neq j$, $min(distance(v_i, v_j))$
Hope that makes sense. We'd like to pick $k$ nodes such that the distance between the closest pair of distinct nodes is ... |
One of the surprising aspect of the genome for lay-people is that it
contains important non-coding DNA parts, which does not mean that they are
all useless. I never paid so much attention to the fact, until very
recently, when I realized that the same is apparently true of all
computing formalisms I can think of ... bu... |
I have followed two famous book on "Automata and Formal Language Theory":
Micheal Sipser's book
Jeffrey Ullman and John Hopcroft's book
in both books, tuple level definition of Turing machine differs with each other. Although abstract level working are same but details are different. Why there is not any standard def... |
I'm trying to map a 12 digit number into a fixed width file. For a number of reasons, it must be compressed in such a way that it is guaranteed to be less than or equal to 9 characters (alpha numeric is fine). My first thought was a change of base, but I can't find an equation which gives an upper bound the number of... |
First of all, I have to mention that I am very new in the field of information theory.
I have a question regarding the Shannon Entropy calculation for binary values. As far as I understood, the main assumption in the Shannon Entropy formula is that all the bits have the same weights. However, I am looking for a formula... |
I just can't solve this problem, I'm new to reccurences. I have this recurrence
$T(n)=n*T(n-1)$
$T(1)=1$
The second term will be:
$T(n-1)=(n-1)*T(n-2)$
And so on.
It's complexity is O(n!) but i don't know how to solve it.
I hope you can help me with an idea!
|
We suppose that the sets $S_1$ and $S_2$ are constructible enumerable, that means that there is an algorithm that enumerates them. Show that the sets $S_1 \cup S_2$ and $S_1 \times S_2$ are also constructible enumerable.
To show this do we have to construct a Turing machine for the union and one for the cartesian prod... |
Does anyone know of an accessible introduction to Cobham's model independent characterization of FP and it's equivalence to the standard definition using Turing machines? The best source I could find on-line was https://www.cs.toronto.edu/~sacook/homepage/ptime.pdf : a paper by Stephen Bellantoni and Stephen Cook deta... |
So, could a computer count to infinity assuming it was a super computer and had near unlimited amounts of ram and hard drive/solid state drive storage? I am being serious when I ask this.
[This is what I am asking]: Wouldn't Infinity mean endless counting, and wouldn't that be infinity?
|
I know what computation is in some vague sense (it is the thing computers do), but I would like a more rigorous definition.
Dictionary.com's definitions of computation, computing, calculate, and compute are circular, so it doesn't help.
Wikipedia defines computation to be "any type of calculation that follows a well-... |
In his commentary on a case involving pornography in 1964, U.S. Supreme Court Justice Potter Stewart sidestepped the question of defining what it meant for a work to be pornographic, but then said "I know it when I see it." It struck me that this was a pretty good description of recursive enumerability (recognizability... |
I am taking a compiler MOOC online on my own time. The class is self paced. There is a question with an answer but I can't understand why the answer is correct.
Here is the question.
For any language $L$, the complement of the language (usually written
$L′$) is defined as the language that consists of all the strings ... |
The Original Knuth's Algorithm is based on DFA and it depends on the alphabet size. And Then, Pratt optimised it to be independent of Alphabet Size.
But, All the textbooks directly give the final Pratt Algorithm. Below is the code ( the code is not really needed to answer the question) which is more or less similar to... |
I'm taking a Compiler MOOC on my own time. The class is self paced. An answer was given to a question but I can't understand the answer. In fact I'm not even sure how to interpret the question.
Here is the question:
Given the following lexical specification:
$(00)^*$
$01^+$
$10^+$
Which strings are NOT successfully pr... |
I'm implementing a chess engine.
Like many engines, the search for the next best move is done with the alpha-beta algorithm. There are many improvements that can be made to make the algorithm faster and make it able to search deeper into the search tree.
I'm currently considering Iterative Deepening for move ordering s... |
Yesterday while returning home, I walked past a house that had a camera. For some reason I started thinking about how these cameras work, and how you would use them in case of robbery. While thinking about everything that might happen in case of robbery, one problem came into my mind and it can be described as follows.... |
Given $n$ boolean variables $x_1,\ldots,x_n$ each of which is assigned a positive cost $c_1,\ldots,c_n\in\mathbb{Z}_{>0}$ and a boolean function $f$ on these variables given in the form
$$f(x_1,\ldots,x_n)=\bigwedge_{i=1}^k\bigoplus_{j=1}^{l_i}x_{r_{ij}}$$
($\oplus$ denoting XOR) with $k\in\mathbb{Z}_{>0}$, integers $1... |
I play 5-a-side soccer twice a week. 10 people play each game out of a pool of about 30 people who are giving the opportunity to play as it's first come first serve. Some people play more often than others.
The best matches are the ones where the score stays even throughout the game because they are the most competiti... |
I have a small number of documents (I could probably get 4 or 5 documents) and want to assign terms in these documents a score based on its importance to the document. I want to find which terms are simultaneously important to all of these documents.
These documents have different authors but are written about the sam... |
Exercise ask : Prove which a binary language L is recursive if and only if both L and {0, 1}* - L are recursively enumerable.
Now I try to give a solution:
Suppose that L is recursively enumerable.Then, would exist two machines M and M' such that simulate M and M' at alternate steps on two copies of the input x.
For al... |
What exactly is name hiding in c++? what are the advantages?
i already went through a couple of links but couldn't get a proper explanation for the same.
|
Given a distribution over graphs with $n$ nodes having the "scale-free" property, I would like to compute for a pair of vertices $(a,b)$ the probability that they are connected (or more precisely the probability that there is a directed edge from $a$ to $b$).
Is it possible to have such probability distribution ?
Note ... |
Suppose we have the following grammar:
S -> A ( S ) B | ε
A -> S | S B | x | ε
B -> S B | y
where S is the start symbol, S, A, B are non-terminal symbols, x, y, (, ) are terminal symbols, and ε is the empty string.
I'm trying to compute the FIRST() and FOLLOW() sets of S, A, and B.
FIRST(S) = FIRST(A ( S ) B) ∪ {ε}
F... |
I have a list of point-to-point $(x,y)$ positions representing a path. I would like to convert these points to a list of vectors consisting of straight segments $\{L\}$ and turn vectors $\{r, \theta\}$, where turns are represented by arcs on a circle. For example, the set of points
(0,0), (0,10), (5,15), (10,10), (10,0... |
I was solving one of my practice questions, defining a language with Context Free Grammar Productions , but I am stuck on one question , Here are my attempt:
Question: $L = \{a^n b^m c^p \mid n = m + p + 2\}$
My Attempt:
S -> aaBC
B -> aBb | ^
C -> ? (Now how can i increase length of `a` Terminal by C as i increas... |
So I have a problem, I'm highly confident that it's NP-Hard, though I'm not really sure how I can convince my self this is the case?
Suppose I have different groups of people m in a list
M= {m1, m2}
and a list of food they can eat and the respective cost in dollars
Food = {f1:2, f2:3, f3:2}
you have buffet and can choo... |
Let's suppose we are counting words in string. We split it so what we have is an array of strings. I'll use Python as an example.
The imperative approach would as follows:
wordcount = {}
for word in words:
wordcount[word] += 1
The functional would be:
uniquewords = set(words)
wordcount = [words.count(w) for w in ... |
I am writing my first paper, and one of the results can be written as follows:
For any $W,\epsilon$ such that $\epsilon = o\left(\frac{\log^4 W}{W\log\log W}\right)$ and $\epsilon=\omega\left(\frac{\log\log W}{W}\right)$, we obtain a $o(\min \{W, \frac{1}{\epsilon}{\log^2 W}\})$ space algorithm, improving the state of... |
I need help on this question:
Given a sorted array of distinct integers A[1, . . . , n], you want to find out whether there is an index i for which A[i] = i. Give a divide-and-conquer algorithm that runs in time O(log n).
How I can proceed?
Thanks a lot!
|
I need help on this exercise:
You are given an array of n elements, and you notice that some of the elements are duplicates; that is, they appear more than once in the array. Show how to remove all duplicates from the array in time O(n log n).
I find a solution but in O(n^2)... How can I apply D&C?
|
As Wikipedia says, quickSort needs O(log n) extra space when the following conditions are met:
In-place partitioning is used. This unstable partition requires O(1)
space.
After partitioning, the partition with the fewest elements is
(recursively) sorted first, requiring at most O(log n) space. Then
the other partition... |
Given a list of items which represent items in a shopping cart, and a list of available special offers which replace one or more regular items to lower the cost of those items, how can I decide the order to apply the special offers to minimize the final basket price?
For example, I have in my cart 4 items:
Coke \$2
Co... |
Brzozowski's algorithm can be extended to Moore automata but its time complexity is exponential in general. Is there any other algorithm for minimization of Moore automata? What are the running times of these algorithms if any?
|
How would I rewrite an XOR gate into the three basic logic gates (AND, OR, NOT). To be more specific, I have to write it in such a way with 2 NOT gates, 2 OR gates, and 1 AND gate. I also have to do it with 1 OR gate, 2 AND gates, and 1 NOT gate.
I'm not looking for just the answer, I'm looking for a way to come up wit... |
In a course on theoretical computer science we have to prove if sets are endless. I have two problems with the exercise:
I don't understand exactly, what an endless set is (I find it very hard to understand, maybe because of the "endless")
I don't know, how I can prove that the given sets are endless
The definition g... |
I want a constraint that:
if c=0 become x=0
if c > 0 become x=1
for example:
C < = M.X or
C> = M.X or
X=exp(-M*C)
that X is binary variable and M is huge value.
This constraint is very important for me.
Please help me.
|
My goal is to uniformly sample from a convex polytope. I know that for the simpler case, where I have to uniformly sample from a simplex, I can use Bayesian Bootstrap, discussed in these posts:
Uniform sampling from a simplex
Random vectors uniformely distributed into convex n-polytope
Therefore, I'm very interested in... |
The situation is as follows
'm' process shares 'n' resources of same type. The maximum need of
each process does not exceed 'n' and the sum all their maximum needs
is always less than m+n. In this set up will deadlock ever occur
This is a question from Operating System Concepts by Silberschatz, Gagne and Galvin.
... |
I have recently written code for detecting path colors in a 2D grid and printing the corresponding path costs and it works fine for me.
Here's my code; I am currently new to OpenCV and know only C++ (no python).
The image that I had for the project was:
Now I may get an image like this for the same task:
I need an al... |
I'm currently struggling to construct a nondeterministic PDA with an amount of states in $O(n)$ that accepts the following language:
$L = \{wcx \, | \, w,x \in \{a,b\}^n \land w \not= x\}$ with c being a delimiter.
In lectures we discussed DPDA that accept $wcw^R$ or NPDA that guess the middle of the word with an $\v... |
My question is about the control in the Turing Machine. As far as I know, the control of the Turing Machine is just a set of states. If the Machine needs to record something, it needs to write on the tape.
The following is an excerpt from Michael Sipser's Theory of Computation, the passage is about how a Turing Machin... |
Is there a name for a counted set (multiset) that is ordered?
For example lets say this data structure represents a shopping cart (or basket if you're British). The shopping cart shows the order the items were added to the cart unless an item of the same type was already added in which case a number associated with ite... |
It's well known that Hindley–Milner type inference (the simply-typed $\lambda$-calculus with polymorphism) has decidable type inference: you can reconstruct principle types for any programs without any annotations.
Adding Haskell-style typeclasses seem to preserve this decidability, but further additions makes inferenc... |
What are the non-trivial graph families that have a known chromatic number, or an easy way (polynomial-time algorithm) to compute the latter.
Examples would be:
Kneser graphs
Chordal graphs
Do you know any other families?
Motivation:
We are looking for interesting classes on which we can test a proper coloring heuris... |
I'm trying to sample uniformly on the intersections of faces of several simplicies, with all coordinates being non-negative. That is, given constraints
$$A\vec{w}=\vec{b} \ \ and \ \ \vec{w} \geq \vec{0} \ \ and \ \ \sum w_i = 1,$$
I want to sample $\vec{w}$ uniformly. $A$'s dimension is about $100 \times 10000$. A con... |
Let L be a language that fulfills the properties implies by the Pumping lemma for regular languages.
Does L necessarily fulfill the corresponding properties of the Pumping lemma for context-free languages as well?
|
While reading the following tutorial on iOS development Working with Foundation (section on Sets near the bottom), I came across the following statement: "Because sets don’t maintain order, they offer faster performance than arrays do when it comes to testing for membership."
The author doesn't mention the underlying d... |
How does the microprocessor convert the machine code to micro code?
What part of the processor is at play?
|
I am taking a course on Coursera about algorithm design. The course said that a time of $O(n \log n)$ is considered to be good.
However, there are faster runtimes such as (from now on just assume it is in big o notataion), such as $1$, $n$, and $\log n$. I understand that it is almost impossible to have a algorithm in... |
Given: A completely connected directed acyclic graph.
What would be the most efficient(Least Time complexity) way to find a shortest path among a very large number of nodes?
Constraint:
1)The result should be optimal.
2) The cost between any two connected nodes is computed in time complexity of O(layer-no). For, e.g., ... |
As I've already asked my Question about the solving Context Free Grammar
$L = \{a^n b^m c^p \mid n = m + p + 2\}$
Can this language be defined by a Context Free Grammar?
Now i have just changed n = m + p - 2 and still can't figure out,
Here is my attempt:
S -> Cc
B -> aBb | ^
C -> aCc | Bb
(In this Grammer i can't h... |
This is a question that has emerged from a recent quiz I have taken. In short
Consider the following transitions on a push down automaton. Assume the starting state is q. Which one of the following inputs will lead the automaton to state p with the stack containing the string XXZ?
I am gonna write only the transition... |
Given a set $Q\subset \mathbb{N}^m $ of $n$ points, we want to find the subset $S_{max}\subset Q$ of $k$ elements that maximize the total distance between them, according to the $\ell^1$ norm.
$$S_{max} = \arg \max_S\sum_{i,j \in S, i \ne j} d(x_i,x_j)$$
In my specific case, $Q\subset \{ 0, 1 \} ^m $, thus $d(\cdot,\c... |
I am trying to show that this is Turing Recognizable.
The language A, that is a DTM, T, that halts on a minimum of one input.
My justification is that of course it is because, you just need to check if an accept state is reachable. However, this seems like I am making it trivial.
Is there something larger I am missing?... |
Let A be a Turing Recognizable Language and B a finite Language.
I want to prove that their symmetric difference is Turing Recognizable.
My reasoning: B is finite, therefore the finite number of strings can be put through a DTM , M, such that L(M)= A. If M accepts, then remove that string from B and put it in a list, R... |
I'm programming a neural network. I know that I should initialize the network by picking random weights. How do I pick a random weight for the connections to bias nodes? What distribution should I use for these weights? I can pick a random value from the range $[0,U]$, but what value should I use for the upper limi... |
In an LR(0) parser, each state consists of a collection of LR(0) items, which are productions annotated with a position. In an LR(1) parser, each state consists of a collection of LR(1) items, which are productions annotated with a position and a lookahead character.
It's known that given a state in an LR(1) automaton,... |
I have a weighted directed graph (it's sparse, 35,000 nodes and 19 million edges) and would like to calculate similarity scores for pairs of nodes. SimRank would be ideal for this purpose, except that it applies to unweighted graphs.
It's easy to adapt the matrix representation of SimRank to use weighted edges:
$\mathb... |
Hey all I have a weird question (first time poster so forgive me if this is super newb)...
I am wanting to see the inner workings of a SSL/TLS connection between a client and a server at the packet level (in the clear) in order to learn. Is there a way to do this where I will see all of the traffic including the hands... |
I'm writing a compiler, and I've built a recursive-descent parser to handle the syntax analysis. I'd like to enhance the type system to support functions as a valid variable type, but I'm building a statically typed language, and my desired syntax for a function type renders the grammar temporarily* ambiguous until res... |
So I know that arrays use a block on contiguous memory addresses to store data to memory, and lists (not linked lists) make use of static arrays and when data is appended to the list, if there is no room, a new static array is created elsewhere in memory larger in size so more data can be stored.
My question is, how do... |
As you add length to an encryption key, at some point the message becomes impossible to brute-force decrypt. This is because at that point, if you go through all the possible keys, you'll get many meaningful decryptions just by random chance and you won't be able to determine which was the original message.
As you add ... |
The following question assume that the decision problem definition (syntactic) has been written (and could be changed if it isn't able) to catch a concept (meaning, semantic) which has both nice implications and some models. So please don't answer "the definition is the definition".
Let be any usual proof system, let $... |
I am looking for a formal name and an algorithmic approach to the following problem.
Given is a set of services each coming with a price:
{s1, 300}
{s2, 400}
{s3, 800}
Additionally there is a set of servicepackages each with a price that may differ from the total cost of the individual services:
{p1, {s1, s2}, 60... |
I was trying to figure out the value of the following expression.
(0 | 1)*00 ∩ (0 | 1)*01
I tried drawing DFAs for(0 | 1)*00 and (0 | 1)*01 separately and combine them using a table.
Is it the approach I should use? or is there any better way?
|
I got this question today and I'm nowhere near the solution,
Given a sequence of real numbers (X1, X2, ..,Xn). write an algorithm as efficient there is, that finds the number of strictly increasing sub-sequences for every index j, that end with Xj.
My solution should include a recurrence formula that solves this proble... |
I've been working on an industrial project where my job was to design a data model in-memory and in a relational database in such a way, that can capture the time-varying nature of the production planning of a factory. In other terms, there exist input data and whenever a planning occurs, I have to take a snapshot of t... |
I have recently learned about radix sort.
I am aware that you can change the base of the numbers you need to sort but I don't really understand why this is good for the radix sort.
Radix sort runtime is $O(d(n+k))$ where $d$ is the number of digits in the numbers, and $k$ is the base.
So shouldn't there be a permanent ... |
I'm currently reading the elements of programming book and have come across a section I don't quite understand
A computational basis for a type is a finite set of procedures that enable the construction of any other procedure on the type. A basis is efficient if and only if any procedure implemented using it is as eff... |
Suppose we have the graph of a social network with symmetric connections (e.g. Facebook or LinkedIn). Suppose we would like to find all pairs of people who have at least k friends in common, in order to show them friend recommendations.
What is the most efficient way to do this? Does this problem have a name?
Apart fro... |
During the formal language exam, the professor allowed to find a CFG to following language: $\{a^m b^n c^p d^q, m\neq n\wedge p\neq q\}(1)$, because neither he saw a solution (He passed a test without resolve it before!!!) to $L=\{a^m b^n c^m d^n, m\neq n\}(2)$. First language I can resolve in seconds, but I cannot vis... |
I'm going over "Introduction to the Theory of Computation" by Michael Sipser in which there's an example of using the pumping lemma for CFLs to prove that $L=\{ a^n b^n c^n \colon n\ge 0 \}$ is not a CFL.
Now, in the book they do it in a way that I understand but I think it can be simplified, so here goes:
Assume by co... |
Languages such as Java and C specify implicit widening of integer types for numeric operators, especially arithmetic operators, to a minimum of 32 bits. What is the rationale behind doing this?
My impression is that it's based on the end-programmer's expectations - that is, 200 + 100 should yield 300, and not overflow ... |
I have to prove that $\left \{ a, b \right \}^{\ast} - \left \{ a^ib^i | i\geq 0 \right \}$ is a context-free language and it's not regular.
So far I've got that this language is not regular because regular languages are closed under complementation and $\left \{ a^ib^i | i\geq 0 \right \}$ is a well know context free ... |
I've posted this question first on StackOverflow but this section seems more suited for this kind of questions.
Also I'm not trying to simply solve this exercise (it is a "parsing" exercise, once I'll figure out the regular expression I'll derive the equivalent Finite Automaton that accepts the language generated by th... |
In recent article of PM the memcomputing is presented. But I did not understand how it works, according to the text.
What is the general principle of work for this memcomputing? How it is done in hard-ware?
|
I am no computer scientist, so I can be naively missing some commonly implemented optimization strategies but...
Looking at two ways of counting words in a text (shown below), I tend to think that the iterative method, as it runs through each word in the text only once, will use less memory than the second method, expr... |
The purpose of this exercise is to write a program that recognize all the words derived from this grammar.
The time complexity of this program must be O(n) hence i must be able to derive a regular expression from the grammar
$S\rightarrow ASA\mid A$
$A\rightarrow aAa\mid aAab\mid bA\mid\epsilon$
By intuition I gues... |
I’m learning (self-taught) about language implementation and compiler design, and I’m implementing a toy language to cement the concepts in my mind. However, I’m having trouble understanding how scope trees are meant to be used.
In my toy language, I’m using the Visitor pattern to traverse the syntax tree as a simple i... |
There is a way to convert regular expression to DFA (deterministic finite automata)
which is to build a syntax tree and then compute first pos, last pos, follow pos, and then use a Transition technique to build DFA for that particular regular expression. But this case only works when operators in the regular expression... |
let's have these two languages in the alphabet $\{a,b,c\}$:
$L_1 = \{ w \mid w \text{ is a palindrome and $|w| < 200$}\}$
$L_2 = \{ w \mid w \text{ is a suffix of $u$ and $|u|$ is a prime number and $u$ doesn't contain a $c$}\} $
and I have to prove that $L_1 ∪ L_2$ is regular.
So my idea is I have to prove both langua... |
Given a finite set $\Sigma$ and a positive integer $n$, a mechanism is a set $\{ \mu_x \vert x \in \Sigma^n \}$ such that $\mu_x$ is a probability measure on some $\sigma-$algebra for each $x$.
Now given a communication protocol $P$ between two privately coin-flipping parties $A$ and $B$ who start with the inputs $x$ ... |
I'm trying to figure out how to build a regular expression for a language that doesn't contain substring bbb. The alphabet is {a,b,c}. I'm trying to construct a DFA and convert to help me get the Regular Expression but still stuck as I found the DFA a bit complicated. I appreciate any help. Thanks!!!
Ok, here is the Re... |
We know that checking whether some word w is accepted by a turing machine TM is undecidable. But what about the problem of finding one accepting word of a TM?
Are these two problems related in some way, i.e. undecidability of one implies the undecidability of other (in any structure, like FA, LBA, PDA etc)?
My hunch i... |
I am working on an algorithm which approximates a certain optimal quantity. The approximation becomes better when the size of the problem ($n$) becomes larger: the difference from the optimum is approximately $1/n$.
Initially, I wrote that the algorithm achieves an approximation of:
$$\Omega(1-1/n)$$
But, now I am no... |
Consider the the Geometric Brownian motion
$\qquad dX_t=\mu X_t dt+\sigma X_t dW_t$, with $X_0=1$, $\mu=0.2$, and $\sigma=0.30$.
for each $n=1,2,3,..$ let $h_n=1/n$, and let $X^n_n$ be the final value of the discrete process obtained from Euler scheme wrt $h_n$, i.e.
$\qquad X^n_{k+1}=X^n_{k} +\mu X^n_k h_n +X^n_k \... |
The required solution is given. I have to prove that its solution is $O(n\log n)$.
My idea is shown below:
I have to prove, $T(n) \le cn\log n$ for some constant $c$
$$\begin{align}
T(n) &\le 2c\log(n/2) + n\\
&= 2c\log(n) - 2c\log(2) + n\\
&= 2c\log(n) - 2c + n\\
&= c\log(n) + ( c\log(n) - 2c + n )\\
... |
Here is my implementation of mergeSort. I need n extra space for the helper array. But what about recursive calls? I call sort log n times. mergeRoutine is a tail call, and it doesn't add to the call stack.
The extra space I need equals to n + log n. How can the extra space be O(n)?
I think we just consider log n negl... |
Let $M_i$ be the Turing machine with Gödel number $i$. Let
$$A = \{i \mid M_i \text{ with input \(x\) halts after exactly 14 steps}\}$$
Is the set $A$ recursive?
|
I am stuck with understanding the transformation of final-state acceptance automaton into empty-stack acceptance automaton. From everywhere that I've read, it always says introduce a new start state with a new start stack symbol, and another state after the original final states for emptying the stack. I understand the... |
So there is an algorithm to convert lambda calculus terms to combinatory logic using SK combinators. It produces things that explode in size. I would like to know more about this explosion in size. I can't seem to think of a better algorithm however. I have heard of functional languages being practically compiled to co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.