instruction stringlengths 35 29.1k |
|---|
From what I have seen about usage of a pair of public and private keys, the public key is used for encrypting a message, and the private key is used for decrypting the encrypted message.
If a message is encrypted by the private key, can it be decrypted by the corresponding public key?
If yes, can you give some example... |
I'm trying to solve some exercises for the upcoming Compilers' exam.
Teacher gave us some sheets from previous exams to practice with - no answers provided.
Let $\mathcal{G}$ be the following context-free grammar:
$$
\begin{aligned}
A &\to BC \\ B &\to aD\; |\; bD \\ C &\to BCC \; | \; aCd \; | \; \epsilon \\
D &\to... |
Why the smallest operable data type in most programming languages is one-byte sized? Is it possible that to operate with a single bit? If it is possible, how to do it in practical?
|
I'm studying elementary data structures like Linked List, Doubly Linked List and Binary Trees like Binary Search Trees.
Both runs in worst case O(n) in the same operations, so why don't we use only one data structure?
|
How to prove: A language $A$ is decidable $\Leftrightarrow$ if there is a turing machine which lists $A$ in a word length alphabetically ordering.
Word length alphabetically means a sorting first after the word length and then after the character ordering $(\epsilon,a,b,aa,ab,ba,bb, ...)$.
Hope somebody can help me li... |
Problem formulation
I have implemented an interesting probability distribution data structure: having $n$ elements $a_1, a_2, \dots, a_n$ in the data structure with respective positive weights $w_1, w_2, \dots, w_n > 0$, upon request each $a_i$ may be returned with probability
$$\frac{w_i}{\sum_{j = 1}^n w_j}.$$
A Jav... |
I'm preparing for exam and I came across this problem:
We say that a graph is König's graph when the sizes of its minimum vertex cover and maximum matching are equal. Find a polynomial time algorithm deciding if a graph is König's graph.
I'm stuck. I know that in bipartite graphs this always holds. I also know that w... |
How to construct my proof and generally what should I aim to get when showing a function is $\mu$-recursive? Should I transform it in some of the basic functions using the given operators?
For example, how should I proceed with the following one:
$\phantom{AAAA}pred(x) = undef$, if $x = 0$
$\phantom{AAAA}pred(x) = x ... |
Has anyone succeeded in implementing or designing a type-system that combines both type-state (linear types) and effect types (e.g. Koka)?
|
While doing the second code kata (which asks you to implement a binary search algorithm five times, each time with a different method), I've come up with a slightly different solution which works as follows:
If i have a sorted array of lenght 100 and I see its starting field contains the number 200 and its ending field... |
I am a computer science under graduation student, and was going through some Go Back N ARQ (Computer Networking) videos on YouTube, and got a doubt in a question, which according to me should have a different answer than what the instructor on the video is arriving at (given that no other comment in the comments sectio... |
so the thing is that i have to prove that if the language $L ⊆ \Sigma^*$ is decidable then both languages are also decidable.
$$P_1(L) = \{w ∈ Σ\mid \text{ For every prefix v of w, we have }v ∈ L\},$$
$$P_2(L) = \{w ∈ Σ\mid \text{ There's a prefix v of w, so that }v ∈ L\}.$$
My idea is to create two TM for $P_1$ and $P... |
I've been using the IBM quantum experience to learn about and simulate Grover's algorithm. When they create the algorithm, they use a different set of gates depending on which oracle function $f(x)$ they want to use. In other words, they are explicitly putting in a set of gates of what they want to find before they loo... |
Consider a DAG $g$ as a label $l$ with a list of sub-nodes $\bar{g}$:
$g ::= l \enspace \bar{g}$
This is an "unfolded" representation of the DAG, i.e. it contains double entries, when two paths reach the same node.
When $g = l \enspace (l_1 \enspace \bar{g_1}, \ldots, l_n \enspace \bar{g_n})$ is ordered-complete, i.e.
... |
I have been reading Alimonti and Kann's paper "Some APX-Completeness results for cubic graphs" and I don't understand why the degree-reduction gadgets for Max Cut and Min Vertex Cover have to be different.
Here are the two gadgets in question. The Min Vertex Cover gadget simply divides a degree $n$ node $v$ into a cha... |
I have a weighted directed graph $G=(V,E)$ with positive weights. Say these vertices represent cities and the weight $w : V_1 \rightarrow V_2$ represents number of students moving into other cities for college. Note here that a city $A$ may have a small population and it may be sending a major proportion of it's outgoi... |
In a typed setting, records can be thought of as a map from field to type. If there is a well-typed record merge operation (which allows overlapping fields), is there any real difference between the resulting type and a dependent map in a dependently typed language?
|
I have a set of points (tiny triangles) $K=\{1,2,\ldots, k\}$ and a set points (tiny circles) $N=\{1,2,\ldots, n\}$ and a matrix of positive real values $\mathbf{D}=\left[d_{ij}\right]$ for all $i\in K$ and for all $j\in N$. The entry of the matrix $d_{ij}$ can be viewed as the Euclidean distance between triangle $i$ a... |
I was reading “Introduction to Algorithms” by CLRS and it says
Note that f(n) = Θ(g(n)) implies f(n) = O(g(n)) since Θ notation is a stronger notation than O notation. Written set theoretically, we have Θ(g(n)) ⊆ O (g(n)) .
This means that Θ is a subset of O . Both the statements seem contradictory.
|
new to automata theory and this is quite difficult for me so I'd appreciate a hint in the right direction if possible.
We want to find a regular expression for the language $L$ over $\Sigma = {a,b,c}$ where $L$ is the language of all strings of even length, contain $a$ at least once, and after the final $a$ letter ther... |
I am making a multiple choice quiz however I am finding difficulty on how to impletement a machine learning algrithm of somesort where by it can see which questions the user gets wrong and make a custom quiz for them for those questions.
many thanks
|
I just read Can this algorithm still be considered a Binary Search algorithm? and recalled that a few years back I wrote an indexer/search for log files to find log entries in large plain text files by date/time window.
Whilst doing this, I decided to try interpolation search (I didn't know that was what it was called,... |
I'm curious if we can reduce an $NP$-complete problem to an $NP$ problem which is not a part of the $P$ set. Meaning, can we take an algorithm for this kind of $NP$ problem and use it to solve a single $NP$-complete problem?
If we could do this would it mean that the single $NP$ problem which is non $P$ is considered t... |
In circuit complexity theory, a branch of computation complexity theory, a theorem is that any Boolean circuit without NOT gates can be written equivalently as a hierarchical structure, in which the first layer consists of OR (or AND) gates, then the second layer consists of AND (or OR) gates, the third layer consists ... |
Suppose that we have a non-planar graph $G$ which is undirected and connected. Our aim is to remove a set of edges and/or a set of vertices and convert make $G$ planar while keeping the connectedness.
Besides connectedness, $G$ is guaranteed to have enough connectivity so that removal of a reasonably small amount of ve... |
I´m new here and this is the first question I´m posting (hopefully this is the correct site).
I have the exercise below:
Consider a virtual address space of 10 pages of 1024 words each (1 word = 2 bytes), mapped onto a physical memory of 32 frames. How many bits are needeed for each virtual address?
The answer they p... |
I am currently writing a graph object in Swift, I see that there are different types of graphs, some that are undirected and some that are directed. Here are my questions :
Can a graph be both directed and undirected, is there a specific name for such graph?
What is the common approach to make an edge that would be bi... |
I am trying to implement decompression algorithm based on huffman trees. I am trying to validate my assumptions.
Assume that you have alphabet of 350 symbols. Maximum encoded code length is 15 bits. How many different combinations of first 9 bits of each code longer than 9 bits can be encoded in this tree ?
I am only ... |
Assume we have a finite set $X$ of elements and any relation $\preceq$ on $X$. Such a relation may or may not generate a reflexive transitive anti-symmetric relation $\leq$ on $X$ (a partial order). Recall:
reflexive: We always have $x\leq x$.
transitive: If $x\leq y$ and $y\leq z$ then also $x\leq z$.
anti-symmetric: ... |
We consider the function $g$ which associates the number of prime integers with $n$ in the set $\{0,...,n\}$. I have to prove that $g$ is a primitive recursive function.
First I defined the set $A=\{i∈\{0,...,n\}:\gcd(i,n)=1\}$. To show that $A$ is a primitive recursive set I said that : $\{0,...,n\}$ is primitive recu... |
I am reading a paper about the TextRank algorithm in keyword extraction and they mention the recursive formula:
$$ \displaystyle S(V_{i}) = (1 - d) + d \ast \sum_{j \in In(V_{i})} \frac{1}{|Out(V_{j})|} \; S(V_{j}) $$
where $ In(V_{i}) $ are the vertices that point to $ V_{i} $ and $ Out(V_{i}) $ are the vertices that... |
In the Deep MNIST Tutorial for Tensor Flow, (and in general), we create a convolutional layer with a weight tensor, say W, of shape (patch dims, #input channels, # output channels). However, when we define the bias tensor, b, its shape is only (#output channels).
When we convolve W and the input x, with correct paddi... |
Given a graph $G$ where loops and multiple edges are allowed.
A path {$e_1, e_2, ..., e_k$} (a sequence of edges) has a cost
$$ cost = e_1 | e_2 |...|e_k$$
where $|$ is the bitwise OR.
Assume for all edges in $G$, $e_i \ge 0$.
Now, the triangle inequality is satisfied, for this definition of cost. Meaning, as the path ... |
I need to prove that
HAMPATH-e = { < G,s,t,e > | G is directed graph, s, t are vertices and e a edge }
there is hamiltonian path between s to t that cross the edge e
is an NP complete.
i've already prove it's in NP.
now i need to show poly-time reduction from HAMPATH to HAMPATH-e but i cant figure it out.
any suggest?... |
Can a graph have multiple nodes that have the same value ? For instance, could a graph holding numbers have the same number present multiple times across the itself ?
My current approach is to not allow the insertion of the same element multiple times, and to instead enable an element to have an associated value, is ... |
A man has to travel for given number of days by bus.
He can buy either:
$1$ day ticket for $2Rs$ (valid for 1 day)
$7$ days ticket for $7Rs$ (valid for 7 consecutive days)
$30$ days ticket for $25Rs$ (valid for 30 consecutive days)
We are given an array, whose elements are the day numbers on which he travels.
For exa... |
Consider an extension of finite-state machines that utilizes a finite set $C$ of counters. Let's call them counter automata. Before execution, each counter $c\in C$ is set to zero. Every transition, aside from reading a character (possibly $\epsilon$), performs a counter operation – it either increments or decrements s... |
I believe that the concatenation $a^pa^m$ where $p$ and $m$ are primes is not regular, since I can show that $a^p$ is not regular using the pumping lemma, therefore there is no NFA for the 1st part, therefore the concatenation cannot be regular (I.e. there is no NFA to do the lambda transition)
Is the above reasoning c... |
I am recently brushing up my computer network knowledge, and came across a seemingly peculiar statement:
A network bridge divides a network into smaller broadcast domains.
As far as I could grasp the details, a bridge operates on the two lower layers of the ISO OSI model - the physical and the data link layers.
What ... |
I have encountered a question, which asks what is a syntactic form. This motivated me to ask myself, what is the anatomy of the grammatic rule,
S ::= A | B | C
Anatomy established that S is called LHS whereas A | B | C is called expectedly RHS. But, how do you call the individual alternatives within the RHS? Is i... |
I am currently learning about FPTAS and PTAS but do not understand what the definition of FPTAS.
A fully polynomial time approximation scheme (FPTAS) for problem $X$ is an approximation scheme whose time complexity is polynomial in the input size and also polynomial in $1/\epsilon$.
In this explanation, what does the... |
This is the exercise 2.18 from Introduction to Bioalgoritms of Neil Jones. It says:
We have a mix of 100 participants: some are honest while others are not. The honest ones always tell the truth, but the deceitful ones sometimes tell the truth and sometimes lie. You can ask any participant the following question about... |
I want to prove that PP is under symmertic difference.
let A be a language in PP and B likewise.
I tried showing that : (A\B) U (B\A) in PP , so by show each in PP and then showing that it's closed under union , I should be done.
How do I show A\B in PP?
Am I on the right track? Maybe there is an easier way?
|
I have found this exercise on the Internet but I´m having problems with sections 4 and 5, because I don´t understand where do the solutions appear from.
Example: Mapping VAs to PAs
Suppose
- Virtual memory of 2^32 bytes
- Physical memory of 2^24 bytes
- Page size is 2^10 (1K) bytes
1. How many pages can be stored... |
In a functional programming language I have functions like
$$f\colon Int \times Int \times \cdots \times Int \to Int$$ which do some computation. However for certain arguments $(x_0, \dots, x_n)$ the function will cause arithmetic errors like Integer overflows, Integer underflow or even Division by zero. I do not want... |
Data flow analysis work over a control flow graph. When a language under consideration supports exceptions, control flow graph can explode.
What are the standard techniques for dealing with this blow-up?
Can we soundly disregard edges induced by exception? Data flow analyses anyhow compute over-approximations, so we w... |
Are there problems, for which best algorithms have worst run time O(input_length^2) and it is proven, that this worst time cannot be substantially improved (better algorithms do not exist).
EDIT: This question is different from Are there any known lower-bounds for complexity on Non-determinsitic machines , because I ha... |
How do I know if a class let's say PP , is closed under cook reduction or not closed?
I understand the concept of reduction (how to use it mainly) , but still can't figure out the meaning behind it, as to determine if some problem belong to that class if there is a reduction.
|
In the proof in wikipedia, it goes like this:
Let $L \in \Pi_{2}$, so we can describe membership in $L$ as a formula:
$\forall_{y}\exists_{z} V(x,y,z)=1 \iff x \in L$
(where V is polynomial deterministic verifier etc...)
Now they look at the subformula : $s(y)=\exists_{z} V(x,y,z)$ and say that because it's an instance... |
It's my first question out here, so please don't judge me too strictly.
I heard of the following game: there's set of cards with different set of objects (but the same number of them on every card) painted on cards, while for every pair of cards there's one and only one common object. The game is for two players. At ea... |
I'm new to quantum computing, so while studying Grover's algorithm I (and, I think a lot of other people too) could not help but notice that exactly the same operator is applied $\sqrt{N}$ times:
$$U = [2 \left| \psi \right> \left<\psi \right| - I ]\mathcal{O} $$
Of course, it depends on the oracle $\mathcal{O}$ and, a... |
What are the pre-conditions for any problem X to be qualified for being solved in a single source shortest path problem (SSSP) setting?
Lets, say we have a problem X. What should be the pre-conditions that we check in problem X definition that would allow us to formulate it as a SSSP.
Initial Idea for solution: I beli... |
I tried to prove or disprove that pp is closed under cook reductions.
anyone has a idea or link to a answer?
|
We know DPLL algorithm is backtracking + unit propagation + pure
literal rule.
I have an example. There is one example to solve following Satisfiability problem with DPLL. if assign of "0" to variables is prior to assign "1" to variables, Which of Unit Clause (UC) or Pure Literal (PL) is used to solve this specific exa... |
Preliminary
After doing some searches of similar questions posted here and elsewhere, i feel like this is the right place to inquire about, now let's get through some boring main notations...
A MiniMax tree is an arborescence structure generated by an AI role-playing game to simulate the opponent turns giving notes/s... |
I am trying to research a problem similar to the stable matching problem with a few different rules. The problem is as follows:
There are an equal number of men and women.
Each man has a perfect match with one and only one other woman.
No two men have a perfect match with the same woman.
A perfect matching is a set of... |
I am using the C++ boost library implementation of the push relabel algorithm to solve a max-flow problem. The output from that algorithm is a residual graph and in order to find the min-cut of my original graph, I need to find all of the vertices which are reachable from the source vertex in the residual graph.
I was ... |
A multi-user, multi-processing operating system cannot be implemented on hardware that does not support
Address translation
DMA for disk transfer
At least two modes of CPU execution (privileged and non-privileged)
Demand paging
My attempt:
Somewhere it explain as : Address translation is needed to provide memory pro... |
It is known that TCP is a connection oriented transport layer protocol of the TCP/IP suite. But TCP (and UDP) operate over a connection less network layer protocol, the IP (internet protocol). What this means is that in TCP, if a sender sends data to the receiver, at the network layer, the receiver will accept the pack... |
I am browsing the "Introduction to Algorithms" book by Thomas H. Cormen. One of the very first tasks in the introduction chapter gives a couple of running time functions like
f(n)=lg n
f(n)=n!
f(n)=2^n
and the following durations: 1second, 1minute, 1hour, 1 day, 1month, 1year, 1century
The f(n) functions describe the ... |
Normal zero-based arrays (ie not those with a sort order) have constant lookup time, but linear insertion time.
For a specific problem I was musing about a balanced tree that would allow for an zero-based array implementation with logarithmic time for all of the following operations: insertion, removal and finding the ... |
Having a lot of trouble figuring this out.
It seems to me to be impossible. I could do one side of the OR - but the fact that the string can begin with 100 1's and then have 200 b's seems like it can't be accounted for. Am I supposed to just stack every single a and b it traverses, and then somehow find a way to compar... |
I'm doing this challenge on Hacker Rank that wants me to implement a linked list.
It seems to want me to find the last-added instance of node and change its head to link to my new instance of node. Therefore the last instance added would have head=None (I'm using Python).
This is the pic they provide -
Wouldn't it ma... |
I have read that intersection of regular language and context-free language is always context-free. Most of the places an standard example has been used to prove this, e.g.,
\begin{align*}
L_1 &= L(a^*b^*)\\
L_2 &= \{a^nb^n\mid n\geq 0\} \quad\text{(which is context free)}\\
L_1\cap L_2 &= \{a^nb^n\mid n\geq 0\}\,.
\e... |
I'm rather confused by the recursion theory.
From the link, the recursion theory was formed by Dedekind, Gödel and some other famous mathematicians. There are the following types of recursion. But where is tail recursion? can this concept parallel to these concepts? what else concept goes parallel to tail recursion?
... |
Definitions:
Cluster Edge Deletion problem is a graph modification problem, in which we want to remove the minimum number of edges such that the resulting graph does not contain a $P_3$ as an induced subgraph (that is, the resulting graph is a disjoin union of cliques).
The class of $k$-trees is defined as follows: a c... |
Lets say I am doing a reduction from $\mathrm{HALT}_{\mathrm{TM}}$ to another language $S$, in order to prove that $S$ is not decidable. For this I need to build a new Turing machine, $M'$. Can I create $M'$ in such a way that the next step is depended upon whether or not a simulation stops? Take the following two exam... |
I want to know if there is any polynomial algorithm for the problem, or any NP-completeness result.
Given a set $S$ and $m$ subsets $C_1, \dots, C_m$ of $S$, we want to find a non-empty set $X\subseteq S$ such that $|X\cap C_i|$ is even for as many $i$ as possible.
We can see this problem in another way: given $m$ $\... |
I'm trying to figure out how to do amortised analysis of heap insert and heap delete-min using potential function.
We can assume, that insert is O(logn) and delete-min is O(logn) too.
The goal is to prove, that amortised price of insert is O(logn) and amortised price of delete-min is O(1).
Can't figure out how to crea... |
Suppose we had an algorithm that solved an NP-complete problem (SAT, TSP, etc.) in time $O(2^{N/B})$ where $B>2$ is an input to the algorithm, along with the instance to be solved.
So for $B < N$, we have a reduced exponential growth runtime, but for $B \geq N$ we actually have a constant runtime.
What would this say a... |
I am interested in the repeated point in polygon problem, where one is given a polygon in a preprocessing phase and in the online phase, one is asked whether a point is in that polygon. The polygon is not necessarily simple. I am interested in the case where a polygon has many edges.
Let $n$ be the number of vertices o... |
So I was wondering something about the Chomsky hierarchy.
DFAs (and NFAs) accept regular languages, while NPDAs accept context-free languages.
Right-regular or left-regular grammars produce regular languages, while context-free grammars produce context-free languages.
Regular expressions represent regular languages - b... |
I know that language non-emptiness is TM recognizable, and one can perform a BFS to find an input string that TM accepts, if there is any. But, what is the most efficient algorithm for that?
|
Are there any problems that are hard in the best case? In particular, I was wondering if there are problems that are NP-hard or #P-hard in the best case.
|
I'm having trouble showing that $P\neq R$. Obviously $P\subseteq R$, but is there a decidable language which is definitely not (under all answers to open questions s.t. $P=NP$ or $NP=PSPACE$) in $P$ ?
|
The algorithm is as follows:
a = rand % a random number between 0 and 1
b = a
while b == a
b = rand
end
Here rand is a function that returns a random number, generated uniformly, between 0 and 1. Let us say that this is the MATLAB function rand.
What is the time complexity of this algorithm?
It looks like the bes... |
I've stumbled upon this Question:
We say that a reduction $f$ of a language $A$ to a language $B$ is a Shorten length reduction, if there exists a number $ n\in N $ s.t for every
$ w\in A $, s.t if $ |w| \geq n \ than \ |f(w)| < |w| $. Also, $A,B \notin \{\Sigma^*,\emptyset \} $. Prove there is such a reduction whi... |
Is there a reasonably efficient algorithm for the following task?
Input: a point $x \in \mathbb{R}^d$; a convex polytope $\mathcal{C} \subseteq \mathbb{R}^d$
Find: a point $y \in \mathcal{C}$ that is as close to $x$ as possible
Assume that $\mathcal{C}$ is specified by a collection of linear inequalities, that the dime... |
There's a problem called Cutting Sticks - we start with one stick and n points where it needs to be cut. Cutting a stick costs the length of that stick. Of course, we want to minimize the toal cost.
Example:
There's a stick of length 100, with cutting points at 25, 50 and 80 (so n = 3).
Consider two ways to cut it.
The... |
If I split my data properly into 75% train, 15% test, and 15% validation, and there are over 100,000 samples, is it appropriate for me to train 100s of neural networks then select only a couple based on their testing set grades for publication in a research article?
The question is for neural network training in which... |
The quickest algorithm for solving subset sum currently is $2^{n/2}$ (via Wiki). Why doesn't this violate the Exponential Time Hypothesis which states that “there is no family of algorithms that can solve 3-SAT in $2^{o(n)}$ time.”
Couldn't a 3-SAT problem be translated to a subset sum problem in polynomial time and t... |
The following is pseudo code and I need to turn it into a a recurrence relation that would possibly have either an arithmetic, geometric or harmonic series.
Pseudo code is below.
I have so far T(n) = T(n-5) + c
|
I have a greedy algorithm that I suspect might be correct, but I'm not sure. How do I check whether it is correct? What are the techniques to use for proving a greedy algorithm correct? Are there common patterns or techniques?
I'm hoping this will become a reference question that can be used to point beginners to; h... |
which option is correct? please explain why other are wrong if any one is correct
|
There is an array with $n$ places. There is a stream of $n$ unique numbers that arrive at a random order (permutation selected uniformly at random).
Whenever a number arrives, we must put it somewhere in the array, and we are not allowed to move it later. The goal is to have as many numbers as possible (in expectation)... |
NP is a complexity class that represents the set of all decision problems for which the instances where the answer is "yes" have proofs that can be verified in polynomial time. But hamiltonian path can also be deduced by recursively traversing dfs.
|
I was reading that system f-sub (polymorphic lambda calculus with sub-typing) and I was quite confused with its one checking rule called "T-TAPP".
This rule as following (ctx denotes the typing context)
ctx |- t1 : ∀X<:T11. T12 , ctx |- T2<:T11
-----------------------------------------------
ctx... |
$\Sigma = \{0, 1\}$
$L = \{x$| $x \in \Sigma^* $ $\&$ $ \#_0(x) = 3$ $or$ $ \#_1(x) = 3 \}$
What is the regular expression of this language?
At first I thought $r = (0+1)^*0(0+1)^*0(0+1)^*0$ $ or$ $ $ $r = (0+1)^*1(0+1)^*1(0+1)^*1$
And what is it's corresponding NFA/DFA?
I've been puzzled by this language and if it's... |
What exactly are we doing from a CS perspective when we solve a recurrence relation and find a resulting formula for a sequence given a set of initial conditions? I just went through the "linear homogeneous recurrence relations of degree k with constant coefficients" bit in discrete math and basically understand the ma... |
Good day,
Please consider the following problem:
3 friends named Alice, Bob and Cindy have 3 food items (cheese, tomato, bread) in the fridge.
Each person has a particular numerical preference score (any positive number) for each food item.
It has been agreed upon that each person should take one and exactly one food... |
I am really confused with this problem.
Here's the problem:
You have $N$ points numbered $1$ through $N$,inclusive, and $N$ arrows again numbered $1$ through $N$,inclusive. No two arrows start at the same place, but multiple arrows can point to the same place and arrows can start and end in the same place. The arrow f... |
I've been learning master theorem in school now and have learnt how to apply it to a number of recurrence relations. However one of my assignments has the following recurrence relation:
T(n) = T(n-2) + n^2
Am I wrong in thinking that I cannot apply Master Theorem to this equation? If it can be applied, I am unsure how,... |
I am just watching this lecture Computer Organization - Introduction And Basics where
the lecturer mentions about using a simple code to demonstrate how memory denial of service can be simulated in DRAM by exploiting an optimzation DRAM Controller does internally. The optimization seems to be that DRAM Controller serve... |
I'm currently reading Computational Complexity: A Modern Approach. In this book, they give a proof of a universal Turing machine $U$ such that if $M(x)$ runs in $T$ steps, then $U(\lfloor M \rfloor, x)$ runs in $CT \log T$ steps where $C$ depends only on $M$'s alphabet size, number of tapes, and number of states. I'll ... |
I was reading Knuth's paper "On The Translation of Languages from Left to Right", my particular interest being on RL($k$) languages (not a typo). By the end of the paper, he puts the grammar:
$$
S \rightarrow Ac
\\
S \rightarrow B
\\
A \rightarrow aAbb
\\
A \rightarrow abb
\\
B \rightarrow aBb
\\
B \rightarrow ab
$$
W... |
Given this definition:
The set $\Sigma^*$ of strings over the alphabet $\Sigma$ is defined recursively by:
BASIS STEP: $\lambda \in \Sigma^*$ (where $\lambda$ is the empty string)
RECURSIVE STEP: If $w \in \Sigma^*$ and $x \in \Sigma$ then $wx \in \Sigma^*$
My understanding of this is that the subset $\Sigma^*$ w... |
Consider the following game (see also this question):
One day a castle is attacked at sunrise (by surprise) by n soldiers.
Each soldier carries a canon and a rifle.
The castle has strength s.
On the first day each soldier shoots his canon at the castle costing the castle n strength points (i.e. the castle ends the firs... |
Recently, plenty of researchers are looking at designing efficient data-oblivious algorithms. Roughly speaking, an algorithm is said to be data-oblivious if its data access patterns are independent of the input i.e. the data access pattern of the algorithm does not leak any information about the input of the algorithm.... |
Given an input string, not necessarily a palindrome, compute the number of swaps necessary to transform the string into a palindrome. By swap we mean reversing the order of two adjacent symbols (UVA 10716). I've found an AC solution with the following greedy algorithm (from UVA board): "For each letter find it's first ... |
I came across a question which asked how sorting would help in searching for counterexamples to the conjecture that $$u^6 + v^6 + w^6 + x^6 + y^6 = z^6$$ has no non trivial solutions in integers.
The answer said to make two files containing values of $u^6 + v^6 + w^6 \pmod W$ and $z^6 - y^6 - x^6 \pmod W$. $W$ is the w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.