Questions tagged [computer-science]

All mathematical questions about computer science, including theoretical computer science, formal methods, verification, and artificial intelligence. For questions about Turing computability, please use the (computability) tag instead. For numerical analysis, use the (numerical-methods) tag. For questions from scientific computing, use (computational-mathematics).

Computer science is the study of the theory, experimentation, and engineering that form the basics for the design and use of computers. It is the scientific and practical approach to computation and its applications and the systematic study of the feasibility, structure, expression, and mechanization of the methodical procedures (or algorithms) that underlie the acquisition, representation, processing, storage, communication of, and access to information. An alternate, more succinct definition of computer science is the study of automating algorithmic processes that scale.

Some fields of computer science such as computational complexity theory (which explores the fundamental properties of computational and intractable problems) are highly abstract, while fields such as computer graphics emphasize real-world visual applications.

5523 questions
0
votes
1 answer

Difficulty understanding the colorful numbers concept

According to an example (https://algorithms.tutorialhorizon.com/colorful-numbers/) : Given Number : 3245 Output : Colorful Number 3245 can be broken into parts like 3 2 4 5 32 24 45 324 245. this number is a colorful number, since product of every…
0
votes
2 answers

Why does conversion from base happen to base 10 naturally for any base?

Let's take number 11 in base(2) which is 3 in base(10). If we try to convert this to base 10 using the power and positions, $$ (1 * 2^1) + (1 * 2^0) = 3 $$ Why is it automatically represented to base 10?
sidoshi
  • 103
0
votes
1 answer

Is this a deterministic pushdown automata?

So I try to build a deterministic pushdown automata. I am not sure whether this is automata is indeed deterministic though. In this case, $e$ denotes the empty word. I need to seperate the amount of $a$'s I choose, but since the automata needs to…
Julian
  • 1,401
0
votes
1 answer

How is is possible that $-9 \bmod 4 = -1$ or $-9 \bmod 4 = 3$?

How is is possible that $-9 \bmod 4 = -1$ or $-9 \bmod 4 = 3$? How it can be possible that the remainder has these two alternatives? Particularly this is in computer languages, where Java produces $-1$ and e.g. C++ doesn't decide between $3$ or…
mavavilj
  • 7,270
0
votes
1 answer

Given a hue value from 0 to 1, is there a formula to find the true complement of that color?

Traditionally, when calculating an HSV color's complement, a "quick and dirty" solution is to simply take the color's hue value and go half way around the color wheel. In most cases this strategy leads to a fairly close approximation of the color's…
0
votes
1 answer

Show that $L_2 = \{\phi(z) | z \in L_2\}$ is a regular language

Assume that $L_1$ is a regular language over the alphabet $\Sigma$. The function $\phi: \Sigma^* \rightarrow \Sigma^*$ cancels every second symbol, so for example $\phi(z_1z_2z_3z_4) = z_1z_3.$ Show that $L_2 = \{\phi(z) | z \in L_1\}$ is regular…
Julian
  • 1,401
0
votes
1 answer

Given a byte in 2’s complement What is 0x56 in decimal?

a) -13 b) -110 c) 38 d) none of the above Im not sure on how to do this question. What I have done so far is convert the hexadecimal number into a decimal, but since it's already in 2's complement, how do I know the sign?
JVAN
  • 167
  • 1
  • 4
0
votes
1 answer

Partial ordering set subset relation

Hi I am a newbie with poset partial order sets, can anyone help with below. If P consists of all subsets of {1,2,3,4} How may edges does the cover graph of the poset P, C have? C is the subset relation A C B If A is a subset of B I know I have to…
0
votes
1 answer

Calculating Mbps based on duration and filesize

Let's say I download a file that is 3500 bytes in 2401 milliseconds. What is the calculation to work out Internet speed? I ask because I'm developing a piece of software that does just this to make a guess at the users current internet speed. My…
0
votes
0 answers

number array partition

Question : If somehow I partition a number array into two sets and their difference in sum is $1$ . Can confirm that the minimum possible difference in sums that can be attained by partitioning the array optimally into two sets is actually $1$? (say…
Sathyaram
  • 173
0
votes
1 answer

Demonstrate if a language is regular

The problem is to demonstrate the regularity of the following language: {xy ∈ {a,b}* | |X|a = 2|Y|b} which refers to words of the form xy where the number of occurrences of a in subword x is twice the number of occurrences of b in subword y. I…
Paul94
  • 1
0
votes
4 answers

Changing the base of an exponential function

I don't follow the last step mentioned in the answer to this post Why is does this hold? $$n^{k^2\log n}=2^{k^2\log^2n}$$ I would have posted this question as a comment on the post, but apparently I don't have enough reputation points to do that...
0
votes
1 answer

Calculating Function

$$f(x) = \sum_{i=1}^x\prod_{j=1}^ix$$ find $f(N)$mod $25602017$ $(1 \leq N \leq 10^{18})$ N and 25602017 is relative prime I' calculate that $$g(N)=\frac{x(x^x-1)}{x-1}$$ I'm use divide and conquer from $$ g(N)$$ to calculate $$x^x$$ in…
0
votes
0 answers

Data structures

The queue we are considering will have the following three stages. Stage 1 : The queue will not start dequeuing items till it collect 2000 data points. Stage 2 : Once the 2000 data points are collected the queue will enqueue twice as fast as data is…
0
votes
2 answers

Showing a function is not computable (complexity)

Let f be a function that for a given (TM encoding) returns the rightmost cell visited by M when running on epsilon, f will return infinity if there's no such index. I need to show that f is not computable. If f would have been computable, it could…