instruction stringlengths 35 29.1k |
|---|
There is a program, BEATRIX, that can understand textbook physics problems specified by a combination of English text and a diagram. The result of the understanding process is a unified internal model that represents information derived from both the text and the diagram.
Here is a diagram problem and the diagram that ... |
I need to describe by a graph a turing machine that can accept the language:
A = {0^(3^n ) |n≥0} = { 0 , 000 , 0^9 , 0^27 , ... }. zeros in powers of 3
This here is a turing machine that can accept the language:
A = {0^(2^n ) |n≥0} If that helps somehow..
|
I'm reading Wadler's paper called "How to make adhoc polymorphism less ad hoc".
I'm trying to understand the given rules for function overload (over and inst) and I want to create a small example of a proof tree using them. All deductions rules are in Figure 9 and Figure 10.
I decided to proof the following expression/... |
I'm working on simulating a network architecture. I'm representing every node and their connections as a connected graph with no directional edges. I need some help with my reasoning.
Every node in network is connected to exactly 3 others. Is it possible for me to prove that every two nodes have a path of length O(n/3)... |
I've often heard that the C declarator syntax described as "an experiment that failed." I've seen claims that this sentiment is also shared by its creator Dennis Ritchie. Does anybody have an actual citation for this?
I'm doing a related project and writing the documentation for it and it would be nice to have said cit... |
How can I find the lexicographicaly smallest string that doesn't start with a given prefix AND is lexicographicaly bigger than the given prefix? Example:
prefix : cat;
next string : cau
prefix : cazz
next string; cb
|
I am a software engineer and after a discussion with some colleagues, I realized I do not have a good grasp of the concept serialization. As I understand, serialization is the process of converting some entity, such as an object in OOP, to a sequence of bytes, so that the said entity can be stored or transmitted for su... |
To prove that $P \subseteq P_{\ poly}$ [see book by Arora and Barak, chapter 6, page no 105]
Proof : Let $M$ be an oblivious TM and running time is $T(n)$, let $x \in \{0,1\}^* $ be some input for $M$ and define the transcript of $M$'s execution on $x$ to be the sequence $z_1,z_2,..z_{T(n)}$ of snapshots (the machine... |
I'm trying to implement the Hindley-Milner type system, following Milner 1978, "A Theory of Type Polymorphism in Programming" (link). In the Hindley-Milner system, a polymorphic let-bound expression may take on a different type each time it is referenced. For example, we can have let id = (λx · x) in (id 3, id true) wh... |
Its well known that Lomuto's partitioning algorithm results in too many unnecessary swaps. Can we modify the algorithm in this way:
Initialize a pointer a that points to the first position in the array, and initialize b to a.
While the element at b is lesser than the pivot, Move B by 1.
Set a = b.
WHILE b doesn't reac... |
This question is not asking for a solution, but rather as a check / validation of my thought process.
Given the form: $W = \forall X.((\forall Y.\exists Z. R(X,Y,Z)) \land \forall S. \exists T. R(X, S,T))$
The algorithm I learnt states, that I have to 1th bring $W$ into prenex form. Doing so I bring all quantors to t... |
The following table shows a possible set of Huffman codes to be used for lossless compression of a text consisting only of the eight letters shown:
e t o h l p w z
10 01 111 110 0001 0000 0011 0010
The codes will have been chosen ... |
The minimum vertex cover problem is $NP$-hard for the planar graph of degree at most $3$. However, the minimum vertex cover can be easily found in some certain types of planar graph, given the planar representation. For example, the planar graph that every face boundary is a cycle of even length.
Is there any proof th... |
This algorithm runs natively in O(V * E^2).
The description states that
The running time of O(V * E^2) is found by showing that each augmenting path can be found in O(E) time, that every time at least one of the E edges becomes saturated (an edge which has the maximum possible flow), [...]
My graph has the property ... |
We have an uncertain graph $G$ where each edge $(u,v)$ exists with a probability $p_{(u,v)} \in (0, 1]$. We want to assign a score in $[0, 1]$ to each pair of vertices $u$ and $v$ which represents the likelihood that they lie in the same connected component.
If the only possible scores were discrete $0$ and $1$, then t... |
What does it mean that the bound $2n^2 = O(n^2)$ is asymptotically tight while $2n = O(n^2)$ is not? We use the o-notation to denote an upper bound that is not asymptotically tight.
The definitions of O-notation and o-notation are similar. The main difference is that in $f(n) = O(g(n))$, the bound $0 \leq f(n) \leq cg... |
As per my understanding, a program can take a different amount of time to run on different machines because it is dependent on hardware. So we use big O notation which is independent of hardware to compare the performance of two algorithms as the input grows.
I am working on an algorithm which has a complexity of $O( X... |
I am currently working in solving Conway's Game Of Life problem for a Parallel and Distributed Computing course.
The problem is a little bit different form the original, in the sense that instead of having a 2D representation of the cells we have a 3D one, each cell is represented by three ints. When considering neighb... |
Consider the following bipartite graph:
Each node in red color represents a warehouse $w = \{ 1,2,3\} $. For this example we have three warehouses located at different locations. Each warehouse has a cost of opening ${c_w} = \{ 7,8,10\} $ for all $w$. In addition to that, each warehouse provides different resources ${... |
I was watching the AI Stop Button Problem from Computerphile, and was very confused on the difference between two approaches.
Background: there is a barebones general intelligence running in the form of some robotic device. The device acts in accordance to optimize some utility function. The GI is asked to make tea, an... |
In this lecture note,
The average-case running time is defined by the expected value, over all inputs $X$ of a certain size, of the algorithm's running time for $X$:
$$T_{\text{average-case}}(n) = E_{|X| = n}[T(X)] = \sum_{|X| = n} T(X) \cdot Pr[X].$$
This wiki article (Quicksort) gives an average-case time comple... |
What is the intuition behind the Geometric Burrows-Wheeler Transform? And how can I use a GBWT with blocking factor $d$ to match a given pattern $P$ of length $|P| = m$ with
$m \ge d$
$m < d$
What benefits does it have over the standard BWT used with backward search?
|
I studied methods for inserting new nodes into Red-black trees for the first time this month.
In doing so, I read a lot of pages on the internet and found that ( if I'm not mistaken ) there are many, many, many accepted algorithms for inserting nodes into red-black trees.
Furthermore, I noticed that it is possible to h... |
In other words, are they equally powerful?
(for word automata the answer is "yes"; this question is about tree automata).
(i am talking about tree automata that work on $in$finite trees)
|
How can I use divide and conquer to improve the running time of this algorithm?
input: A sorted array of length n
output: the # of elements such that abs(A[i]) <= k
|
Consider the follow operations on a stack of size at most $k$.
Push - insert element in the stack - actual cost 1
Pop - remove top element from the stack - actual cost 1
Copy - copy whole stack (but maintain the number of elements) - actual cost is the number of elements in the stack
Prove using the potential method th... |
Assume a proper and complete binary tree $T$ with $n>1$ nodes. Let $E(T)$ represent the sum of the depths of all external nodes in $T$, and $I(T)$ represent the sum of the depths of all internal nodes in $T$. Prove that:
$E(T) = O(n⋅\log n)$
To prove this that it is equal to $E(T)$, do I just go plug in numbers till ... |
Is there a term for programming languages that read like written sentences? I'm thinking of languages like Python, where you can almost read the code aloud as a sentence, as opposed to C++ which is really arcane.
For example, in Python if 'pizza' not in animals is very clear when read aloud.
Seems like maybe there's a ... |
Input : Adjacency-list representation of Directed acyclic graph (Boolean circuit). see Complexity theory by Arora and bark, page no- 104
Find : Adjacency matrix representation of DAG (Boolean circuit).
My attempt :
Let us assume that DAG has $n$ vertices.
First of all create a $n \times n $ table for adjacency mat... |
Is there a concise/existing way to denote the expressive power of "lambda calc without using parentheses/tree-of-expressions/application-order-restructuring anywhere"?
Can you do without them/reinvent them? Does it break completely (i.e, even with a naive no-more-parentheses, you're using them implicitly, like when na... |
I'm taking a course about submodular functions and their applications towards influence maximization in a network. We've been discussing a greedy algorithm for selecting $k$ initial nodes to maximize influence and I'm confused about a statement made in class.
Let $O = \{o_1, . . . , o_l\}$, and $o_{\max}$ be the elemen... |
Let $G=(V,E)$ be an undirected graph in which $V = \{v_1,v_2,\dots,v_n\}$.
I need to describe a reduction from the 2-coloring problem to the 2-SAT problem (in polynomial time).
I thought of splitting each vertex $v_i$ into $v_i^*$ and $v_i^{**}$, one for each color. Then I was thinking about making for each edge $(u,v)... |
I would like to make a program which finds similar packets (there might be more then one class of similarity) in packet list (which is updated all the time). Are there any efficient algorithems to find these similarities?
By similarities I mean that they have the same size, type and payload.
I thought about using tree... |
Suppose that a valid lottery ticket consists of a sequence of 7 numbers drawn from the set $\{1,2,\ldots,59\}$. Given a string like "$12345678$", I want to efficiently print all the lottery sequences using every digit in the input string.
In the example above, a couple of possible sequences are:
${1,2,3,4,56,7,8}$ or ... |
Let $M$ be a variant of Turing machine with no working tape but with several heads on input word. Prove that these machines accept exactly the languages in $L$.
Please hint me how to start.
|
I have a question about the Euclid's Algorithm for finding greatest common divisors.
gcd(p,q) where p > q and q is a n-bit integer.
I'm trying to follow a time complexity analysis on the algorithm (input is n-bits as above)
gcd(p,q)
if (p == q)
return q
if (p < q)
gcd(q,p)
while (q != 0)
... |
Oftentimes I find myself wanting to use integer programming to find a solution to a particular problem, without caring about optimizing a certain variable at all.
I've found that most packages that offer integer programming do not provide this feature.
Is it then correct to assume that maximizing/minimizing a solution ... |
The following problem is from CLRS (31.1-13, Page 933, 3rd edition):
Give an efficient algorithm to convert a given $\beta$-bit (binary) integer to a decimal representation. Argue that if multiplication or division of integers whose length is at most $\beta$ takes time $M(\beta)$, then we can convert binary to decimal... |
There is a display of NxN (N<=90) pixels with some blocked pixels and a snake of width = 1 pixel and variable length and two players A and B play a game.
The game proceeds as follows -
Both players take alternate turns.
In each turn, the player has to extend the length of the snake by moving it's head in either of th... |
Here is a context free grammar that I have been given for practice:
Grammar $G = (V,\Sigma,R,S)$ where $V$ is $\{S,A,B,a,b,c\}$ and $\Sigma$ is $\{a,b,c\}$. $R$ has the following rules:
$$\begin{align}S &\to A\\
A &\to BB\\
S &\to bS\\
S &\to cS\\
A &\to a\end{align}$$
I am fairly sure that it is not ambiguous, since f... |
I implement my data sets with a tree data-structure.
The tree data-structure has a method named MakeSet which creates a set with one node. The tree data-structure has also a method named Merge(i,j) which merges trees of set i and set j in this way: the set with smaller depth becomes a child of the root of the set with ... |
I have an algorithm that I think its complexity is O(n^2). However, our teacher insists that the algorithm takes O(n) time. How can it be? Here is the pseudo-code of the algorithm:
// A is the input array.
// |A| is the size of the input array.
i = 1
j = 1
m = 0
c = 0
while i < |A| {
if A[i] == A[j]
c = c ... |
I read somewhere that the Apollo Guidance Computer was designed in such a way, that, although it is hugely less powerful than the average smartphone, it was dependable to the point that it "never crashed". My questions pertaining to this were:
Is designing such a digital system possible, even in the '60's ?
What are t... |
I'm looking for an application of the dining philosophers problem. Is there some real life system that faces the concurrency problem of "the dining philosophers problem" and implements a solution? I've been searching for over an hour.
It would be even better if the implemented solution is Tanenbaum's solution described... |
Let $$R = \{\langle M \rangle \mid L(M) \text{ is decidable}\}.$$ Is $R$ recursively enumerable or co-recursively enumerable?
|
I need an algorithm to convert a green hackenbush graph to it's equivalent tree so that I can find the Grundy value of the Graph using colon principle.
I thought of finding the bridges in the given graph and compressing cycles into one node using the fusion principle but I fail to implement it when there are cycles wit... |
We have a directed graph $G=(V,A)$ with $V=\{1,2,...,n\}$ where for each $(i,j)$ the distance $l(i,j)\in A$ is known. We want to find a pyramidal tour that has minimal length and that includes all points exactly once.
A tour is pyramidal if it is of the form: $(n\rightarrow 1 \rightarrow n)$ such that all points in $n... |
From Reading 17 of 6.005 — Software Construction:
Exercise Reading a Grammar 4:
Which strings match the root nonterminal of this grammar?
root ::= (A B)+
A ::= [Aa]
B ::= [Bb]
aaaBBB
abababab
aBAbabAB
AbAbAbA
Answer: 2 and 3
So far so good.
Exercise Reading a Grammar 3:
Which strings match the roo... |
In my earlier Question asked here Help in understanding how to apply nonlinear function in hashing about chaos cryptography, since then I have come across several research papers that apply atleat theoretically chaos based cryptography. It is still an active area of research with advantages and disadvantages.
How can ... |
I know that this doesn't work because shortest path with a lot of edges may have bigger weight than a longer path with less edges. But what if, you keep track of the edges that our current weight path on each node and when we compare we subtract the number of edges on this path * the constant so that we get the origina... |
The question is: given a sequence of numbers, find an algorithm that determines if the sequence of numbers is in post order traversal of a binary search trees.
Up to now, I have understood the following:
In the post order traversal of the binary tree it follows Left, Right, Root. So the Left value has to be less than... |
I want to develop a previous question regarding Von Neumann debiasing /randomness extraction.
The typical solution (as posted) is to take pairs of throws and output a bit based on a comparison of the two throws. This is the most simple solution.
My problem is that it's very wasteful of input entropy. The biased d... |
I came up with an implementation in c for arrays which can be extremely large yet only use an amount of memory proportional to how much data you have written to it. What I want to know is if there is a name for this kind of list or structure. Here is my code in C for the structure and example use:
#include <stdlib.h>
#... |
I am trying to understand what the difference is between the fractional knapsack problem using dynamic programming, and the greedy solution version. Im looking at an example of the fractional problem which looks like:
What's the difference between that and the greedy solution? Are you not just taking the value-per-pou... |
I am studying a data structures course in which we have given many assignments on constructing data structures (like trees, arrays, and linked lists).
In class template, what kind of notation should I write for these operators (::,->) and the others operators which are used in C++? Can anyone elaborate more about writi... |
Let $M_0$, $M_1$, $M_2$,..., be an effective enumeration of all Turing machines. Which of the following problems is (are) decidable ?
Given a natural number $N$, does $M_N$ starting with an empty tape halts in fewer than $N$ steps ?
Given a natural number $N$, does $M_N$ starting with an empty tape halts after at leas... |
I have variables $x \in \{0,1,\dots,5\}$ and $y \in \{0,1\}$, where
$$y = \begin{cases} 0 & \text{if } x = 5\\ 1 & \text{if } x \neq 5\end{cases}$$
My problem is to maximize $y$. How can I use linear constraints for this?
I tried certain cases like Cast to boolean, for integer linear programming but that won't work if ... |
Assume that I have some functions $f$ and $g$, both implemented perfectly, where
$$
f(x, g(z)) = \sum_{k=0}^{k=\lfloor{x}\rfloor}g(k)\quad (x > 1)\,.
$$
Function $g$ is of unknown definition. I would like to express the time complexity of $f$ in big-O notation. My initial thought was to do something similar to:
$$
O(\s... |
I'm trying to implement the Biased Crowding Distance in NSGA-II as described in the paper Integrating User Preferences into Evolutionary Multi-Objective Optimization by Branke and Deb.
Basically, from what I understand, given a set of points on a Pareto-front, we need to project the points onto a hyperplane with a dir... |
I am thinking that is the following a problem solved by nominal unification.
$\lambda a.X = \lambda b.\lambda c.c $
where we find $X$. The answer is obvious.
The reason is that it seems in nominal unification $X$ always will be an atom, not a function such as $\lambda c.c$.
The theory seems works fine with this input, ... |
I'm seeking some clarification on a description of the RAM model in CLRS on page 23, section 2.2 (Analyzing Algorithms).
Firstly, it is mentioned that we assume integers are represented with $c\cdot\log_2 n$ bits for some constant $c\geq 1$. Now take the integer value $2$, would it not be the case that we would need mo... |
I'm rather new to formal languages and reading up on Peter Linz's An Introduction to FORMAL LANGUAGES and AUTOMATA. As an exercise in the pre-requisite chapter, there's a proof. I'm not so familiar with formal proofs so I would like someone to tell me:
Does it prove it?
How would you make this proof stronger? I am not... |
Let's say I have a disk with an average seek time of 10ms, an average rotational latency of 5ms and a transfer time of 1ms for a 4kb block and the cost of reading the block is the sum of these values. If I have to sort a large relation consisting of 10,000,000 blocks of 4kb each and I have 320 blocks of main memory ava... |
Let $a,b>0$ and suppose we have divided the domain $\Lambda:=[0,a]\times[0,b]$ into a grid of width $n_x$ and height $h_y$.
We enumerate the grid from bottom to top and left to right. Given $(x_0,y_0),(x,y)\in\Lambda$, I want to iterate over each grid cell through whose interior the line segment connecting $(x_0,y_0)$ ... |
I might be wrong but I think it must be 2^6 = 64 integers?
|
Is it possible to find all simple directed graphs given a set of nodes? I was thinking of just finding all permutations of an adjacency list of lists. For example, given nodes A, B I can have the adjacency lists:
A | \
B | \
A | B
B | \
A | \
B | A
A | B
B | A
The constraints are: no self loops, simple graph, direc... |
For example,
given an element-wise function $f$, with input $x\in\{0,1\}^{p\times n}$, the complexity $T(f(x))=O(n)$, and that all numbers are represented using $p$ binary digits. Suppose that we also know the complexity of each individual operations inside $f$. For example, multiplication takes $O(m^{1.585})$ using Ka... |
The proof of $P\subseteq P_{\\poly}$, Let $M$ is a Turing machine with $T(n)$ is running time and goal here is to design a boolean circuit of size $O(T(n))$ (for more detail see Arora and Barak page no -105 ).
The idea is that you can compute configuration $c_i$ from configuration $c_{i−1}$ by examining the content o... |
Consider domain $X$, label set $ Y=\{0,1\}$ and the zero-one loss.
Given any probability distribution D over $ X\times \{0,1\} $, we've defined the Bayes classifier $ f_D $ to be-
$$ f_{D}(x)=
\begin{cases}
1 & \text{if }\mathbb{P}[y=1|x]\geq\tfrac{1}{2}\\
0 & \text{otherwise.}
\end{cases} $$
I wish to prove that, for ... |
I'm trying to figure out what this NP-hard problem is most similar to and therefore which solutions are available to me.
There are a fixed number k of bins, each with the same initial capacity c1. There are a number of items of different sizes packed into each of the bins, such that the sum of the sizes of the items in... |
I am pretty new to PDAs and I was solving a problem which asked to design a PDA for the following: $a^n b^{2n}$.
The transitions on the PDAs I've encountered so far have pushed only one symbol onto the stack at any time. Can we push two symbols?
Eg: for every $a$ I encounter I push two symbols. Thus, the transition wi... |
It seems like people have discussed this reduction here:
Is Hidoku NP complete?
But it looks like the solution that was given only tells you if the Hidoku problem has a solution or not (if an hamilton path/cycle exists), what about extracting the solution itself from this reduction?
Can someone see how it is possible?
... |
As
type theory is a principle focus of modern computer science,
its origins are in Bertrand Russel's theory of types,
Principia Mathematica is both the origin of and is expressed in the theory of types, and
relational databases are among the highest value, most researched applications of computer science
it seems Rus... |
UPDATE
In an earlier question of mine asked here : https://math.stackexchange.com/questions/2206095/beginner-level-understanding-concept-on-how-to-derive-probability-of-hash-collis , I got the answer that the number of keys falling into a given bucket. In lay man's term, if I imagine a key to be an image as the data it... |
As a computer science student I consider is essential to completely understand how a Turing machine is defined.
What mathematical knowledge is required in order to understand the formal definition of a Turing Machine, as explained in this Wikipedia link.
|
I'm going through some past exam papers for my course and I'm having trouble completing this one question.
It is as follows: "Draw a strict binary tree with seven nodes that has the same pre-order and post-order traversal sequence".
Is this actually possible? Wouldn't I need to visit the root node before anything else... |
Detecting the regions where a car has been damaged and the extent to which it has been damaged is a very interesting problem. It has potential applications in automatic auto insurance claims. Currently I'm trying to tackle this problem and am looking for papers/ideas for the same.
I am currently modeling the problem as... |
Hi All,
I am solving a question about counter mode encryption in symmetric crypto. I am new to the topic and don't really understand the matter, could you help me a little how to solve the following task?
The formula for counter mode encryption is
Ci = Pi ⊕ E (IV + i, K).
Suppose we instead use the formula
Ci = Pi ⊕... |
I came across the following equality of regular expressions $$(r|s)^* = (r^*.s^*)^*\,,$$ where $r$ and $s$ are two regular expressions and $.$ denotes concatenation, but I don't know how could I prove it.
My try:
I call $L(r)$ the language defined by the regular expression $r$. And I want to use the fact that two regul... |
I'm working on a clustering problem and want to sample partitions (possible clustering solutions) among a set of constrained ones.
Here is the problem: I have a set of objects $O=\{o_1,\ldots,o_n\}$ and would like to sample among reflexive, symmetric and transitive relations $R \in O \times O$ such that samples satisf... |
I'm looking for a data structure that is like a quadtree where each level is a subdivision of the previous. However, unlike a quadtree I need the subdivision to occur a different number of times in the horizontal direction to the vertical direction. In a quadtree the space is subdivided once in each dimension (resultin... |
Suppose that $L$ is a language recognized by a linear-bounded automaton with the constraint that it can only change each of its input cells at most $t$ times each, where $t$ is some constant integer. Must $L$ belong to $P$, the class of languages decidable in polynomial time? Even more stringently, does there exist a d... |
I have a dictionary-like regular expression, an "or chain" of words,
word1|word2|word3|...
Unfortunately, the chain is too large. I'd like to find the minimal regular expression that is equivalent. How can do I do that?
You should think of this as a regex like /^(word1|word2|word3)$/. I have a dictionary of words, ... |
I was reading about max flow theorem and there I saw scenario where the min s-t cut is found. But wherever I searched they did it after knowing the max flow or by guessing the cuts by iterating almost all .
Is there a logical way to arrive at the minimum cut (with the paths) without knowing the maximum flow or guessin... |
In this question I ask about what use is a solver that can find an assignment that satisfies, say, 90% of the clauses of a known satisfiable 3SAT problem in polynomial time. The answer seems to be: given a problem ϕ that may or may not be satisfiable, you perform a reduction on an input formula ϕ to another formula ϕ′... |
Let $n, m \in \mathbb{N}^{+}$. Let $\mathsf{rand}$ be a procedure which returns some random $x \in \{0, 1, \ldots, m - 1\}$ with a flat probability distribution. I have the following procedure:
W := an array of length m full of 0s
for i in 0, 1, ..., n - 1; do
(x, y) := (rand(), rand())
W[y] := max(W[x], W[y]) ... |
I read somewhere that DFS is a special case of Best first search algorithm if f(n)=-depth(n). please justify this i am not getting it.:/
|
In propositional logic (Artificial intelligence to be specific) $\alpha$ entails $\beta$ iff $\alpha\Rightarrow\beta$ is a statement.
However if I write the truth table for implies ($\Rightarrow$) if $\alpha$ is false implies that $\beta$ is a true sentence as shown in the table below in the fourth row.
\begin{array}{c... |
Express the condition "$x = 0$ if and only if $y = 0$" as a set of linear constraints, where $x,y$ are integers such that $ - 5 \le x \le 8$ and $0 \le y \le 1$
|
what is the space and time complexity (lookup, insertion) of count-min sketch and quotient filter?
I could not find these complexities.
I would like to make a program which find the frequencies of objects in a set in the fastest way, so the time complexity is really important for me.
I read the research article about... |
I'm trying to understand the category utility function in the COBWEB algorithm.
Assume you have the following data and build a set C of three clusters (three child-nodes under the root node), one for amphibian (C1), one for fish (C2) and one for bird/mammal (C3).
Using the above CU formula, I'm now trying to compute ... |
Exercise 1.1 (2) from Problem Solving in Automata, Languages, and Complexity by Du and Ko. P.7. the question is as following:
Let A be a langauge over {a,b} and $x \in {a,b}^*$. Find necessary and sufficient conditions in terms of x and A for the equation:
$$A^* - \{x\} = A^+$$
thus, by substation:
$$\{a,b\}^* - \{... |
I have a hard time creating a context-free grammar for the language
$$L=\{(a^n)^*(b^m)^*y\mid y\in\{a,b\}^*,\ |y|=n+m \}\,.$$
Any help breaking down the problem is appreciated, since I'm getting nowhere with this one...
|
I am sorry my English is not very good.
my problem might look simple for everyone here.
I have read about Floyd–Warshall algorithm in wikipedia,every thing was good but when I start reading "Behavior with negative cycles" I face problem in understanding this sentence:
"There is no shortest path between any pair of vert... |
I know the theoretical difference between lock-free and wait-free algorithms, but it's a little hard to me to figure out how do they differ in implementation (code). In particular, i would like to know how would the implementation (code) of a counter be.
Thanks
|
I have come across the claim that all basic data types in System F, such as Bool, Nat, and List(U), can be expressed in the form $\forall \alpha (((T\alpha \rightarrow \alpha) \rightarrow \alpha)$, where $T(\alpha)$ is a definable functorial type constructor.
Can someone explain why this is true or refer me to a proof... |
Is there any closed from expression that can express the number of input pins of a binary tree based on height of the tree and its number of nodes?
In case that the binary tree is a full tree, it is easy to find the number of input pins. In this case we will have $2^{H-1}$ nodes at the last level of the tree ($H$ is th... |
If I am given two languages $A$ and $B$ which are in NP, then we know that there exists a NDTM that can decide $A$ in polynomial time, and there exists another NDTM that can decide $B$ in polynomial time. Can I decide $A$ and $B$ in polynomial time using a NDTM by simply using a NDTM to check for belonging in $A$ then ... |
For example, if a node has 2 edges going into it and two edges coming out of it all with capacity 1, is there a way to make it so that only 1 unit of flow can go through this node (without just deleting edges)?
|
When does strong duality fail in linear programming? I have considered the case when both primal and dual solutions are infeasible, but then there are no optimal solutions at all.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.