Problem Detail: Let $$f(x)=begin{cases} x quad text{if Goldbach’s conjecture is true } 0 quad text{otherwise}end{cases}$$ Show that f(x) is primitive recursive. I know a primitive recursive function is obtained by composition or recursion, but I don’t know what should I Read More …
Category: Uncategorized
[Solved]: Prove finding a near clique is NP-complete
Problem Detail: An undirected graph is a near clique if adding an additional edge would make it a clique. Formally, a graph $G = (V,E)$ contains a near clique of size $k$ where $k$ is a positive integer in $G$ if Read More …
[Solved]: Showing that the pumping lemma cannot prove that some language is not regular
Problem Detail: I have this language $ L = a^* cup left { a^mb^n|m>ngeq 0 right }^* $ I have to prove that this language is not regular but still satisfies the pumping lemma for regular languages (Since the pumping lemma Read More …
[Solved]: DFA that recognizes 0 in every odd position
Problem Detail: I had a question that asked for the DFA that accepts the following language: {w | every odd position of w is a 0 } Should this DFA accept the empty string, since it doesn’t have an odd position? Read More …
[Solved]: Algorithm Complexity Analysis on functional programming language implementations
Problem Detail: I’ve learned today that algorithm analysis differs based on computational model. It is something I’ve never thought about or heard of. An example given to me, that illustrated it further, by User @chi was: E.g. consider the task: given Read More …
[Solved]: How does CPU actually retrieve data from memory when you call a variable in a programming language?
Problem Detail: As I have understood from all the internet sources I can get to, when you declare and initialize a variable in java, you are allocating this data, say an 8-byte float, in a particular memory cell in the RAM, Read More …
[Solved]: baz_num_elts exercise from Software Foundations
Problem Detail: I’m at the following exercise in Software Foundations: (** **** Exercise: 2 stars (baz_num_elts) *) (** Consider the following inductive definition: *) Inductive baz : Type := | x : baz -> baz | y : baz -> bool Read More …
[Solved]: How to obtain a trilateration ordering in a graph?
Problem Detail: In a sensor network graph $G = (V,E)$ $V = {1,2,…,n}$ is the set of sensors and the edge $(i,j)$ denotes that sensor $i$ and sensor $j$ are inside each other’s sensing range. The weight of that edge denotes Read More …
[Solved]: Can you reduce a precedence graph or do *all* relevant nodes need to be connected
Problem Detail: Let’s say we have the following simple transaction-schedule: T1 | T2 | T3 —–+——+—– w(x)| | | w(x) | | | w(x) T1 comes before T2, so in the precedence graph, we draw an arrow from T1 to T2. Read More …
[Solved]: How to reduce from subset-sum problem?
Problem Detail: I have this problem which is described as follows: Input: You are given a multi-set $M$ (a set that can contain duplicates), and two numbers $P$ and $T$. $M = {(x_1,y_1), (x_2,y_2), …, (x_n,y_n)}$. Each $x$ and $y$ is Read More …