instruction stringlengths 35 29.1k |
|---|
I'm currently working on a paper describing a new algorithm in computational science. If all goes well, this algorithm will be around for a while (within the specific community). As such, I want to set notation conventions that will not drive other people insane. The primary difference is that this algorithm makes use ... |
I read many things about the Turing machine and understand how it works but what I can't get the grasp of (and what none of the books seem to try to teach) is how should I approach a problem I am given to solve? I mean: checking if a word is a palindrome, for example, consists of 11 states in the book I'm learning from... |
A regular graph is one in which each vertex has the same number of neighbors, but in a star topology the central vertex is connected to more than one vertex. So, why is it referred to as a regular graph?
|
Suppose we have a classification problem and we wish to solve the problem by Neural Network. What factors must one consider choosing an NN structure? e.g Feed Forward, Recurrent and other available structures.
|
I'm trying to understand context-sensitive grammars.
I understand why languages like
$\{ww \mid w \in A^*\}$
$\{a^n b^n c^n \mid n\in\mathbb{N}\}$
are not context free, but what I'd like to know if a language similar to the untyped lambda calculus is context sensitive.
I'd like to see an example of a simple, but no... |
I'm trying to understand the approximation ratio for the Kenyon-Remila algorithm for the 2D cutting stock problem.
The ratio in question is $(1 + \varepsilon) \text{Opt}(L) + O(1/\varepsilon^2)$.
The first term is clear, but the second doesn't mean anything to me and I can't seem to figure it out.
|
This is my first post after being a passive user for some time now.
I wish to ask some questions if I may. I am not a mathematician but my question relates to the field of maths/computer science. In particular, the P vs NP problem. I am aware that this is a problem that elite professionals have not yet been able to ... |
I heard that random number generation in computers isn't really random, but there is no efficient algorithm to detect it. How can it be detected at all ?
|
I need some help with deciding if a given language is regular, context-free or not context-free.
Lets' say I have the following languages over the alphabet $\mathcal{A} = \{a,b,c,d\}$:
$$ \begin{align}
L_1 &= \{ w \in \mathcal{A}^* \mid \text{\(\#a(w)\) is even and \(\#b(w) = 1 \mathrel{\mathrm{mod}} 3\) and \(w \n... |
I'm trying to understand the equivalence in expressive power of formal grammars whose rules take the form:
$$ \alpha \rightarrow \beta $$ where $ |\alpha| \leq |\beta| $ (called a monotonic grammar), and grammars whose rules take the form:
$$ \alpha B \gamma \rightarrow \alpha C \gamma $$
where $\alpha $ and $\gamma$ ... |
There is an exercise in Distributed Algorithm I have some difficulties to solve. There are few ideas, however nothing useful at the time. I will appreciate any help with it.
Graph $G$ is a $k$-tree if it's possible to divide all it's edges to $k$ trees ($k$ subgraphs without a loop). Given network $N$ every processor k... |
Is it $\mathsf{NP}$-hard to decide whether $\mathsf{P}=\mathsf{NP}$ ?
If so, what are the implications ? Is there result suggesting that it is the case ?
|
I have a question about a specific pumping lemma problem for Context-Free Languages.
Suppose we have the following Language:
$L = \{a^{i}b^{j}c^{k}d^{l} \mid 0 < i < k \wedge j > l > 0 \}$
Here is my attemp to prove that the language is not context-free:
Assume $L$ is context-free. Let $n>0$ be the pumping length giv... |
I am looking to calculate the physical address corresponding to a logical address in a paging memory management scheme. I just want to make sure I am getting the calculation right, as I fear I could be wrong somewhere.
So, the data I have is as follows:
The logical address: $717$
Logical memory size: $1024$ bytes ($4... |
Does anyone have a pointer to a resource or, even better, a tip to provide on how to efficiently generate a very large matrix representing a connected graph.
Graph can be randomly created although I would ideally generate a graph of desired size and topology similar to what one can do with JGraphT.
My general intent i... |
Continuing in the vein of two prior questions (1) and (2), we started with sorting, where we had
a set of $n!$ input possibilities
a goal space of only one element consisting of the one correct sorted sequence
We then arrived at a generalized argument which I'll alter slightly and call A:
Define a space of input pos... |
I'm currently studying the book "Introduction to Algorithms - Cormen". Although a proof of correctness for the BFS algorithm is given, there isn't one any for the DFS in the book. So I was courious about how it can be shown that DFS visits all the nodes.
I also googled for it. But it seems that every lecturer do some c... |
I have a problem finding the right string to pump for the following language:
$$L_1 = \{a^{p+q}b^rc^sd^{q+r}e^s \mid p, q, r, s \ge 0\}$$
Which string should I choose to pump? The problem is that I don't know how to handle the fact that I have $p+q$ and $q+r$?
Can I choose:
$$Z = a^{2n}b^nc^nd^{2n}e^s$$
Thanks in advan... |
I am struggling in trying to figure out a non-deterministic algorithm for the following problem.
Consider the following problem, called the figure-of-eight problem (FOE). An instance is an undirected graph $G = (V,E)$ with vertices $V$ and edges $E$. $G$ is a yes-instance if there is a sequence of vertices $(v_{0},v_{1}... |
It is said that computability theory is also called recursion theory. Why is it called like that? Why recursion has this much importance?
|
I need some help with explaining why a grammar is not LL(1).
Let us take the following grammar:
$$
\begin{align}
S \rightarrow & aB \mid bA \mid \varepsilon \\
A \rightarrow & aS \mid bAA \\
B \rightarrow & b \\
\end{align}
$$
This is my attempt:
For the grammar to be LL(1) it is a necessary condition that for any stri... |
Given some complexity class $\mathsf{C}$, I want to know if there exists a function (Turing machine) $F:\mathbb{N} \to \mathsf{C}$ such that, if $S$ is any set for which the problem $x \mapsto x \in S$ is in $\mathsf{C}$, then $F(n)$ is a Turing machine which (partially, if $\mathsf C = \mathsf{RE}$) decides $x \in S$ ... |
I need some help with the following question:
One of the languages
$$L_1 = \{a^pb^{q+r}c^sd^{q+t}e^{p+r} \mid p, q, r, s \ge 0\ , s > t\}$$
$$L_2 = \{a^{p+q}b^rc^sd^{q+r}e^s \mid p, q, r, s \ge 0\}$$
is context-free and the other is not. Build a context-free grammar for the one that is. For the other one provide a proo... |
The Wikipedia article on processor registers mentions:
Address registers hold addresses and are used by instructions that indirectly access primary memory.
Which addresses does this sentence refer to?
|
I'm attempting to use the MT19937 variant of the Mersenne Twister PRNG to accomplish something. Whether or not this something is feasible depends upon the answers to these two questions:
What is the greatest value of m for which the following statements hold true:
1 - For all seed values, the algorithm eventually prod... |
There are three typical ways to allocate memory for programs: static, stack and dynamic heap. However, when I look at the implementation of dynamic heap memory allocation from wikipedia , what I found is fixed block allocation, etc. So why is dynamic memory allocation called "heap" memory allocation? How does it have s... |
An ambiguous Language is a formal language for which there exists a string that can have more than one meaning (several possible meanings or interpretations). Multiple synthesis structures for a string.
[Question]
Are Roman numbers an example of an ambiguous language?
Because there can be more then one representatio... |
I am new to Computability Theory and find it is both amazing and confusing. Specifically, it is difficult for me to get through the undecidability of the well-known Halting Problem.
Halting function: The Halt function takes an input a pair $<\alpha, x>$ and outputs 1 if and only if the TM $M_{\alpha}$ represented by ... |
I was reading about decision problem. I understand that decision problem tell yes/no answer for an input. The decision is based on a decision procedure also called an algorithm.
The wikipedia says that
It is traditional to define the decision problem equivalently as: the set of inputs for which the problem returns y... |
How do you determine the Time Complexity of a Genetic Algorithm(in general)? If possible.
I have been thinking about this a lot, and all of the teaching I have had is related to determining the Time Complexity of problems that are much less stochastic in nature.
|
Have read in Compiler textbook that type inference is context sensitive. Can anyone explain why is it so? This means that we need context sensitive grammar in semantic analysis phase of a compiler with this feature? How is it done in popular programming languages like C?
|
What would be a good book/resource that explains the basic idea behind those techniques, how to use (and maybe when to use them) and plenty of exercises with perhaps some worked examples (kind of like when for loops were introduced for the first time you were asked to use one to compute sums of odd numbers, even number... |
I wonder if there is a simple example of sets $A$ and $B$ such that $A$ is Turing-reductible to $B$ but not many-to-one reductible to $B$.
|
I do not ask you to respect that the processor is a physical black box whereas interpreter implementation is not that clear. As CS, you must look at the functionality aspect -- both processor (physical machine?) and interpreter (virtual machine?) execute a program (a stream of commands).
Isn't to interpret the code jus... |
I need to give a talk about expander codes at university (I'm a student of computer science). Since they have been introduced to show a family of codes looking good when thinking of the Shannon theorem, I wonder what real world application for expander codes exist.
As far as I know one has a real hard time when encodin... |
Hi I want to ask about weight selection in neural network using genetic algorithm.
Right now what I understand is
Initialize population
Encode the weight of the neural network to the chromosome
Calculating the error and fitness
crossover and mutation
looping until satisfy the condition
Is it the right thing?
if yes... |
What kind of heuristics are useful in a tree decomposition of a graph to find the k shortest paths from a given source to a vertex?
Moreover, the local shortest paths at each node in a tree are precomputed. Here, the graph is undirected and weighted. I'm interested in finding only simple paths, i.e., no nodes are repe... |
I'd really like your help with the proving or refuting the following claim: $BPP(0.90,0.95)=BPP$. In computational complexity theory, BPP, which stands for bounded-error probabilistic polynomial time is the class of decision problems solvable by a probabilistic Turing machine in polynomial time, with an error probabili... |
I have frequency data for different events under two conditions, resulting in sets of frequencies F1 and F2. I would like to normalize the frequencies of events under condition 1 by their frequencies under condition 2. However, there are events that occur in condition 1 but not condition 2, resulting in divide-by-zero ... |
I have 2 questions regarding Bipartiteness with corresponding examples.
1) Can a non-connected graph be bipartite if it has an isolated vertex? Let's take the following graph:
I would say YES with this partition:
V1 = {A, D, G}
; V2 = {B, C, E, F, H}
But what confuses me is that A is isolated.
Is that a contradiction... |
How to represent $0.148 * 2^{14}$ in normalized floating point arithmetic with the format
1 - Sign bit
7 - Exponent in Excess-64 form
8 - Mantissa
$(0.148)_{10} = (0.00100101\;111...)_2$
We shift it 3 bits to left to make it normalized $(1.00101\;111)_2 * 2^{11}$.
Exponent = $11+64 = (75)_{10} = (1001011)_2$ and Mant... |
The cyclic shift (also called rotation or conjugation) of a language $L$ is defined as $\{ yx \mid xy \in L \}$. According to wikipedia (and here) the context-free languages are closed under this operation, with references to papers from Oshiba and from Maslov. Is there an easy proof of this fact?
For regular languag... |
Let's consider distributed version of algorithm for finding MIS of any graph $A$.
For details, MIS - Maximimal Independent Set.
Slow version of distributed algorithm for MIS, page 2 - Distributed algorithms. Maximal Independent Set
In worst case, time complexity of the algorithm is $\text{O}(n)$ and a message complexi... |
I am doing some excercises to train myself in computability.
There is one that I am not able to solve, here it is.
Consider the following transformation associated to an extended WHILE program:
For all $x \in \mathbb{N}$,
$\begin{cases}
A f(x) = x \cdot f((x+3)/2) & \text{if \(x\) is odd} \\
A f(x) = f(x+1) & \text... |
I have a tree of foods, which I'd like to search to find relevant nodes. What's the best way to rank the results?
Here's an example sub-set after a search for "apple":
|-- apple pie
|-+ apples
| |-- cooking
| |-+ eating
| |-- average
| |-- Granny Smith
| |-- Golden Delicious
|-- pork and apple casserole
Currentl... |
Q: Consider a demand-paging system with a paging disk that has an average access and transfer time of 20 milliseconds. Addresses are translated through a page table in main memory, with an access time of 1 microsecond per memory access. Thus, each memory reference through the page table takes two accesses. To improve t... |
Consider the following problem:
Let a $k$-wheel be defined as an indexed circularly linked list of $k$ integers. For example…
{3, 4, 9, -1, 6}
…is a 5-wheel with 3 at position 0, 4 at position 1, and so on. A wheel supports the operation of rotation, so that a one-step rotation would turn the above wheel into…
{6... |
I am confused about how PP and BPP are defined. Let us assume $\chi$ is the characteristic function for a language $\mathcal{L}$. M be the probabilistic Turing Machine. Are the following definitions correct:
$BPP =\{\mathcal{L} :Pr[\chi(x) \ne M(x)] \geq \frac{1}{2} + \epsilon \quad \forall x \in \mathcal{L},\ \epsilo... |
I've designed an algorithm to find the longest common subsequence. The steps are:
Start with i = 0
Picks the first letter from the first string start from $i^{th}$ letter.
Go to the second string looking for that picked letter.
If not found return to the first string and picks the next letter and repeat 1 to 3 until i... |
How is an algorithm with complexity $O(n \log n)$ also in $O(n^2)$? I'm not sure exactly what its saying here, I feel it may be something to do with the fact that big-oh is saying less than or equal to, but I am not fully sure. Any have any ideas? Thanks.
|
Let $A$ be the language $\{\langle M\rangle\mid M\text{ is a Turing machine that accepts only one string}\}$
According to my understanding, if a Turing machine is able to decide if another Turing machine will accept only one string, then the halting problem could also be solved. Therefore, $A$ is non-recursively enumer... |
If a language is defined such that
$L = (0+1)^{\ast}$ if $\mathsf{P} = \mathsf{NP}$ and $\emptyset$ otherwise
Then $L$ is a regular language if $\mathsf{P} = \mathsf{NP}$, otherwise it is the empty langauge.
Therefore $\mathsf{P} = \mathsf{NP}$ , $L$ is recursive (being regular), but is $L$ still recursive if $\ma... |
Let $L_{1}$ and $L_{2}$ be two languages defined as follows :
$L_1 = \{ \langle M\rangle \mid L(M) \neq \emptyset \}$
$L_2 = \{ \langle M\rangle \mid L(M) = \emptyset \}$
where $\langle M\rangle$ denotes the encoding of a Turing Machine $M$.
$L_{1}$ is the set of encodings of TMs that accept at least one stri... |
Does the proof of the widely believed result P $\neq$ NP depend on the proof of NP $\neq$ Co-NP ?
|
I have a set of strings. My goal is to find a minimal set of longest prefixes which will match most of that set.
For instance, if my set is:
abracadabra
abracado
abramu
banana
bananasplit
bananaicecream
xylophone
zebra
zeitgeist
zello
I would want the output to be:
banana (len 6, matches 3)
abra (len 4, matches 3)
xy... |
Suppose I have the set of weights $W = \{w_1,w_2,\ldots,w_{50}\}$ where each $1 \le w_i \le 60$ is an integer. I am interested in determining all subsets (not just one, and not just the number of them) of $W$ with a fixed sum $s$. I realize this is obviously NP-hard, but are there some efficient ways (e.g. dynamic pr... |
Consider the following problem:
Let $k$ be a constant. We are given a $k$-ary array $A_{d_1\times\ldots\times d_k}$ of $0$ and $1$'s. Let $N = \prod_{i=1}^k d_i$.
We want to create a data structure by preprocessing $A$ to perform the following type of query operations:
Given the coordinates of a $k$-ary box $D$, is t... |
I need to design a Turing Machine that accepts the (context-free) language: $L(M)=\{0^{n}1^{n+1}: n\ge1$}.
$$Q=\{q_0,q_1,q_2,q_3,q_4\} ,Σ = \{0,1\}, Γ =\{0,1,X,Y,B\}, F=\{q_4\}$$
X- processed 0
Y- processed 1
B- blank
P-move right
L-move left
So far I've succeeded to create a table for languages $\{0^n1^n\}$(without th... |
When doing mental calculus one can do:
Given an integer k, sum all the digits (in base 10),
and if the result is a multiple of 3, then k is a multiple of 3.
Do you know of any algorithm working similarily but operating on binary numbers digits (bits)?
At first, I was thinking of using the ready made functions of my... |
We have a broken stick. For every part, we know it's length. Our task is to connect all parts (glue them), that we will use as small amount of glue as possible.
The amount of glue need to connect two parts equal the maximum from their sizes. We can only glue two parts at one time.Can we solve this problem in the time ... |
I have a some objects with priority that is compound type and is only partially ordered. I need to select the objects in order of this priority (i.e. yield minimal item each time). But rather than arbitrarily completing the order, I would prefer if the queue was stable in a sense that if there is more than one minimal ... |
I need help figuring the potential function for a max heap so that extract max is completed in $O(1)$ amortised time. I should add that I do not have a good understanding of the potential method.
I know that the insert function should "pay" more in order to reduce the cost of the extraction, and this has to be in rega... |
In peer-to-peer (P2P) networks nodes are interconnected with each other. In client/server (C/S) networks clients talks to the server. If in a C/S network clients also want to talk with each other (such as in a multiplayer online game), then clients would have to communicate through the server.
Given these, is it possib... |
Suppose there are $n$ tasks, which need to be scheduled by a pre-emptive scheduler. Each task $T_i$ has a deadline $d_i$ and a total processing time $t_i$ associated with it. Now, all $n$ tasks are given a priory to the scheduler. The scheduler can run a task for 1 unit of time in one go. After each unit of time, it ca... |
Yesterday I've done some research how to optimize genetic algorithm and I've encountered a very interesting theory that we can use Lamarckian theory (adaptive theory) to optimize the neural network. But I still didn't understand how can it be done? What I've read from some source to optimize the genetic algorithm we mu... |
I'm working exercises on solving recurrences, just using subsitution, master theorem is after this chapter. I'm sort of stuck on one of the exercises. It states that:
The solution of $T(n) = 2T(\lfloor n/2 \rfloor) + n$ is $O(n \lg n)$. Show that it's also $\Omega(n \lg n)$ and conclude that the solution is $\Theta(n \... |
The subset-sum problem is a classic NP-complete problem:
Given a list of numbers $L$ and a target $k$, is there a subset of numbers from $L$ that sums to $k$?
A student asked me if this variant of the problem called the "subset product" problem is NP-complete:
Given a list of numbers $L$ and a target $k$, is there a... |
I am new to discrete mathematics and the theory of computation I am trying to learn and understand the terminology.
I am having a difficult time understanding the difference between a set and a sequence. I understand that unlike a set, in a sequence order and repetition does matter and sequences contain objects rather... |
In context of data mining, what does it mean for an association rule measure to be maximal?
I cannot understand the term maximal in this context.
I know of maximal independent sets in algorithms but cannot make out this term.
|
I was reading about counting principle related to TOC. I understand that the set of TMs are countable infinity. I couldn't understand the significance of it. What is its not countable?
|
Say I have numbers with known factorizations $n = \prod \limits _i p_i ^{n_i}$ and $m = \prod \limits _i p_i ^{m_i}$ (where $p_i$ is the $i$th prime).
How hard is it to factorize $m+n$? Is there a more intelligent algorithm than if factorizations of $m$ and $n$ were not known? Assume $n$ and $m$ coprime as it is trivi... |
I have a system in existence which works on parent-child model.
They share common attributes, as they belong to same class.
A parent can enforces certain data on any user selected attribute, and the data is required to be propagated down the hierarchy for the same attribute in all children and their children.
For a gi... |
A function is $(\varepsilon, t)$-collision resistant if there is no boolean circuit (using "not", "and", "or") of size at most $t$ which outputs a collision with probability at least $\varepsilon$.
Let $h_0:\{0,1\}^{2m}\rightarrow\{0,1\}^m$ be a $(\varepsilon, t)$-collision resistant hash function and $i\in\mathbb{N}_{... |
I was reading a few notes on Proof by Restriction and I am confused:
A Valid Proof by Restriction is the following:
Directed Hamiltonian Cycle Problem is NP Complete because if we look only at instances of DHC where For $G=(V,E)\quad (u,v)\in E \leftrightarrow (v,u) \in E$ then it reduces to Hamiltonian Cycle which we ... |
With the advent of BWAPI, many AI enthusiasts have been making amazing AIs that can compete against top players in Starcraft. This led me to wonder if RTS (Real-Time Strategy) games can ever be solved theoretically.
One of my colleague argues no, because RTS games are non-deterministic and stochastic. What does this m... |
I took a course on compilers in my undergraduate studies in which we wrote a compiler that compiles source programs in a toy Java-like language to a toy assembly language (for which we had an interpreter). In the project we made some assumptions about the target machine closely related to "real" native executables, inc... |
I'm looking at collision detection in communication protocols, in particular Carrier sense multiple access with collision detection (CSMA/CD). According to what I've read on Wikipedia, a collision seems to cause the wave of the outgoing signal and the wave of the incoming signal to overlap. Thus, the signal has values ... |
I already understood how the well-known algorithms like Graham's scan, Quickhull, etc. work, but I have difficulties in understanding 2 naive algorithms to compute the convex hull:
Let $S= \{p_1, \dots , p_n \}$ a set of points and $CH(S)$ the convex hull of $S$.
The first problem and corresponding algorithm are as ... |
I am researching collaborative editing systems for some work, but so far my search is turning up blank.
Collaborative real-time editing systems almost all have features like:
Many users can edit the document at the same time
All changes are dated and saved in a linear revision history
Edits are visible in semi-real ti... |
I would like to know in which classification is the R programming language. It has elements of the imperative paradigm and object oriented paradigm (some things like that even a number is an object and they can be freely mixed). I am not quite sure if it has functional programming characteristics. So it can be consider... |
Let $B$ be a boolean formula consisting of the usual AND, OR, and NOT operators and some variables. I would like to count the number of satisfying assignments for $B$. That is, I want to find the number of different assignments of truth values to the variables of $B$ for which $B$ assumes a true value. For example, th... |
I was studying binomial heaps and its time analysis. Are there any inputs that cause DELETE-MIN, DECREASE-KEY, and DELETE to run in $\Omega(\log n)$ time for a binomial heap rather than $O(\log n)$?
|
My CS Theory Professor said that when proving that a language is not regular by the Pumping Lemma, that there are some 'tricks' for solving languages more complicated that something like $L = \{a^{n} b^{n}\mid n \in\mathbb{N}\}$. Although I know that these come with practice, I wondered if this community would have som... |
For the $n$-th prime number $p_n$ the primorial $p_n\#$ is defined as the product of the first $n$ primes.
What is the complexity of testing if a given number $n$ is a primorial?
Is it related in some way to the FACTORING problem?
|
I am studying primitive recursive functions and there's something that I don't quite understand: let's take the function that computes $x+y$, then, in order to show that $f(x,y)=x+y$ is primitive recursive, my lecture notes give the following equations:
\begin{cases}
f(x,0)=x \\
f(x,y+1) = f(x,y)+1
\end{cases}
... |
As this thread title gives away I need to prove $x^y$ to be a primitive recursive function.
So mathematically speaking, I think the following are the recursion equations, well aware that I am assigning to $0^0$ the value $1$, which shouldn't be, since it is an "indeterminate" form.
\begin{cases}
x^0=1 \\
x^{n+1} =... |
Consider the following problem: Given two graphs $G_1 = (V_1, E_1)$ and $G_2 = (V_2, E_2)$ and some non-negative integer $k \in \mathbb{N}$, is it possible to delete at most $k$ vertices from $G_1$ to obtain $G_1'$ such that $G_1' \cong G_2$, i.e. the resulting graph is isomorphic to $G_2$.
I have to show that this pr... |
I'm thinking about the optimal algorithm for the following problem:
Input data:
a text, say it's an article about 5-50 pages.
a set of ngrams (ngram strings, n>2), of arbitrary length, could be more than 20k n-grams.
The algorithm should output the following:
a dictionary of all ngrams that were found in the text wi... |
Is it possible to use Warshall's algorithm (calculating the transitive closure) to determine if a directed graph is acyclic or not?
I'm trying to achieve this but getting stuck on the reflexive property of the transitive closure!
|
A true/false question: If a DFA $M$ contains a self-loop on some state $q$, then $M$ must accept an infinite language.
The answer is "false". I've read this question, but I'm still wondering why $M$ does not necessarily accept an infinite language. Isn't the language $b^*$ infinite? Don't all self-loops look like $b^*$... |
I'm having difficulties understanding the solution to the following question:
Consider the following description of a LAN:
The main Internet connection is connected to our gateway router. This
in turn is part of the backbone network on the 65.21.1.0/24 subnet.
The backbone also supports two further routers SALES a... |
If the definition of Initial Algebra is:
"An object is initial if there exists a unique morphism from the object to every
object in the category"
Why do we need such object, and could any one give an example ?
|
I'm not sure if this statement is correct, but my friend said so.
The problem arose from this T/F question:
Let $F=\{f: f$ be a primitive recursive function from $\mathbb{N}$ to $\mathbb{N}\}$, then $2^F$ (Power set of $F$) is uncountable.
And its answer is True. The set of primitive recursive functions is countable, a... |
Is this variant of the subset sum problem easy/known?
Given an integer $m$, and a set of positive integers $A = \{x_1, x_2, ..., x_n\}$ such that every $x_i$ has at most $k=2$ bits set to $1$ ($x_i = 2^{b_{i_1}}+2^{b_{i_2}},\;\; b_{i_1},b_{i_2}\geq 0$); is there a subset $A' \subseteq A$ such that the sum of its eleme... |
I am learning about context free languages.
I understand how $\{a^n b^n c^n | n \ge 0\}$ can be shown to be not context free using the pumping lemma for CFL's.
Intuitively however it seems that a pushdown automata to recognize $\{a^n b^n c^n | n \ge 0\}$ can be constructed. This PDA would initially push two $a$'s into... |
$L_1=\{a^ku \mid u \in \{a,b\}^* $ and $u$ contains at least $k$ a's, for $k\geq 1\}$.
If it is regular, I haven't found its regular expression or any closure property to prove it.
If not, it seems pumping theorem holds for it...
Also, what about the language where the above "at least" is changed to "at most"?
|
This is a snippet from some pseudocode for a sorting algorithm. In it, the symbol ← is used to denote assignment, for example for the variable done. However, in the while loop the statement done:= false is written. I would assume it is also an assignment statement but I suspect it means somethings else, or perhaps extr... |
From what I've read, Big O is the absolute worst ever amount of complexity an algorithm will be given an input. On the side, Big Omega is the best possible efficiency, i.e. lowest complexity.
Can it be said then that every algorithm has a complexity of $O(\infty)$ since infinite complexity is the worst ever possible?
... |
Let $\varphi(x)=2x$ if $x$ is a perfect square, $\varphi(x) = 2x+1$ otherwise. Show $\varphi$ is primitive recursive.
In proving $\varphi$ to be a p.r. function I think it could come in handy the following theorem:
Let $\mathcal C$ be a PRC class. Let the functions $g$, $h$ and the predicate $P$ belong to $\mathcal C$,... |
Finding Big-O is pretty straightforward for an algorithm where $f(n)$ is
$$f(n) = 3n^4 + 6n^3 + 10n^2 + 5n + 4$$
The lower powers of $n$ simply fall off because in the long run $3n^4$ outpaces all of them. And with $g(n) = 3n^4$ we say $f(n)$ is $O(n^4)$.
But what would Big-O be if instead of 3 we were given a really s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.