instruction stringlengths 35 29.1k |
|---|
Let SAT-100 be the following problem:
Input: Any boolean logic formula
Output: True if there exists a combination of exactly 100 input variables that satisfy the formula.
This is the description of a problem that is apparently in $P$. (old exam question)
I have tried to design an algorithm but I got stuck, so here it g... |
I am trying to complete this question. However, I am unsure of the steps necessary to complete the conversion from a CFL to a deterministic PDA.
I know that $ww' | w \in \left \{ a,b \right \}^{*}, w' \in \left \{ b,c \right \}$ is a context free grammar.
I need to create a deterministic PDA diagram.
What steps do I n... |
E::= zero|two|expression + expression|expression*expression, E element of expression how do i prove E to be even.
I have no clue on how to go about tackling this.
|
I'm trying to prove the following problem:
Prove that if $P=NP$ then there is a polynomial time algorithm for the following problem:
INPUT: A boolean formula $\phi$.
OUTPUT: A satisfying assignment of $\phi$ if $\phi$ is satisfiable. If $\phi$ is unsatisfiable, return $false$.
My proof:
If $P=NP$ then $SAT$ can be d... |
I want to know what are the efficient way to invert a Sparse Matrix? Are there any algorithm,linear algebra or expansions that make this task easier with out actually inverting the matrix?
Thank you in advance
|
I want to detect the non existence of a cycle in a graph using Datalog (which is a declarative logic programming language).
The proposed solution was:
(set-option :fixedpoint.engine datalog)
(define-sort s () Int)
(declare-rel edge (s s))
(declare-rel path (s s))
(declare-var a s)
(declare-var b s)
(declare-va... |
I have variables x y and z, and I have the values that they can be assigned to, I.E. x can be assigned 1,2, or 3, y can be 1, and z can be 2. The problem is a constraint that says once a value has been taken by a variable, no other variables can have that value.
The issue that I am running into is if I start with x, ... |
Normally, $\mathrm{SUBEXP}$ is defined to be the intersection of all $\mathrm{DTIME}(2^{n^\epsilon})$. That means each problem in this class has infinitely many exponential time algorithms with the exponent arbitrarily polynomially ($n^\epsilon$) small.
We all know that another closely related definition is also lurkin... |
I'm new to lambda calculus, and I read all kinds of interesting stuff about encoding data types as functions. Church booleans, numbers and lists.
https://en.wikipedia.org/wiki/Church_encoding
Is there a way to encode (binary) trees?
|
I am looking at the following algorithm for performing a Postorder Traversal of a binary tree
POSTORDER(root):
if root != nullthen
POSTORDER(root.left);
POSTORDER(root.right);
visit root;
end if;
I am supposed to be able to demonstrate that this algorithm runs in Θ(n) time complexity when the input is a n-... |
Is there an easy way (maybe by using hierarchy theorems) to disprove that $DTIME(f) = NSPACE(f)$ for any computable $f: \mathbb{N}\rightarrow\mathbb{N}$ with $f(n)\geq n$?
|
If I have an algorithm A that, in the worst case, has a lower bound of $Ω(n\log n)$ and an upper bound of $O(n²)$, how can I go about determining possible time complexities for best and average cases?
For instance, only one of the following is possible:
a. Best case $\Theta(n)$
b. Worst case $\Theta(n\sqrt{n})$
c. Aver... |
I know for an LBA the emptiness problem is undecidable. However I am not clear on how to reduce the halting problem of Turing machines to this as LBAs are strictly computationally less powerful than Turing machines. Or should I approach with reductions using computational histories of a Turing machine on an input.
|
Consider a router with a packet arrival rate of $a$ where each packet has $L$ bits, and a transmission rate (in bits/s) of $R$. My textbook describes the traffic intensity as $\frac{La}{R}$ and states that as $\frac{La}{R} \to 1$, the average queueing delay approaches $\infty$. I'm just struggling to understand why thi... |
how does Paxos Consensus algorithm behave in an asynchronous environment? Because as far as I know Paxos only work in synchronous environment. Correct me if I am wrong :)
Sorry for the noob question, started learning about Paxos yesterday only.
|
Given a deterministic parity automaton $\mathcal{A}$ with state set $Q$ and a state $q \in Q$, we denote with $\mathcal{A}_q$ the same automaton with initial state $q$. Two states $p$ and $q$ are language equivalent if $L(\mathcal{A}_p) = L(\mathcal{A}_q)$.
What is an efficient algorithm to compute the set of all langu... |
Is it correct to say that since the SHA256 function domain is finite (as reported here) we can build a DFA that calculates this function (i.e. trivially a giant lookup table)?
Furthermore, if we eliminate the limitation on the length of the input, is it correct to say that SHA256 function belongs to the class of $\math... |
A language $L'$ is $PSPACE$-hard if for every $L \in PSPACE$ we have $L \le_p L'$.
Here $L \le_p L'$ means that $L$ is polynomial-time reducible to $L'$.
Why does we use time reductions instead of space reductions in this situation?
|
We define a signature as a triple $$\Sigma\ =\ (S,F,\mathrm{type})$$ where $S$ is a set of sorts, $F$ a set of $n$-ary function symbols $f$ of the type $\mathrm{type}(f)$ $=$ $(M_1,\dotsc,M_n\dashrightarrow M_{n+1})$, where $n\ge 0$ and all $M_i$ lie in $S$ ($1\le i\le n$).
A $\Sigma$-algebra for us is a pair $$A\ =\ (... |
I am currently studying recursion theory, but I cannot really understand where to put the Primitive Recursive functions in the Chomsky hierarchy.
In my understanding, Primitive Recursive functions contain all finite languages but are not contained in Regular expressions.
For instance, I think that $\{a^nb^n | n \in \ma... |
The assumption $\mathrm{SUBEXP}\subset \mathrm{P}/\mathrm{poly}$ seems to yield nothing interesting at all. Is that true?
|
Suppose that each person in a group of n people votes for exactly two people from a set of candidates to fill two positions on a committee. The top two finishers both win positions as long as each receives more than n/2 votes.
Describe a divide-and-conquer algorithm that determines the top two candidates and whether th... |
Knuth in his book provides a method of how to efficiently calculate mod(w +1) or mod(w-1) where w is a power of 2. I am not sure I could understand his assembly language completely.
Could you explain how to efficiently calculate those mod operations through mod(2^w) and can we extend it to a more common case of mod(w ... |
I am currently learning machine learning and I stumbled across gradient descent. I understand why the algorithm always converges to the global/local minimum when the learning rate is small enough in my head, but is there a mathematical proof?
Thank you!
|
If I understand correctly (from reading Wikipedia), median-of-medians pivot selection makes quickselect $O(n)$ because the pivot is guaranteed to be in between the 30th and 70th percentiles and so at least 30% of elements will be removed in each selection pass.
But I have tried to prove this percentage inductively but ... |
I have a set of (integer) ranges and want to compute the (possibly non-disjoint) set of all subsets of overlapping ranges. The data structure used for the output is not of particular importance to me; if a linked list can be used to reduce the run time, for example, then that's alright with me.
Formal problem
Consider ... |
In Computational Complexity -- A Modern Approach, by Arora and Barak, they have the following claim (Example 3.6).
Let EXPCOM be the following language
$$ \{ \langle M, x, 1^n\rangle \mid M \text{ outputs 1 on $x$ within $2^n$ steps} \} $$
Then $\mathbf{P}^{\mathrm{EXPCOM}} = \dots = \mathbf{EXP}$. [...]
Clearly, an ... |
For a function $f$, consider the language $$L=\{\langle M\rangle\mid M\text{ computes }f\}\,.$$
Where does the language above is and how do I prove it?
To me it seems that it's not in RE nor coRE but I struggle to prove so.
what I have so far is reduction from HP to $L$ as follows:
$$R(<M>,w) = <M'>$$
$$
Define \ M': \... |
I have the following problem. The problem can be formulated in three different ways
Given sets $B_{-n},\ldots,B_n \subset \{1,\ldots,m\}$.
Find $i,j \in \{-n,\ldots,n\}$ with $|i| \neq |j|$ and $i,j \neq 0$ that satisfy $B_i \cap B_j = \emptyset$
"Invert" the sets $B_i$
Define $A_k=\{i: k\in B_i \}$. $A_1, \ldots, A_... |
GIven a number N, Threshold T and an array A. Find the lexicographically smallest order of N numbers from A such that the total of these N numbers is <= T.
This question is a simplification of this dynamic programming question:
It’s Tushar’s birthday today and he has N friends. Friends are
numbered [0, 1, 2, …., N-1... |
Is anyone able to give a concise proof for the implication stated in the title? This is gonna be in stark contrast to this question.
For definition of $\mathrm{strict}$-$\mathrm{SUBEXP}$, see here.
|
Sipser goes on to show that regular languages are closed under concatenation using NFAs. His proofs typically use NFAs to prove closure under the operations.
Is there an alternative proof that goes on to show that regular languages are also closed under concatenation using DFAs?
|
In string theory, the $k$-th power of a string $w$ is named as $w^k$, where $w^0$ is the empty string $\epsilon$ and $w^n$ is the concatenation of $w$ and $w^{n - 1}$ $(n \in \mathbb{N}^{+})$.
The power in a string that mentioned below means some power which is one substring of the string. In addition, two strings are ... |
Suggest a Data Structure for N elements that support on the following operations:
Describe the Data Structure on a sketch and literally, describe how each method work.
\begin{array}{|c|c|c|c|}
\hline
Operation & Average Running Time & Deterministic Running
Time \\ \hline
Init(N)& &O(1)\\ \hline
Insert(x)& O(log(n... |
I'm trying to understand the proof of the Cook-Levin thereom in Aurora and Barak's "Computational Complexity" text.
A snapshot $z_i$ of $M$’s execution on some input $y$ at a particular step $i$ is the triple $(a, b, q_i) \in \Gamma \times \Gamma \times Q$ such that $a, b$ are the symbols read by $M$’s heads from the t... |
Can someone explain the steps to reduce
$$ (\lambda n. \lambda m. \lambda f. \lambda x.\ n\ (m\ f)\ x)\ (\lambda f. \lambda x.\ f\ (f\ x))\ (\lambda f. \lambda x.\ f\ x) $$
to $\lambda y. \lambda z.\ y\ (y\ z)$?
|
I am trying to generate output consisting of three-tuples (A,B,C), where A,B, and C are three different datatypes representing different values. I also have a collection of functions $f_i \in F$ which each take in either one, two, or all of A,B, and C as input, and output whether a condition regarding the relevant var... |
I am studying about Finite State Automaton, and I found that the when reversing a language (i.e., transforming $L$ to $L^R$), I have to add new start state. Why is that?
Also, can a Finite State Automaton have more than one starting state?
|
I am studying some algorithms interview questions and I am seeing many path-based questions like "if a robot is at the top left of a grid and can only move down or to the right, how many paths can take it to the bottom left of the grid". Or similarly sometimes they ask if the particular destination can be reached at a... |
In page 71 of Mathematics for Computer Science (page 77 in the pdf) it says that "The Turing award (the “Nobel Prize” of computer science) was ultimately bestowed on Robert Floyd, for, among other things, being discoverer of a simple program that would insert the brackets properly [into an arithmetic expression]."
What... |
Please also explain in terms of closure of these languages and plot a difference using specific example.
I am interpreted like this and now i am confused.
S1 and S2 are two languages.
"S --> S1. S2 " ( S1 followed by S2 hence concatenation )
and
"S--> S1.S2" ( S1 'and' S2 hence Intersection)
Correct me where I am going... |
It's a pretty basic question, but I couldn't find an explicit answer in the book which I'm using, also when searching for it - I didn't find a reliable reference.
Correct me if I'm wrong but for two DFA's, $A , A'$ -given that $L(A) = L(A')$ doesn't mean that the DFA's are equivalent, so what are the (sufficient and n... |
For two words $w,v \in\{0,1\}^*$ of equal length, let $w+v \in\{0,1,2\}^*$ denote the word in which the $i$-th word is the sum of $i$-th position of $w$ and $v$, as follows: if $w=a_1 \ldots a_n$ and $v=b_1 \ldots b_n$, then $w+v=c_1 \ldots c_n$, where $c_i=a_i+b_i$ for each $i\in \{1, \ldots, n\}$.
Assume $L \subsete... |
I'm kind of new to lambda calculus and I found this Wikipedia article
https://en.wikipedia.org/wiki/Mogensen%E2%80%93Scott_encoding
The section Comparison to the Church encoding presents a short comparison between Church and Scott encoding
Church
λx1...xAi.λc1...cN.ci (x1c1...cN)...(xAic1...cN)
Scott
λx1...xAi.λc1...cN... |
I know all the regular languages are decidable but not sure whether it can be done in LogSpace.
|
Let $G$ be a context-free grammar with set of terminals $A$. Let $X$ be a non-terminal in $G$. Is the language of words over the alphabet $A$ with a syntax tree in which the non-terminal $X$ appears even number of times is context-free?
|
I am looking for an efficient algorithm for the following problem.
There is a base-k numeral system, and we want to have some k-length numbers, but all of the digits must be different ones.
It would be useful, if all of the possible feasible numbers would be unequivocal sortable (so the given nth number is always the s... |
I have two arrays.
seconds = [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, ..., 2680]
totalMeters = [0, 3.2, 7.1, 10.6, 14.1, 17.9, 21.5, 24.2, 27.8, 32.5, 36.9, ..., 5000]
The totalMeters array is the total meters that I have run at this specific point of time. The sampling is 2 seconds.
I would like to find where in th... |
I have group of people. Each person can be described by few characteristics:
age, occupation, city, favorite_color
I would like to generate 60 random people and combine them into pairs.
With a constrain that no person in a pair can share any characteristic, for example I can't have two people in a pair whose favorite_... |
There is no known proof that one way functions exist. But what is the heuristic evidence that they exist?
I sometimes read that the existence of cryptography is heuristic evidence that they exist. E.g. the ciphertext from a block cipher like AES is easily computable if you know the plaintext and key, but the key is not... |
Follow-up question in the series:
Karp hardness of searching for a matching erosion
Karp hardness of searching for a matching split
Maximum Matching Cut problem
Input: An undirected graph $G(V, E)$ and an integer $k$
Output: YES if there exists $M \subseteq E$ such that $M$ is a matching of size $k$ (i.e. $k$ edges) a... |
I was watching a lecture on determining the strongly connected components of a graph using Kosaraju's algorithm and the lecturer claimed one can easily walk the edges in reverse fashion.
While I see this happening with an adjacency matrix representation(the reverse is the matrix transpose, and you can determine its ele... |
I'm just beginning self-studying a course on computability and automata; my textbook, describing a generic Turing Machine, lists two following halt conditions:
A TM halts, if for a particular state $q \in Q$, $\delta(q, a) = (q, a, HALT)$ for all $a$ in the alphabet and this $q$ is called a halt state;
A TM also halts... |
Concerning about a wide variety of complexity classes, I have come up with the above conjecture.
Please, establish the claim in the title formally.
|
Chapter 6 of "Algorithms" by Dasgupta, Papadimitriou, and Vazirani summarizes four types of subproblems that are quite common in dynamic programming. They are
prefix/postfix of a string/sequence/array
both prefixes/postfixes of a pair of strings/sequences/arrays
an interval of a string/sequence/array
a rooted subtree... |
Please, establish the above claim formally. It seems that the structure of complexity classes has so much bizarre features everywhere.
For the $\Longrightarrow$ direction, a padding technique will work out. For the other direction, the time bounds are pushed down, so hardly any current technique would succeed.
|
All I could find is an example of sparse language.
I understand that I need to design a language whose all strings generation should not be bounded by a polynomial function, but I feel all the languages string generation is bound to at least one polynomial, so I am unable to design a language L whose strings are not bo... |
I have 30,000 items; each item has 30 parameters that take values from 0 to 5. These parameters are named $p_0$ to $p_{29}$ and their value is an integer between 0 and 5. I want to store these items in a data structure where I can do this lookup quickly: find the parameter with a given value for $(p_0, \ldots, p_{29})$... |
In a recent exam, I've been asked to solve the following problem:
The problem
Two players play the following game: Given a sequence of coin values
$v_1,\ldots,v_n (n \vert 2)$ the players take turns in taking one coin
from either "end" of the sequence. The value of that coin is added to
their score.
Player 1 a... |
This question is based on a solution of Laura Toma to a question from CLRS (#6 on the sheet).
Question: Give an $O(n\lg k)$-time algorithm to merge $k$ sorted lists into one sorted list, where $n$ is the total number of elements in all the input lists. (Hint: use a min-heap for $k$-way merging.)
Solution: The straightf... |
A popular app takes 10 seconds to execute on a 11 watt smartphone A, and it takes 8
seconds to execute on a 13 watt smartphone B. The app is a bigger drain on the battery
on which smartphone?
|
In multiobjective optimization, what does the distance exactly means, is it:
1) The distance from reference point (V) to an individual (Xi) (candidate solution) in the population (decision space).
Euclidean Distance = d(Xi,V)
OR
2) The distance from reference point (V) to the objective vector f(X) in the objective s... |
I searched online but I couldn't find any comparison between rendering a point cloud and rendering a triangle mesh.
|
Singhal–Kshemkalyani’s differential technique is based on the
observation that between successive message sends to the same process,
only a few entries of the vector clock at the sender process are
likely to change. This is more likely when the number of processes is
large because only a few of them will inter... |
I am reading the lectures about cubical type theory in this github repo. In lecture 1 the author defines function extensionality the following way:
funExt (A B : U) (f g : A -> B)
(p : (x : A) -> Path B (f x) (g x)) :
Path (A -> B) f g = <i> \(a : A) -> (p a) @ i
and writes
To see that this makes sense c... |
The question is as follows:
I am new to this, and I do not understand how to apply divide and conquer to a matrix, the algorithm that I have come up with is as follows (I am not sure if I am correct)
I thought I can divide the matrix into a matrices of 3 x 3 and 2 x 3 first. Then I will apply sorting of rows over colu... |
I've read conflicting answers for the space complexity of the top down implementation w/ memoization for the classic coin change problem. Would this be O(N * M) space as Interview Cake says https://www.interviewcake.com/question/javascript/coin?section=dynamic-programming-recursion&course=fc1 or O(N) space or LeetCode... |
I know that for an array of size n distinct elements, the Average Case complexity for linear search is as follows:
A(n) = $\frac{n + 1}{2}$
However, I am having trouble coming up with the Average Case complexity in the case where half of the elements in the size n array are duplicates. Take, for example, this array of ... |
I have started to learn automata theory and languages. I am new to regular expressions.
As a use case in real world, I would like to construct a regular expression to accept a c-style string: enclosed by double quotes, allows escape sequences (\" to escape a double quote, \ escape a backslash, \n escape a new line...) ... |
A question from the textbook Modern Operating Systems by A. S. Tanenbaum reads as follows:
A computer has a pipeline with four stages. Each stage takes the same time to do its work, namely, 1 nsec. How many instructions per second can this machine execute?
This was recently a homework question in my operating systems... |
When I hold down a key on my keyboard, a continuous stream of characters is generated and is displayed on the text editor, Now since pressing a key is a hardware interrupt, so does holding down a key continuously generates interrupt signals and does CPU constantly keeps acknowledging those ? or something else happens ?... |
I have a use case, real one, and I'm trying to come up with an efficient maximization algorithm to solve it.
I'll try to simplify, with a simple analogue, and after will explain the real world use case:
Analogue:
Imagine you have 2 buckets of springs.
Each spring has 2 properties: resting length, and maximum stretchi... |
I'm currently going through this book about programming languages, and in section 4.2, Lemma 4.2 it says this:
Lemma 4.2 (Inversion for Typing). Suppose that $\Gamma \vdash e : \tau$. If $e = \texttt{plus}(e_1;e_2)$, then $\tau = \texttt{num}$, $\Gamma \vdash e_1 : \texttt{num}$, and $\Gamma \vdash e_2 : \texttt{num}$... |
Consider the following set constructed with a regular Kleene-star operation:
$$
\{10^n \mid n\geq1\}^*
$$
Would something like $10100$ be in this set? I know $1010,100100100,1000,$ etc would be, but I'm not sure if you can change $n$ per repetition and have it be something like $10100, 101001010010$, etc.
|
The paper "CPS Translating Inductive and Coinductive Types" mentions that there is an isomorphism between inductive (mu) and coinductive (nu) types, which they use for their translation. It states that:
$$\neg\mu Z.A(\neg Z)\ \cong\ \nu Z.\neg A(Z)$$
...but it gives no more details about it. Is this isomorphism correct... |
I have been doing some research online looking for graph problems that are decidable but not in NP. I have found the concept of succinct graphs, which if I understand properly, consist of making the input small (i.e. supplying the graph structure using a small amount of memory) so that when properties of the graph are ... |
When you install an OS on a piece of hardware such as a Macbook, what is happening logically? In other words, how does the software "talk" to the hardware? Is it the same logical process with every OS and every piece of hardware, or is this process different for each OS and each piece of hardware?
|
I was looking at a recursive solution for the robot on a grid problem which basically states that there is a robot on the top left corner on a grid and you are supposed to find a path to the bottom right of the grid and the robot can only move down or to the right. Below is the recursive function for the solution
publ... |
First, read the previous question: Karp hardness of searching for a matching cut
As mentioned in the supposed-to-be-comment answer in that question, without the requirement of cardinality $k$, the problem has been proven to be $\mathrm{NP}$-hard even when restricted to bipartite graph of bounded diameter.
Now, I wanna ... |
First explaining the "reverse" use as a background:
There is an array A which contains N boolean values
There is an array B which contains N boolean values
I start iterating over array A and for every iteration I increment its current position by 1.
When corresponding bits at currentLocationA and currentLocationB in b... |
Compared to not using instruction pipelining. What is different?
|
Given an undirected graph $G(V, E)$, how hard is it to decide whether it has an induced tree consisting of $k$ vertices, where $k$ is also given in the input?
|
algorithm:
a=[1,2,3.....n]
for i in (1,n+1):
j=rand(1,n+1):
swap(a[i],a[j])
let us say that n=3:
132
213
231
these 3 are 5 times possible
and
123
312
321
are 4 times possible....
similarly
for n=4
2143 occurs maximum number of times = 15 times
and 4231 and 4123 occurs min times i.e 8 times only....
i figured ... |
I have to tackle this problem:
I have some strings that are my training set. These strings belong to a regular language corresponding to a deterministic finite automata (hidden namely I don't now it, neither the language nor the automata). A string is labeled like positive if belong to hidden language and negative othe... |
When can it be applied? When can it not be used? I get the general idea but not what it takes to make it work.
|
I was reading about data compression algorithms and the theoretical limit for data compression. Recently I encountered a compression method called "Combinatorial Entropy Encoding", the main idea of this method is to encode the file as the characters presented in the file, their frequencies and the index of these charac... |
So I have been battling this rather peculiar problem:
given the following input (on an euclidean plane):
point p
polyline l
integer n
p is not inside of the convex hull of l
find a new polyline l', such that:
it has n vertices
it "covers" l with respect to p, i.e., a line section connecting any point on l with p wil... |
I have this multiple choice question from a computer architecture class, a mips processor executes a program at 10 sec, without pipelining and clock rate
100 MHz. When running the program on a processor with 500 MHz clock rate and 5 stages of pipelining which of the following execution times isn't possible.
a:2,5 sec,... |
As an example of the type of problem, consider Stewart Coffin's Cruiser puzzle:
Let R be a 48 × 31 rectangle. Let T be a 30°-60°-90° triangle with
hypotenuse 34.565 (so legs are 17.2825 and 29.934). Let P be a right
trapezoid with base 20.0982 and altitudes 27.1178 and 15.514. Show how
to place two copies of T a... |
I have been puzzling over an algorithm that decides whether a sorted array of numbers contains two numbers that differ by k. I do not intuitively understand why this algorithm works, or what thought process might have led me to think of this algorithm on my own, although I believe that I can prove it's correctness.
CON... |
Let $G$ be a bipartite graph with sides $L$ and $R.$ Let $w_{lr}$ be the edge weight of an edge from $l \in L$ to $r \in R.$ Let $x_r$ be the node weight of the node $r \in R.$ Let $E$ denote the set of all edges in $G.$ Let $2^E$ denote the set of all subsets of edges. The optimization problem is the following $$\max_... |
UPDATE: In 2 days, if no more convincing answer is posted, then bounty of 50 rep. will go to xskxzr. Due to lack of connectedness and a clean & clear cut, the bounty is still open for 2 days. (UTC is now 17 Sep 01:57)
This is yet another follow-up question in the series:
Karp hardness of searching for a matching cut
Ka... |
We are planning to design a system where following operations are supported.
Increment("foo"): Increase the count of key 'foo'
Decrement("bar"): Decrease the count of key 'bar'
getMin(): Return the key which has minimum count
getMax(): Return the key which has maximum count
The catch is all operations should be ... |
(a) We have alphabet $\Sigma=\lbrace 1 \rbrace$, $\Sigma=\lbrace a,b \rbrace$ and (b) also an alphabet with size $k$ and words with length $n$.
For the first two alphabets in (a), we know that there are countably infinite words:
$$|\Sigma| = |\mathbb{N}|$$
For the alphabet in (b) we know we have $k^n$ number of words.... |
I'm having trouble understanding the rules for W-types in type theory as defined here: https://ncatlab.org/nlab/show/W-type#wtypes_in_type_theory
Can someone give an example of how these rules could be used to define a simple W-type such as the natural numbers? What would $A$ and $B$ be in the formation rule for instan... |
Let's start with the question. Say I have a C language statements follows
it 458cat 2.01 = 96.87abc a.2 ;
-my question is how many tokens are there in the above statements. Secondly does white space like tabs, newline, makes a token or not?
If you are interested in my solution then proceed on your own risk. Firstly... |
Given an array we need to find maximum equal sum $K$ subsequences, i.e. we want the sum to be maximized such that there are exactly $K$ non-overlapping subsequences each having the same sum.
Example:
A = [1, 2, 3, 4, 6] & K = 2
Maximum Sum Subsequence = 8 = [2, 6] & [1, 3, 4]
If, K = 3 and A = [1, 2, 3, 4, 6, 8, 9]
M... |
Is it good to define a language $\mathcal{L}$ in NP as a language for which, given an element $x$, it is possible in polynomial-time to check whether $x \in \mathcal{L}$ or not?
Because I need to have an informal definition of that, in order to give just an idea of it, without using formalism.
Otherwise how could I def... |
So here's the question: "There are two types of professional wrestlers: "babyfaces"("good guys") and "heels"("bad guys"). Between any pair of professional wrestlers, there may or may not be a rivalry. Suppose we have n professional wrestlers and we have a list of r pairs of wrestlers for which there are rivalries. Give... |
I have two binaries, $\alpha_{ts,it}$ and $\alpha_{ts,gshp} \in \{0,1\} $, and two reals $T_{it}$ and $T_{ts}$ which have upper and lower bounds. How can I model $\alpha_{ts,it}=1$ if the following constraints are met:
$T_{ts}\geqslant-7$
$T_{it}\leqslant14$
$T_{ts}-T_{it}\geqslant5$
$\alpha_{ts,gshp}=0$
Regards
SR89... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.