instruction stringlengths 35 29.1k |
|---|
On page 77 (section 6.1) of Types and Programming Languages by Benjamin C. Pierce (1st and only edition thus far), there is the following quote regarding naming contexts and de Bruijn indices:
Γ = x ↦ 4, y ↦ 3, z ↦ 2, a ↦ 1, b ↦ 0
Then x (y z) would be represented as 4 (3 2), while λw. y w would be
represented as... |
Can someone please explain me how to solve this?
In this post here was one user sketching the solution but I still don't understand how to construct a context-free language $L$ in such a way that the words in $L$ of the form $ww$ are $a^mb^mc^ma^mb^mc^m(m≥0)$. How does the grammar for L looks like? What equalities have... |
The problem statement is:
Given a search algorithm that finds and returns a k-colored graph for $k \ge 4$ if one exists, and otherwise returns false, show that there exists a search algorithm for 3-coloring.
My idea is to connect each vertex $v \in V$ to another colored vertex(all new vertices are colored in the same... |
Does someone know a proof for Camerinis Algorithm for finding a minimum bottleneck spanning tree?
To my knowledge its the only algorithm that performs in linear time to solve this task but I cant find a correctness prove for that.
https://stackoverflow.com/questions/22875799/how-to-compute-a-minimum-bottleneck-spanning... |
I have a doubt regarding relation between MTTF (Mean Time to Failure) and FIT (Failure in time). Is it FIT = 1/(MTTF1 + MTTF2 + ...) or FIT = 1/MTTF1 + 1/MTTF2 + ... ?
|
Prove That the Language
$L_1 = \{0^i1^j0^k | i < j\ or\ i > k\}$
is not regular using the pumping lemma.
I am not sure how to begin with this I ended up using the string:
$0^p1^{p+1}0^{p+1}$
S = 00001111100000
It holds for the conditions because the first set of 0s is less than the set of 1s, and the last set of zeros ... |
The simplest Reduction for 3-SAT to 1-in-3-SAT reduction is as follows:
For each 3SAT clause: $x+y+z=1$
Introduce 4 new variables $\{a, b, c, d\}$ and replace original clause with below 3 clauses:
$R(x^-, a, b)=1$
$R(y, b, c) =1$
$R(z^-, c, d)=1$
In a similar vein is what is the generic way to convert N-SAT to 1-in-3... |
I have an object mesh. This is loaded into a physics simulator, which does a convex decomposition. Now I want to perform operations outside the simulator that require a mesh representation. I could use the original object mesh but in many cases the convex decomposition is quite rough (the difference between object mesh... |
Say we're back in the 1950s and our clunky computer has a $1$ kilobyte memory. $1$ kilobyte is $1024$ bytes, which is $8192$ bits. When we consider the entire available storage space, there are $2^{8192}$ states we can harness (each bit can be on or off), but in actuality we only utilize $1024$ size-$8$-bit states. In ... |
I've been working on proving that this language
L = {x ∈ {a, b}∗ | na(x) < nb(x) < 2na(x)}
is not Context Free. "na(x)" stands for "number of a's in the string x".
I however can't find a string where all possible divisions of the string can be pumped out of the language. For example, I tried a^(p+1) b^(2p+1), but I ca... |
Let $G$ be a graph and let $v$ be a vertex. Is there a polynomial algorithm for the following operation?
Operation. Find all the induced paths in $G$ with first vertex $v$.
Background
This problem is the confusion I encountered while reading the article Induced paths in graphs without anticomplete cycles. The authors ... |
In the CSES problem Sliding Window Cost, given an array and an integer k, we are asked to compute the minimum cost for each sliding window of fixed size k. The minimum cost is defined as the cost of making all elements equal. Therefore, it can be expressed as the sum of differences between each value and the median (co... |
I'm looking for an efficient algorithm to merge a list of overlapping intervals (each of which has data associated) into non-overlapping intervals. In case two or more intervals overlap, the latter one wins (e.g. the later intervals shadow the earlier ones).
In my case, the intervals actually come pre-sorted (by starti... |
I run the Python code below. x and y differ in their 4th and 5th number, and x has larger values. The program correctly shows that there is a difference between the two sums, and the difference is not that small. I therefore expect that the sum for y is smaller than the sum for 'x'. However, it shows that x has the sam... |
The total number of Turing machines is the cardinality of the set of natural numbers. Now consider the following functions
f1(x) = x + 1
f2(x) = x + 2
f3(x) = x + 3
and so on
Since the total number of these functions is also the same as the cardinality of the set of natural numbers, each of these functions can be ass... |
My understanding why distributed transaction need synchronized clock is the following
Assume NTP max drift is 250ms
true time = 100ms
node A local time = 100ms
node B local time = 0ms
the following transaction will run into conflicted sequence
transactionA arrive nodeA at (true time 100ms, A time 100ms, B time 0ms)
tr... |
I've only recently started learning about deterministic/nondeterministic finite automata and languages and I'd like some clarification on common notation used to describe languages. A 0 or 1 raised to an nth power just means that 0 or 1 occurs n times, correct?
For example: the language $L = \{ 0^n \mid n ≥ 1 \} \cup \... |
Are there existing SAT solver libraries that can count the number of solutions of a boolean formula? Can you give examples?
I mean implementations more efficient than the naive approach, i.e. each time a solution is found, a new clause is added to prevent it to be found again.
|
I am having hard time creating regex for languages where symbols must be in certain length. I hope I am not ignorant about rules. we have to generate regex using $^*,|,+ \text{ and }\cdot$ right?
I am expected to generate a regex for the language $\{ L = \{ w ∈ \{0,1\}^∗ : |w|_0 and |w|_1 \text{ is odd } \}$.
both 0s a... |
The problem:
Given $k>1$ Turing machines decide if for every possible input exactly one of them halts.
Is this variant of halting problem undecidable?
Intuitively, it seems that it must be not only as hard as the standard halting problem, it actually is harder. Because even if you have a refutation input string, you'... |
I've just read the Punycode spec in RFC 3492, as well as descriptions of it across some other articles. Punycode uses a numeral system the authors called "generalized variable-length integers" (is that term well-known in maths in general?) to encode a sequence of integers in a bijective way. My question is about why th... |
I am studying about 2Q Cache Replacement Policy and i came across this post.
They have worked out an example with the following page keys [1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5] and cache memory of 5 pages. A1in size is 2 and A1out size is 3.
For the 10th page (i.e) 3, even though the page is available in A1out, why ... |
can someone help me with this problem? Consider a hashing scheme that uses r hash tables T1, . . . , Tr of size m, where collisions in each table are resolved by chaining. When a key k arrives, it is hashed into each table Ti using hash function hi, and then stored in table Ti having the smallest chain in location hi(k... |
Fagin's Theorem (see Wikipedia and these lecture notes) states that there is an equivalence between second-order logic (SOL) formulas with existential quantifiers, and problems in NP.
I was wondering if we can also extend this result to other complexity classes in the polynomial hierarchy?
For example, can we state tha... |
Assume a variant of a one-tape deterministic Turing Machine that reads and writes on the portion of the tape that the input $w$ appears (like linear bounded automata).
My question is, how we could bound the time complexity for membership in this type of Turing machine?
I think the time complexity could be the worst as ... |
So in an exam, this was the recurrence:
$$ T(n) = 2T(n/2) + n log(n) -n + O(log(n))$$
$$T(1) = 1$$
Why does the master method not apply here? I think it is indeed int he form
$$aT(n/b) + f(n)$$
You can say:
$$a =2$$
$$b = 2$$
$$f(n) = n log(n) - n + O(log(n))$$
My guess: $O(log(n))$ is too broad and cannot work for the... |
The programming language is C++, and the elements of the input vector are of type int and able to take all valid int values. So it’s not possible to store extra information in the input vector. Now, is it possible to sort the vector in linear time and constant extra space? Simple solutions are preferred.
And to avoid r... |
An effectively universal Turing machine $T$ is a Turing machine for which there exists a recursive reduction $f$ such that $\forall A:U(A)=T(f(A))$, where $A, f(A)$ are finite sequences of symbols (that are given as inputs) and $U$ is a universal Turing machine.
Is there any connection between effectively universal Tur... |
I was thinking about quicksort with multiple pivots and I came across this question. How can we efficiently implement a version of Quicksort where we choose $k−1$ pivots to partition an array of unique numbers into $k$ classes? My goal is to demonstrate that this multiary partitioning can be achieved in $O(n \log k)$ t... |
I want to write a regular expression that generates precisely those words over $\Sigma = \{a,b\}$ that contain at most 1 non-overlapping occurrences of the subword bba. It has to accept the empty word and words suchs as $a$ or $bb$ or $aaaaaabbabbbb$.
So far I've tried to place $bba$ in the beginning, middle or end. Bu... |
Let $L_1, L_2$ be regular languages.
You can proof with a product automaton that $L_1\cup L_2$ is also regular.
But you can also construct a NFA. Since $L_1, L_2$ are regular, they also have an NFA representation $M_1, M_2$.
You can create a NFA with a start state $q_0$ with one edge each to the start states of $M_1,M_... |
So, i just got through studying DRAM architecture. I learned that a row address, column address, bank number etc are provided to the DRAM during a read operation. Based on the address provided, 64 bits will be transferred back to the memory controller (assuming the data bus is 64 bits wide). So if we have 8 DRAM chips,... |
Given a set $Z$ of $n$ points $(p_1,p_2,p_3, \ldots,p_n)$. The coordinates of these points are arbitrary numbers and are unsorted. If they give me $s$ and $t$ to be two points in $Z$. A northeast path from $s$ to $t$ in $Z$ is a sequence of points $(s=t_1,t_2,\ldots,t_k=t)$ such that every point for any two points $t_i... |
I am learning about and building a very basic compiler. My question is about code generation. I have read on a lot of materials about code generation when building a compiler and I get the concept.
Suppose I am targeting only a single architecture and OS, for a very basic language, and I have completed all the necessar... |
I have the following recurrence: $F(n, L) = 2F(n / 2, L) + nL + n^2 log(n)$.
Am I correct in saying that $F(n, L) \in O(n \log(n) L + n^2 log(n))$?
I got to this result by bounding the $nL$ and $n^2 \log(n)$ parts separately.
Thank you!
|
I'm a CS undergrad so forgive me if this question isn't formulated well. I got curious about the Busy Beaver function recently, and it got me wondering how all the n-state Turing machines are kept track of.
Is there like a list of all of the machines, along with whether they halt or not? Or is there some other way?
|
So I asked this question already once but didn't formulate it well. I ask it again but this time I want to be clear.
The way how I understood it, the substitution method wants you to come up with a guess function $g(n)$ which has the property $g(n) \in O(f(n))$.
The goal is, to show that your recurrence $T(n) \in O(f(... |
In paper, page 5, 1st paragraph, it is stated that:
Notice that an n-state Busy Beaver, if we had it, would serve as an O(n log n)-bit advice string, “unlocking” the answers to the halting problem for all nO(n) Turing machines with n states or fewer. Furthermore, this is essentially optimal: if we had an advice string... |
I am not a computer science nor a math person, but if given a pseudo-code or a English outline of steps. I can probably fumble my way through and write some code. I Apologize for the wall of text/numbers and my formatting.
Seeking an algorithm that takes a number to start with. This number will be either in column A or... |
If you have a unweighted directed graph with possible cycles, what algorithm would you use to find the longest path without visiting the same node twice? Also, there are multiple starting nodes...
The real problem I am trying to solve is the following:
All values are positive integers:
A1 = [a1, a2, ..., an]
B2 = [b1, ... |
I couldn't understand the following part on admissible heuristic on wiki.
How does it reach that they have to be equal? Admissible heuristic only says the eval needs to be equal/less than the true cost.
If our heuristic is admissible it follows that at this penultimate step Teval = Ttrue because any increase on the tr... |
The Arm documentation for Cortex-A76 (Raspberry Pi 5) says the L2 cache replacement policy is "dynamic biased". But what is it?
More precisely:
How does it works?
Why not using pseudo-LRU, as for L1 cache?
|
Is the following adaptation of the graph bandwidth problem NP hard? If so, which problem could a reduction use?
Given: Graph $G = (V , E ), L:E\to \mathbb N$.
Question: Is there a $f : V \to \mathbb Z$ where for each $e = \{u, v \} \in E$, $|f (u) - f (v )| = L(e)$?
|
There's a standard trick I've heard about in reductions where you just halt a machine and reject after some polynomial amount of time if it hasn't accepted yet. Can this be applied to nondeterministic Turning machines, and if not then why?
For example, suppose we had a nondeterministic Turing machine $M$ for SAT. Given... |
If I have a list of conditions:
and(a,or(b,c))
not(b)
or(a,c)
and(a,d)
or(or(or(a,b),c),d)
and I'm given values for these conditions, let's say, a=true, b=false, c=false, d=true, what is a good algorithm to find the true ones in less than O(log n)? I'm trying to avoid testing all conditions.
A good context for this pr... |
Consider
$$L=\{<TM>:TM \text{ is a Turing machine and has minimal states}\}$$
$$L'=\{<PDA>:PDA\text{ is a PDA and has minimal states}\}$$
Which one is recursive?
I think neither $L$ nor $L'$ are recursive but I can't reduce from a famous problem.
|
I'm trying to prove that an inefficient double-lengthening PRG exists, i.e. construct a PRG $G: \{0,1\}^n \rightarrow \{0,1\}^{2n}$
My current approach is to bound the number of poly-time non-uniform algorithms as the number of boolean circuits, which is $2^{n^2}$, then we can say there $2^{n^2}$ functions, we will cal... |
My teacher explained the function of a one-class SVM to us.
However, the sketch used is not correct from my point of view. I understand the function of a one-class SVM as follows:
The SVM is trained with normal data. It finds a blue circle (in 2 dim) where most of the training data lies. However, some of the training ... |
If the hash is calculated as h(k, i) = (h1(k) + i*h2(k)) mod |T|
What would happen if h1(k) or h2(k) is constant? Would that produce primary or secondary clustering? I think both would produce secondary clustering and I don't see how it would cause primary clustering because I feel the i multiplying h2(k) prevents the ... |
I have a simple question which I cannot answer, and it relates to this question.
What I cannot answer is this:
Why does a graph with bidirectional edges destroy the "bipartiteness" of the graph?
Depending on the answer to question 1, why wouldn't Hopcroft-Karp work on bidirectional graphs?
Specifically, for question ... |
Suppose there is an algorithm $\mathcal{A}$ for the problem $\Pi$ that halts on any instance $x\in\Pi$. Someone tells me that we can run $\mathcal{A}$ on Linear Bounded Automata, but I can't understand why.
My background in Theory of Computation says that the problem $\Pi$ could be a decidable language and maybe can't ... |
If given two sets of integers how can I find an integer in the first set furthest away from all members of the second set. The distance of two integers is the absolute value of difference of the two integers.
To clarify the question: if $a_i$ and $b_j$ are elements of the first and the second sets, I am trying to find ... |
Here, I read this:
For all CFL, there is a one-state PDA that recognizes this language.
What is the proof/idea behind this claim?
CFL: Context Free Languages
PDA: Push Down Automaton
|
An Alternative view of I/O programs, popular in earlier lazy functional programming languages, was to see the input and output as Strings, that is as lists of characters. Under that model an I/O program is a function
listIOprog :: Str->Str
This obviously makes sense in a 'batch' program, where al, the input is read be... |
The paper mentions a line about GPT-3's training dataset -
Motivated by the ability of GPT-3 (Brown et al., 2020) to generate plausible code completions despite its training data not containing any explicitly gathered code datasets
My question - I need clarification on the following:
If it was not trained on any "expl... |
I am trying to learn Scikit_Learn and build an ML model. I am learning from "Hands-On Machine Learning with SciKit-Learn, Keras & TensorFlow".
In Chapter 2, there is a review of an entire ML project from the beginning until completion. One of the steps is to transform or prepare the data for the model. There are numero... |
Let $T$ be a finitely branching tree. I will call a subtree of $T$ a "tassel" if it is of width one, closed downward, and is maximal subject to this criterion. Equivalently, a tassel is a sequence of nodes $A_1,\dots, A_n$ such that $A_i$ is the parent of $A_{i+1}$, $A_n$ has no child, and $A_1$ either has no parent or... |
I am interested in the following algorithmic problem:
Given a strongly connected directed graph $G$, I want a "short" (see below for what I mean by short) walk that starts with an arbitrary vertex $s$ and contains all vertices of $G$.
Deciding if such a walk can be a path (i.e. no repeated vertices) is a well known NP-... |
I'm working on constructing deterministic finite automata (DFAs) with a specific learning complexity when using the L* algorithm developed by Dana Angluin. My goal is to create a DFA of size ( n ) that necessitates ( n-1 ) equivalence queries for the L* algorithm to correctly learn the automaton.
The L* algorithm opera... |
I know that NP is a subset of EXP, but I cannot find any resources talking about whether NP = EXP or not.
My intuition tells me that any problem that requires exponential time to be solved with a DTM can be solved in polynomial time with some NDTM. Is that not the case? If so could someone provide me a problem that def... |
Say you have a double ended priority queue in the form of a minmax heap as described here.
What is the most efficient algorithm to update the priority of an existing item?
Assume that
I explicitly want to avoid deleting and re-inserting the item
The index of the existing item (pre-update) in the heap is known (so no l... |
Recently AI (alphazero) was used to improve practical matrix multiplications by around 10 to 20 percent. Alphageometry and ramanujan machines all came into existence in the recent years as well. Seems like it might time AI gets used to further improve algorithms for pi like this one? If so, is there a sketch of a solut... |
You have $n$ events on your calendar, defined as intervals with a start time $s_i$ and a finish time $f_i$.
The events might overlap, and you want to attend all the events, so you are going to create $k$ clones
of yourself to achieve this. You want to minimize the number of clones you need, $k$. A clone can attend a cer... |
The following question was asked by our professor in exam:-
Given a system with 4GB virtual address space and page size 4KB and total physical RAM of size 8KB. What will be the size of the page Table if each entry consumes 4 Bytes. Also the system allows upto 1024 processes to run concurrently.
The answer is:-
For each... |
In Skiena's book Algorithm Design Manual, 3rd Edition, it is claimed on page 45 that
$$
mn - m^2 + m \in \Omega(mn)
$$
where $m,n \geq 0$ and $m \leq n$. I claim that this is in fact false, with the following proof. Toward a contradiction, suppose otherwise. Then $$mn-m^2 + m \geq cmn$$ where $m,n > N_{0}$ for some suf... |
The thing that confuses me here is that i've seen a similar example where $L=\{a^nb^m : 2m\leq n\leq 4m\}$
where the CFG was straight forward:
$$
S\rightarrow aSbb\\
S\rightarrow aSbbb\\S\rightarrow aSbbbb\\S\rightarrow \epsilon
$$
however, in this example I cant get my mind out of the "just go for the simple approach"... |
Let $T$ be a rooted, finitely branching tree, with values from $A$ in its nodes; $T(j)$ is the value of a node called $j$. $A$ is a commutative monoid. The "bottom-up scan tree" of $T$ is a rooted tree $T^\ast$ isomorphic to $T$, such that if $j$ is a leaf of $T$, $T(j)=T^\ast(j)$, and otherwise $T^\ast(j) = \sum_{i\le... |
public class SortAlgorithm {
public static void sort(int[] A) {
quickLevel(A, 0, A.length - 1);
}
private static void mergeLevel(int[] A, int l, int r) {
if (l < r) {
int m = (l + r) / 2;
quickLevel(A, l, m);
quickLevel(A, m + 1, r);
merge(A, l, m, r);
}
}
private static vo... |
I was just reading this question regarding the difference between environment and memory. However, the textbook in question, Essentials of Programming Languages, third edition, by Friedman and Wand, also has chapter 4 State, which, as it says, discussed the concept of state. But, as far as I can tell, it doesn't seem t... |
I'm trying to use reduction $\overline{HP} \leq L$, but I just can't think of a way to do so.
Any help would be appreciated!
|
(This may just be a terminology clarification question.)
Wikipedia says
A language usually has at least one implementation in the form of a compiler or interpreter, allowing programs written in the language to be executed.
And reading the page on programming language implementations:
In computer programming, a progr... |
I am trying to understand various types of virtualization techniques. The concept of Hardware virtualization/Virtual machine was simple enough.
However, I am struggling to understand the concept of storage virtualization. One definition I have found
grouping the physical storage from multiple network storage devices s... |
A Turing Machine can be converted into a Turing Machine that has a specific input coded into it's description. This Turing Machine can then be run on empty input. Can we do the same for PDAs or DFAs?
I am familiar with models of computation such as Conway's Game of Life where the rules are fixed and the entire computat... |
The problem
Trying to improve my algorithms I bumped into a problem by Pedro Pablo Gómez Martín and Marco Antonio Gómez Martín, which I can summarise like this:
You are given a list of enemy bases you want to conquer. You can only attack one base at a time. Each base $i$
requires a minimum number of soldiers $s_i$ to ... |
Just a quick question about regular languages and which NFAs accept them: If I were to draw an NFA that accepts a particular regular language, does that mean the NFA can only accept strings in that language or can the NFA accept every string in that language and some extra ones?
For example, for the regular language a+... |
Is the knapsack problem for a target weight, let's say 1000 for example, and a target price, let's say 10000, still an NPC problem?
|
let's say that I have a Python script that performs various operations, including data manipulation, conditional logic, and iteration. However, I'm concerned about its time and space complexity efficiency. Would it be possible to use logic gates to optimize code by simplifying and reducing redundant logic using techniq... |
$L=\{(ab)^n : n\text{ is a natural number apart from }6\}$, I want to show L is non-regular by finding an infinite set of L-distinguishable words. Could you help me?
|
I have to create an NFA $\mathcal{A}$ that accepts the language $L = \{w \in \Sigma^* \ | \ |w|_a \ \text{is divisible by 2 or} \ |w|_b \ \text{is divisible by 3} \}$
So the NFA only accepts words with $|w|_a \ mod \ 2 = 0$ or $|w|_b \ mod \ 3 = 0$.
This is the NFA that I constructed but it is not enough. What is the ... |
This is a homework question and after struggling with it for a while, I have decided to ask for help here.
The task is to construct a language over the alphabet $\{0,1\}$ consisting of precisely those words $w$ with the property that $\#_0(w)$ is an odd number, i.e. the count of 0's in those words is odd (eg. $010,1001... |
Input: A finite set A, subsets S1, . . . , Sn ⊆ A, and a number k ∈ N.
Question: Does there exist a set R ⊆ A with |R| = k such that |R ∩ Si| = |Si| for all 1 ≤ i ≤ n?
I read somewhere (without mentioning why) that it's an NP-complete problem, but I think it can be solved simply by taking the union of all subsets and c... |
I've seen a definition of NP alluded to in different texts where at each step an NDTM makes a nondeterministic choice between two transition functions and behaves accordingly. It seems like even in a binary alphabet the machine has more than two possible behaviors.
Can anyone formalize this and help me understand why t... |
In a fully connected Neural Network, each perceptron has it's bias term $b$ which is learnt. Often (example, in Linear/ Logistic Regression), when we don't want to treat this bias term explicitly, we add an extra "constant" feature $x_0 = 1$ to each training example. Can we show whether this will/ will not work in a Ne... |
I was the book "Introduction to Computation and Programming Using Python" and I stumbled upon the concept of representation invariant. What I understood is that the variables (and maybe methods) created inside a class shouldn't be able to be accessed by code outside of the class. Is this definition right? Or I'm comple... |
I have read a Luby’s paper and understand basic idea of the LT codes, but I want to figure out the analysis when encoding symbols can choose their neighbors with replacement during the encoding process. I have tried some key points like, Repetitive, with replacement... on IEEE.I can not find related paper.
Do you have ... |
How functional programming using lambda calculus is analogous to construction of Turing machine as per computational aspects?
|
In a web application, I use a map as a simple in-memory cache/lookup.
A key is a string, say A and maps to an integer value, say 50.
The app handles thousands of requests per minute. Requests need to look up keys.
If the key isn't found in the map, then the value is computed and stored under they key as map[A]=50
Nex... |
In a CP-algorithms wiki Second Best Minimum Spanning Tree - Using Kruskal and Lowest Common Ancestor:
Let $T$ be the Minimum Spanning Tree of a graph $G$ . It can be observed, that the second best Minimum Spanning Tree differs from $T$ by one edge replacement. (For a proof of this statement refer to CLRS (3rd ed.)... |
Suppose I have an array of 2D coordinates {x:number,y:number}[]. What would be an algorithm that could get me the points that, were an X by Y grid of rectangles laid over the cartesian graph created by the array, are closest to the middle of each rectangle that contains points?
Here's a very roughly drawn example:
22 ... |
In the essay Relating Theories of the lambda-calculus, Scott constructs (from page 418) a category that exhibits a chosen lambda calculus $ L $ with $ \beta $-equality as the collection(s) of morphisms $ E(U)_n = U^n \to U $.
Now, the construction is fairly straightforward. Also, we have a bijection of the terms withou... |
I recently started learning about the chomsky hierarchy and I am preparing myself for an upcoming exam. Often there are tasks to specify the smallest classification of a given formal language. How does one safely find the smallest class the language is included in? Which criterias should one look for when doing so?
$\... |
We are given a file of three columns
the first is player name
the second is game item name
the third is the price of the game item while it bought by the player
items may repeat ror the dame player with different prices
what is the best parallel approach in time and space to get the player name with the highest sum of... |
I remember that the Roc Lang website claimed that their choice to forbid any form of cyclic data structures prohibited their customer to implement some of the best in their class algorithms, id est some algorithms that are better than everything else solving the problem that they are designed to solve.
I have tried in ... |
I've been given a task to determine whether L={〈M〉|M is a TM that loops on the input c (a constant)} is decidable. I can prove co-L is recognizable so I figured a reduction from HALT to co-L would finish my proof that L isn't even recognizable. Now I'm stuck. I just can't seem to master creating mapping reductions.
I k... |
How to prove that every clause that is implied by the input formula (learned or not) can be derived using resolution with weakening rule:
$\frac{C}
{C \vee D}$
(A clause $C$ is implied by $F$ if for all possible assignments $A$ it holds that $F[A]\implies C[A]$.)
|
I need to design a binary DFA to accept strings where the last three characters read are either "000", "110", "101" or "011". My brutal solution is:
I need help either reducing this one or with a simpler solution. Thanks
|
Suppose we have collection of n sets $S_1, S_2, \dots, S_n$. Each set has a size of at least $k$. We know for sure that $\exists k$ sets where all of them contain the same $k$ elements; $|S_1 \cap S_2 \cap,\dots,\cap S_k| \geq k$. We don't know the sets nor the intersection elements. I would like to know if these quest... |
I am trying to recreate the code for a paper. The paper describes a noising scheme like the following. $z = f(x) +S(x) \cdot \epsilon$
Where $\epsilon$ is the noise we call echo noise. It is because in the limiting case, the distribution of $z$ and $\epsilon$ should be same. That is if we have a dataset $\{x_0, x_1, \... |
Take numbers from 1 to 100. Put all of them in a binary search tree. Now, one of those 100 numbers is picked uniformly at random and given to us. We'd like to find it in the binary search tree. The tree should be constructed in a way that the expected number of comparisons in minimal. It's intuitive that a balanced tre... |
I had a few functions that were written in C which I had to rewrite in assembly for aarch64. How do I go about setting unit tests for the functions. And what environment would I require to do the same. I have a rasberry pi and linux pc with me, would I be able to compile and run the aarch code on them
#include "c_funct... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.