instruction stringlengths 35 29.1k |
|---|
Is it necessary that two isomorphic graphs must have the same diameter? As far as I know, their adjacency matrix must be retained, and if they have the same adjacency matrix representation, does that imply that they should also have the same diameter?
|
Suppose we have mysterious machine which return median $m$ of given set $S$ and set $S/\{m\}$ in constant time, where $S/\{m\}$ denotes the difference of $S$ and element $m$. Prove that we can sort any list of $n$ elements in linear time using such machine. (extra space is allowed)
Here is my idea, which works intuitiv... |
I was reading "Introduction to Algorithms" by CLRS and it says that:
We write $f(n) = O(g(n))$ to indicate that a function $f(n)$ is a member of of the set $O(g(n))$. Note that $f(n) = \Theta(g(n))$ implies $f(n)=O(g(n))$, since $\Theta$-notation is a stronger notion than $O$ notation. Written set-theoretically, we ha... |
I have two sets of lat/long points, $A$ and $B$. For each point $a$ in $A$, I want to find the corresponding closest point (by Haversine distance) $b$ in $B$. I'd like to use a space-partitioning tree, but as far as I can tell, quadtrees and k-d trees are confined to working in Euclidean space. How can I efficiently do... |
Suppose I have a 4x4 Karnaugh map with a few cells that are don't cares, and there are two ways of producing 3 groups of 4 cells. One of these ways overlaps groupings more that the other. Is one way preferable over the other?
For example:
Is F = B'D' + AD' + CD' simpler than F = B'D' + AD' + A'C (since the first one r... |
If I have two decidable languages $A$ and $B$, is $A \leq_m B$ true? How would I show this?
|
I'm learning about Turing Machines, decidability, and recognizability, and read that if a language is recognizable, its complement is sometimes recognizable. I don't really understand how this could be, can someone give me an example where a language has a recognizable complement and an unrecognizable complement? Thank... |
If there's one thing the pandemic has shown us its that High school Geometry did not save us. I am a high school math teacher and I understand my job and its usefulness only exist in a post scarcity economy. That being said, my Principal is making me teach computer science as an elective, a subject I never studied in c... |
Consider an array $a[1\ldots n]$ and another array $l = a[0]$ (initial value). At each turn we may add next element to array $l$, or remove first element from array $l$. F.e. after first iteration it could be empty or could become $a[0, 1]$. We want to find k-th smallest element at each iteration in array $l$.
First of... |
In Rust programming language one can write a compiler extension function that works on abstract syntax tree, effectively modifying source code before it gets converted into machine instructions.
In other words, macro function has signature
Abstract Syntax Tree -> Abstract Syntax Tree
Can these be thought of as highe... |
I'm new to the concept of computational complexity and trying to understand the topic in depth. I went through some references mentioned by some old questions, however, I had this question and not sure if my understanding is correct.
I want to know the complexity of generating a uniform random vector, over $[0, 1]$, of... |
The algorithm needs to generate all possible combinations from a given list (empty set excluded).
list => [1, 2, 3]
combinations => [{1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}]
This algorithm would take O(2n) time complexity to generate all combinations. However, I'm not sure if an improved ... |
I'm trying to understand a proof from the book "Graph Theory with Application to Engineering & Computer Science" by Narsingh Deo.
The chapter is about trees in non oriented graphs.
A bit of terminology so that you can understand the theorem and the beginning of the proof from the book:
The author calls minimum spanning... |
How do I prove the correctness of this algorithm?
|
I am looking to find the recurrence relation of the following function:
int fnA(int[] array, int low, int high) {
if (low >= high)
return array[low];
else {
int gap = floor((high - low) / 5);
return (fnA(array, low, low + 2 * gap) +
fnA(array, low + gap, low + 3 * gap) +
fnA(arra... |
It is claimed in many sources (for example, here) that adding a rule like "if Id(X,Y) then X really equals Y" to a type theory is "problematic" because then its type-checking becomes undecidable. I have read Martin Hoffman's proof ("Extensional concepts in intensional type theory", Section 3.2.2), as well as this SE qu... |
I have been doing some research and have found a lot of papers on the subject of random deployment in wireless sensor networks, but I haven't found a single example of its usage. Has it been used before? What could be a very concrete context in which it could be used?
Thanks in advance.
|
I found an article on Catalytic space which describes how additional memory (which must be returned to it's arbitrary, initial state) can be useful for computation. There's also an expository follow up with some more details.
In particular, they describe a scheme for iterated matrix multiplication (for the purposes of ... |
Suppose I have an array A of size n, with the initial state of:
A[0] == 1, A[1] = 2, ... A[n-1] = n
I know that one way to get a uniformly-distributed permutation of that array is to use Fisher-Yates Algorithm, but I am more interested in what's flawed with the following naive approach:
for i = 0 to n-1:
rand_i = r... |
It would appear straightforward to show that a regular language is closed given the transposition of the rightmost character to the front. However after drawing a few sample DFA for the phenomenon, I've been unable to come up with a generalized 'concept' or 'proof' that shows it's true for all regular languages. Could... |
What's the best asymptotic complexity of finding every cycle in a simple, directed graph?
I haven't been able to find anything regarding this online. I'm able to use DFS for cycle detection, but I'm looking to determine the weight of each cycle in a graph, thus I'd like to be able to determine them all.
|
My inquiry concerns the length of chromosomes employed in genetic algorithms (GA), and more broadly in other classes of evolutionary algorithms.
The chromosome length is fixed throughout a GA's run. However, some work has explored the benefits of altering a related GA parameter: the size of the GA population, which is ... |
Can someone please explain why this is correct:
function productSum(array,depth=1) {
let sum=0;
for(let i=0;i<array.length;i++){
if(Array.isArray(array[i])){
sum+= productSum(array[i],depth+1)
}else{
sum+= array[i];
... |
I recently encountered this kind of problem in a real world setting, and could not for the sake of me find any literature relating to the problem statement I came up with. An example will be included below.
Simple Statement of the Problem
Suppose you have values and weights for items, such that groups of $2$ and $3$ of... |
In most computer science cirriculums, students only get to see algorithms that run in very lower time complexities. For example these generally are
Constant time $\mathcal{O}(1)$: Ex sum of first $n$ numbers
Logarithmic time $\mathcal{O}(\log n)$: Ex binary searching a sorted list
Linear time $\mathcal{O}(n)$: Ex Sear... |
I know that $O(\max(m, n)) = O(m + n)$, but is there a similar simplification for $O(\min(m, n))$? It could be $O(n) \cap O(m)$ but it does not simplify the notation that much…
|
From Wikipedia,
On Linux systems, vmlinux is a statically linked executable file that contains the Linux kernel
Does that mean vmlinux is a virtual machine that runs Linux? I am really confused.
|
Could a large quantity of coded information (let's say 10,000 GB) be copied from one storage device to another without first being decoded? If so, how long would something like that take?
|
Consider the following two problems:
A. Given a directed graph and a parameter $k$, determine if it contains a path (not necessarily simple) of length $k$.
B. Given a directed graph, two vertices $s,t$ and a parameter $k$, determine if the graph contains a path from $s$ to $t$ (not necessarily simple) of length $k$.
Ho... |
I am trying find the regular expression that describes the finite automata in the image below.
Given the following finite automata
which of the following regular expressions describes the same language as the automaton.
(ab)+c*d+
a+b+c*d+
a(ba)*bc*dd*
[ab]+c*d+
a(ba)*bc+d?d+
(ab)+c+d*
I tried converting it to a regu... |
Let's say we have a set of vertices $V$, and two (undirected) graphs over the same set $V$, but not necessarily the same set of edges $G_1 = (V, E_1)$, $G_2 = (V, E_2)$. $\newcommand\mG{\mathbb G}$(Let's denote the set of all graphs over the vertices $V$ with $\mG$, so $G_1, G_2 \in \mG$).
Now I'd like to measure how ... |
Let
$$A \cdot X + B \preceq 0$$ be a system of linear inequalities with $X \in \mathbb{R}^n$ $A\in \mathbb{R}^{m\times n}$ and $B \in \mathbb{R}^m$ where $m \geq n$. According to Farkas lemma, exactly one of the following two is true:
$\exists X \in \mathbb{R}^n$ such that $A\cdot X + B \preceq 0$
$\exists y \in \math... |
From Wikipedia:
A 32-bit register can store 2^32 different values. The range of integer values that can be stored in 32 bits depends on the integer representation used. With the two most common representations, the range is 0 through 4,294,967,295 (2^32 − 1) for representation as an (unsigned) binary number, and −2,14... |
Is algorithm which schedules tasks to machine and then for every time point in the makespan of machine does an operation considered pseudo-polynomial or quasi-polynomial? (if machine execute tasks from time 0 to 100 then it goes over every time point 0,1,2...100 separately and executes O(1) action) I would guess pseudo... |
Given a regular Expression: 0^a 1^b 0^c, where a+b=c and a,b,c >= 0.
Find the cfg for this expression.
Here is what I tried to do:
s -> AsB
A -> 01
B -> 0
But then a language could be 010100 which does is not apart of the expression.
I tried other ways but then I was not able to fulfill the a+b=c rule.
e = epsilo... |
In Turing's 1936 paper On Computable Numbers Page 30-31, and its Correction Page 1-2 :
For a Turing Machine $M$, $Inst(q_i S_j S_k L q_l ) $ means that if $M$ scans symbol $S_j $ under $m-configuration$ $q_i$, then the symbol on the square under scanner (with symbol $S_j $ ) is to be replaced by symbol $S_k$, and ... |
I'm 29 years old. I couldn't continue my studies after grade 10 due to some financial issues and I didn't have time to practice mathematics. It's been more than 11 years since I left studies. Now I want to continue in the field of programming. I have grasped the knowledge of basic programing concepts like variables, da... |
Let $\text{ALL-CFG} = \{\left<G\right> \mid G\text{ is a CFG and } L(G) = \Sigma^*\}$.
I have understood the proof of ALL-CFG is undecidable, but I wonder why the following proof is not appropriate.
Let $C$ be a CFG. Then $\bar{C}$ is a CFG by closure under complement. Since the emptiness of CFG is decidable, we can us... |
It can be shown that Turing machines, μ-recursive functions and reasonable programming languages can compute/decide the same problems. I wonder why we then still proof the halting problem with Turing machines.
Isn't it much easier to argue that the function halts below cannot exist in e.g. python since then I would be ... |
On a directed acyclic graph $G=(V,E)$ the Minimum Path Cover (MPC) is the minimum number of paths that can be constructed on the DAG such that all vertices are covered by at least one path.
If one was attempting to create examples of DAGs with small MPCs (i.e. use a program to create examples of DAGs with small MPCs), ... |
Downey and Hirschfeldt seem to assume that any computably enumerable set of sequences can be generated from some prefix-free set (in the sense that the set of all extensions of the strings in the prefix-free set is equal to the first set). I don't understand why this would be so.
Specifically, in a proof that a sequen... |
Are line graphs of powers of cycles again a power of cycle? I think yes, this is because the line graphs of cycles are cycles of the same order, and moreover, since powers of cycles consist of edge disjoint cycles which are packed within a distance given by the value of the power, their line graphs also must be powers ... |
Can we prove the following, or find a counterexample?
$$f(n) = O(g(n)) \Longrightarrow f(h(n)) = O(g(h(n)))$$
I should figure out whether $\log(n^{\log n}) = O(a^{\log n})$, and this will be facilitated if the above holds.
|
I am trying to understand the Bellman-Ford algorithm from Jon Kleinberg, Éva Tardos: *[Algorithm Design].
Page no: 296 The recursive equation that is written:
$$M[v]= \min(M[v], \min_{w\in V}
(c_{vw} + M[w]).$$
I am not getting how this equation is correct?
Because in the book it is written that $M[v]$ is the shortest ... |
I came across the statement "data is inactive but information is active" while reading differences between data and information. What is meant by this statement?
|
I am working on a Fraudulent Cash Transaction Detection System using DBSCAN and I want to know what is the proper way to identify outliers?
Thank you
##Edite##
I had a problem how to represent the outer points extracted by the DBSCAN algorithm in Python visualization techniques, and found the solution here:
https://www... |
An edge-labelled directed graph is the data of $G = (V, E, l)$ where $(V, E)$ is a directed graph, and $l \colon E \to \mathbb{P}$ is some function. (For the graph I am considering, labels take values in $\mathbb{P} = \{1, 2, 3, \ldots\}$). To any path $v_0 \to v_1 \to \ldots \to v_n$ in $G$, we can associate a type $\... |
What is 4365 − 3412 when these values represent signed 12-bit
octal numbers stored in sign-magnitude format? The result should be written in
octal. Show your work.
Octal to binary:
4365: 100 011 110 101
3412: 011 100 001 010
By recognising the role of the sign bit, we can
represent positive and negative 64-bit numb... |
Hello computer scientists,
I am a mathematician. I have taken some undergraduate courses in C++, Python, assembly language, boolean algebra, logic, graph theory, etc. I would like to learn more about computer science because I think it's cool. Could you give me some advice as to where to start? Thanks!
|
I am reading the book "Principle of Program Analysis" by Flemming Nielson for annotated type systems. In the first chapter, section 1.6 they mentioned the simple type system for various statements(S). And S maps a state to a state, and may therefore to have type Σ --> Σ where Σ denotes the type of state. So they mentio... |
I have a random distribution on sets in mind, that has three parameters: $n, w, k$. The goal is to sample sets of $k$ integers from $[0, n)$ (without replacement) such that the elements within each set fit in a subrange of length $w$. That is, an outcome set $S$ must have properties:
$S \subset \mathbb{N_0} \; \wedge\... |
I'm having difficulty understanding the proof of the Kleene-Post result. It purports to construct two languages that are not Turing reducible to each other, using a diagonalization argument.
I've seen it in many places: for example a very brief summary here (where it is used to answer a different question about mapping... |
I think I understand Reservoir Sampling. If you have a large stream of integers then it allows you to get a sample of size k from that stream without putting it all in memory.
My question is what if you know beforehand the length of the stream? Say the length of the stream is n. In this case I would assume that a mu... |
I am working on the following problem:
Prove that, for all $k\in\mathbb N$, there exists $n\in\mathbb N$ so that every binary string $x\in\{0,1\}^{kn}$ with Kolmogorov complexity $K(x)$ at least $kn$ satisfies the following property:
By interpreting $x$ as $x_1\cdots x_n$, with $|x_i|=k$, for any $z\in\{0,1\}^k$ there... |
I was looking for the limitations of a CFG. I think there is some limitation given there are only finitely many states of a PDA (or non-terminals in a CFG).
I suspect that languages like $\text{L} = \{10,10100,101001000, \dots\}$ can not be generated by a CFG. I can not see that intuitively (heuristics will help me). I... |
This page on Wiki states that $\{a^nb^nc^nd^n \ | \ n > 0\}$ can not be generated by a CFG. This does not make sense to me as $\{$S $\to$ ABCD, A $\to$ aA | a, B $\to$ bB | b, C $\to$ cC | c, D $\to$ Dd | d$\}$ seems to be the desired CFG. By the Pumping lemma for CFG, I understand that it is not context-free but that ... |
Best to start with an example. I want to design fictional fruits. The fruits have three attributes: color, taste and smell. There are $c$ possible colors, $t$ possible tastes and $s$ possible smells. Further, there is a feasibility matrix between colors and tastes and also one between tastes and smells. Hence, this can... |
Show there exists a monotone function $f\colon \{0,1\}^n \mapsto \{0,1\}$, such
that the minimal size of a monotone circuit that computes $f$ is
$\Omega(2^n / n^2)$. Use the fact that the number of monotone
functions is at least $2^{\frac{2^n}{2 \sqrt{n}}}$.
Every monotone $f\colon \{0,1\}^n \to \{0,1\}$ has a minima... |
I am using this standard question from Dragonbook as an example, (the first problem) . I have trouble with what happens in State 4 on LR(1) parsing. Once it is reduced by the rule C->d, now what will the current state be? It seems like it could be both State 0 or State 3 (since state 3 loops back on itself on the looka... |
I'm given the following python function:
def recurser(i, j):
x = 0
if j == 0:
return 1
if i == 0:
return 1
x += recurser(i, j - 1)
x += recurser(i - 1, j)
x += 1
return x
And I'm Asked to find x for any i = j = n where n can be any positive integer. however the recursion can... |
Let's say we have a problem $A \in \mathsf{NP}$. Now let's say we have a reduction $f(\mathsf{SAT}): A \leq \mathsf {SAT}$.
So, assuming that $A$ is not $\mathsf{NP}$-complete we have that $f(\mathsf{SAT})$ is $\mathsf{FNP}$-hard:
$\mathsf{\exists C: \{A \in C \subseteq FNP},\ f(\mathsf{SAT}) \in \mathsf C\}$.
$\mat... |
Suppose we have a circulation problem (with only one commodity), where all lower bounds, upper bounds, and costs are integers. Are we guaranteed that if there is a solution, then there is an integral solution? Is there an algorithm that can find one in polynomial time?
For standard network flow, we know that there is... |
I was thinking about a data structure to make concatenation of lists easier, something that contains multiple lists (in a sequence) internally, but can be treated as a single contiguous list. I know such a data structure must exist out there already, and I would like to find articles about its performance, but I don't ... |
There is a huge field of study dedicated to automated theorem proving. Is there any similar research dedicated to automated algorithm design? And is there any form of "duality" between these two processes (automated theorem proving vs automated algorithm design)?
|
Let say A = 1 and B = 1
and then A+B = 1
now by using duality(replacing or gate by and gate and 1 by 0) we can say that, A.B = 0
but this is not 0, because 1.1 = 1, so please anyone clear my misunderstanding here, Thank in advance
|
This is about the halting problem. My questions are: where do you think are logical flaws in what I am going to write? How do you think this does not invalidate the proof for the undecidability of the halting problem? I want to state clearly I am aware the following argument surely contains errors and is not valid, I w... |
I am kinda blocked trying to figure out the answer to this question. Mind helping?
A manufacture wishes to design a hard disk with a capacity of 60 GB or more (using the standard definition of 1GB = 230 bytes). If the technology used to manufacture the disks allows 512-bytes sectors, 1024 sector/track, and 60% tracks/ ... |
I have a set of items (A, B, C, D, ...) which I want to assign to one of two sets (set1, set2). Trying all possible assignments and selecting my favorite has complexity $O(2^n)$, so I am trying to prune the number of assignments evaluated. I want to do this based on available knowledge that certain pairs MUST be presen... |
Consider the following language:
$$L=\{w \in \textstyle\Sigma_1 ^*\mid|w| \text{ is even and 1's can only occur in the second half of $w$}\},$$
where $\Sigma_1 = \{0,1\}$.
I need to show that this is not regular. I tried to prove this with the pumping lemma.
Imagine that there exists a pumping length $d$, and consider ... |
So I just started learning greedy algorithms and I have a problem that I want to solve. The statement is as follows:
In your calendar you have an $L$ list of all the tasks you need to complete today. For each task $i \in L$ the duration $d_i \in \mathbb{N}$ is specified which indicates the time required to complete it... |
Prove that the number of circuits with bounded fan-in (of 2) of size $s$ is at most $s^{O(s)}$.
Give the best explicit bound you can get.
I know that for a circuit of size $s$ in order to generate a string to represent it I need for every edge, which I have at most $s$ of those, to represent from which vertex it star... |
Say you generated a language by looking at the output of a lexicographic enumerator and flipping a coin for each string, adding it to the language on heads. What would be the chance of this language being Turing-recognizable?
|
I haven't been able to find whether this problem has been studied: we are given a graph $G$ and an ordered list of $k$ colors $L = [\ell_1, \cdots, \ell_k]$. Additionally, we are given a positive integer $s \le k-1$.
The decision question is whether $G$ can be properly colored such that every pair of adjacent vertices ... |
I've recently come across the topic of homotopy type theory and I'm interested to learn more. I have a very limited background in type theory.
Can anyone tell me, in functional programming terms or through practical examples, how exactly is HoTT going to change the way we view mathematics, and what are the implications... |
Why the method of communication used in DS is message passing and not shared memory ?
|
So, a common reasoning to use dynamic programming as the website (https://www.tutorialspoint.com/data_structures_algorithms/dynamic_programming.htm) mentions is that, we use dynamic programming when:
Dynamic programming approach is similar to divide and conquer in breaking down the problem into smaller and yet smaller ... |
So my recursive equation is T(n) = 2T(n/2) + log n
I used the master theorem and I find that a = 2, b =2 and d = 1.
which is case 2. So the solution should be O(n^1 log n) which is O(n log n)
I looked online and some found it O(n). I'm confused
Can anyone tell me how it's not O(n log n) ?
|
I'm trying to solve the recurrence
$T(n)= 2T(n-\log f(n))+ f(n)$, where $f(n) = 2^{\sqrt{2n}}$,
using the master theorem. Which case applies here?
|
I am reading CLRS and have uncertainty in asymptotic running time of algorithms. In CLRS, it is said,
The notations we use to describe the asymptotic running time of an algorithm are defined in terms of functions whose domains are the set of natural numbers $N = \{0,1,2,...\}.$ such notations are convenient for descri... |
Consider median of median algorithm. If I make to group of size $7$ instead of $5$ then the recurrence equation will be
$$T(n)=T(n/7)+T(5/7\cdot n+4)+O(n),$$
which can be proven by induction equal to $O(n)$.
Assume it takes around $14$ steps to sort group of $7$ elements. How do I find exact runtime if I want to find $... |
If there is no global clock in Distributed systems , then what is the solution for synchronization in DS ? Also , no global clock in DS is a direct consequence of the fact that the only communication is by sending messages through a network. Can someone please explain how the communication via message passing has resu... |
I've question from CLRS that's about constants and functions in asymptotic notations.
$\Theta (g(n)) = \{f(n) :there\;exist\; positive\;constants\;c_1, c_2, n_0\;such\;that$
$0 \leqslant c_1g(n)\leqslant f(n) \leqslant c_2g(n)\; \forall \;n\geqslant n_0 \}.$
Why do we require positive constants here, what is the main... |
There should be some common piece of hardware /firmware or software among different devices, isn't it? like among PCs, PlayStation, Xbox, Android phones or feature phones from pre 2008 era etc. Is there or not? like something exactly the same, some chip, transistors, anything??
|
Task: There are N persons. Some of the persons were meet before. I need to find pairs of persons, that were not meet before.
Example: 4 persons - A, B, C, D.
A and B were meet before.
Good solutions: (A + C, B + D) OR (A + D, B + C).
Bad solution: (C + D) because it is forrbidden to create pair (A + B).
What algorithm ... |
Good morning everybody.
I would like to know if there is a blueprint I could refer to when creating classes and objects in Java? For instance, I was told for classes. You start VARIABLES DECLARATIONS then CONSTRUCTOR then SETTERS AND GETTERS. What do you guys think. Thank you kindly.
PS I have just starting Java.
|
I have an algorithm with worst-case time complexity in $\mathcal O (\binom{k}{p-1})$, where $k$ is a parameter and $p$ is the input size of that algorithm. I further have determined that $p-1 \leq k $.
I need an argument which shows that the runtime complexity is solely a function of its parameter $k$, i.e. that the i... |
A person provides a service and he/she can serve $k$ clients each minute.
Now, client number $i$ comes at the beginning of minute $a_{i}$ and waits $w_{i}$ minutes to receive the service and if they don't receive the service in the interval $[a_{i}, a_{i} + w_{i}]$, they leave.
If we have $n$ clients, can the person se... |
I came across this symbol $2^{\mathcal{O} (n)}$ and I can't figure out what is means. What complexity class is this?
|
I have learnt that all data transmission is analog. Is there any mediums that could transmit bits digitally?
|
In a transition diagram, the language L(D) where D is the diagram is defined as all the words that are formed from following an "accepting" walk. Does the same apply for languages of regular grammars too? They are defined by using 4 sets (terminal, non-terminal, initial non-terminal, rules) so there is no such thing as... |
When calculating the throughput of a CPU, how does it differ when it is implemented with a single cycle datapath versus a multicycle datapath? If for example the CPU is running 1 GHz freq, then obviously it would have 1,000,000,000 clock cycles per second...and in a single cycle, it takes 1 CPI. So what would be the th... |
There has been a lot of work on building cryptosystems whose general security guarantees are attached to famous complexity classes.
This post Gives a list of some famous cryptosystems whose underlying problem is NP-Hard problem.
While I don't expect this to have much practical merit it really does beg what I think is a... |
I have 2n random points on a plane. Join pairs of points to make paths. Pair the points such that the summed path length is a minimum. In the picture below, we are trying to minimise the total length of all red-line segments. Points cannot be reused.
Obviously there's the naive brute-force solution, but I wonder if the... |
If $L$ is an infinite ($|L|=|\mathbb{N}| $) decidable language, prove that it contains:
a) An infinite subset that is not recognizable.
b) An infinite subset that is recognizable and not decidable.
For the (a) I considered all the subsets of $L$, i.e., $\mathbb{P}(L)$.
Since $|\mathbb{P} (L)| = |\mathbb{R}|$, there exi... |
I saw this question posted and can't seem to find it for some reason, so I'm posting it again.
There's a leetcode problem that's asking for the number of possible strings that are alphabetically between 2 strings (A and B) of equal length such that string C is not a substring of any of the strings. How would you approa... |
Say I have $n$ threads executing in a parallel region and one of them leaves the parallel region when others are still continuing to execute in the parallel region. Why this is a $BAD$ idea? For example you can consider this program.
$OMP PARALLEL IF(EXECUTE==true)
10 sum(id)=next(id)
30 result(id)=sum(id)*9.8
if(... |
The following Boolean expression is simplified into its minimal number of literals:
$$x'y' + yz +x'yz' \implies x'+yz.$$
How do you logically conclude this using the Boolean Laws?
|
I have read that if we run the outer-loop of the Bellman-Ford algorithm for |V| times (where |V| is the number of nodes in the graph) and check if any distance has changed in the |V|th iteration (i.e. the last iteration) then there exists at least one negative weight cycle in the graph. But why does this work? Why only... |
I have following problem:
INFPDA={⟨A⟩ |A is PDA and L(A)=infinite language}
Prove that this is decidable problem.
So my idea how to solve this problem is the following:
k = number of states of A, create finite automata D, which accepts all words which have length=k and more
Create context-free grammar G based on A... |
I have the following algorithm. How could I prove it using induction that for every $n\ge 0$, Exp(n)${}= 2 ^ n$?
Exp(n)
If n = 0
Return 1
If n is even
temp = Exp(n/2)
Return temp × temp
Else
temp = Exp((n−1)/2)
Return temp × temp × 2
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.