Questions tagged [discrete-mathematics]

NOTE: Only questions about software development related to discrete mathematics are on topic. Discrete mathematics is the branch of mathematics concerned with discrete phenomena – as opposed to continuous phenomena like geometry, real analysis, physics, etc. Typical discrete math topics are discrete probability, combinatorics, graph theory, algorithms and complexity, but also matrices, difference equations, recurrences.

Discrete mathematics is the branch of mathematics concerned with discrete phenomena – as opposed to continuous phenomena such as geometry, real analysis, and physics. Typical discrete math topics are discrete probability, combinatorics, graph theory, algorithms, and complexity, but also matrices, difference equations, and recurrences. Applications abound in computer science, as many computer models are built upon discrete elements.

Questions relating to discrete mathematics must still be programming-related. Questions that are not programming-related may be asked on mathematics.stackexchange.com.

1083 questions
-4
votes
1 answer

if f(n) = 2n^2 and g(n) = 1.01^n. Is f(n) = O(g(n))? Is f(n) = Ω(g(n))?

Let f(n) = 2n^2 and g(n) = 1.01^n. Is f(n) = O(g(n))? Is f(n) = Ω(g(n))? Justify your answers with a proof.
-4
votes
1 answer

Turning A premise into Code?

I have this assignment that requires me to turn a premise statement into code. The idea is that i need to print out the truth table for a premise statement. This is the premise: (((P v Q) ^ (Q -> R)) XOR (P v R)) <-> (R ^ Q) I can create a manual…
-4
votes
1 answer

Direct proof sequence of n length

We denote a(n) as the number of sequence of n values of 0,1 and 2 where the value 0 can't be next to another 0 in the sequence. For example, we can have (0,1,0,2), but not (0,0,2,1) Prove by direct proof that a(n) = 2a(n-1) + 2a(n-2) for n ≥ 3
user2420374
  • 147
  • 2
  • 2
  • 13
-4
votes
2 answers

For binomial function nCr=k, given r and k find n

I need a function that can solve the following: for a binomial function nCr=k, given r and k find n. in mathematics nCr=n!/r!(n-r)! I tried following but it doesn't solve it. for example 8C6=28, for my function the inputs are 6 and 28 and i want…
-4
votes
1 answer

Does sin n have a maximum value for natural number n?

In formal, does there exist such that for all ?
xskxzr
  • 12,442
  • 12
  • 37
  • 77
-4
votes
1 answer

distinguishable objects in distinguishable boxes except one box remains empty

My professor told our class the answer to the question but I am looking for an explanation to help further understand this concept. The question is: Suppose that n balls are placed into n boxes. Calculate the number fo different possible results if…
-4
votes
1 answer

Find the smallest number have 3 integer roots?

java question Find the smallest number x, such that x > 1, and Square Roots , Cube root and Fifth Roots are all integers?? i tried this code in java, but no result ? int i = 1; while (true) { i++; if (Math.pow(i, 1.0 / 2) % 1…
-4
votes
2 answers

Give a Regular Language L

Give a regular grammar for L= {a^n b^n : n<=100} I would do something like this : s---> A | empty string A---> aB| empty String b---> Ab but How do we keep count of the number in the grammar? meaning How does it know when there are more that 100…
-5
votes
1 answer

in java How to use arithmatic statements like sum or subtract on the Strings that have numbers and + and - and space char in it?

i have a string that has sum numbers and space and som '+'and'-' characters between them .i want to now How can summand and subtract them.!! like String s="25+14-13+225-16"; and i want to output to be =235
AM GR
  • 1
  • 1
-5
votes
1 answer

Bidirected search on permutations in Java

The concept of a permutation has numerous applications in computer science, for example, in the analysis of sorting algorithms and in implementations of distributed systems. Formally, a permutation is a bijection from a set onto itself. For…
user10937201
-5
votes
1 answer

When does the loop terminate in the program because it always has a positive value?

long long fast_exp(long long int base,long long int exp,int p) { int res=1; while(exp>0) { if(exp%2==1) {res=(res*base)%p;} exp=exp>>1; base=(base*base)%p; } return res; } It is a function of modular exponentiation. I want to ask about this while…
kk_00
  • 11
  • 4
-5
votes
1 answer

Which of the following arithmetic expressions is identical to the expression a += b * c

A - Which of the following arithmetic expressions is identical to the expression a += b * c ? a = (a + b) * c a = b * c a = a + b * c a = ++b * c None of the above B - Which of these following expressions is wrong…
-5
votes
2 answers

Variable type for precise calculations (JAVA)

What is the best type variable for more precise calculations? I've used double in BigDecimal and were not accurate.
Jose Vieira Neto
  • 131
  • 1
  • 1
  • 8
-5
votes
2 answers

prove that graph G=(V,E) has at least |v|-|E| components

Prove that graph G=(V,E) has at least |v|-|E| components I need answer for above question with example and full description.
-6
votes
3 answers

A hard Question?

I try To find a solution to a question .... we have a number , example : 20 ... and we have 6 number :{ a ,b , c , d , e , f} < 20 , t try to find all values of these numbers , but only if we can combinate (whit + or -) whit 2 of this numbers and…
user336671
  • 341
  • 2
  • 5
  • 9
1 2 3
72
73