Questions tagged [programming]

For mathematical questions related to programming, and questions where a computer-aided solution is strongly suggested. A strong connection with a mathematical topic is needed to make programming questions on-topic.

This should not be the only tag. Consider also using the tags (algorithms), (numerical-methods), or (linear-programming).

717 questions
0
votes
0 answers

How to describe the repetion of a set theoretically.

Consider a computer system that has $m$ number of objects in its memory. Job of the system is to search the specific object. We describe all searchable objects in the memory as a set $\mathscr{A} = \{1,2,3,.....m\}$. So if in first cycle system does…
0
votes
1 answer

How to express this code mathematically?

Any programmer can explain how to express this code in math terms? public static int px32(int p){ int h = 0; for (int i = 0; i < p; i = i + 32) { h++; } return h; }
0
votes
0 answers

Solve a specific number with expressions like (e/e+e/e) with no digits

So this is only for fun really. I'm trying to solve a number with expressions like e/e = 1. This could work for any number really, but I'm trying to solve it only using expressions. I want to do this using programming. Could be Javascript, Python,…
0
votes
0 answers

Construct certain univariate functions over bounded interval having given set of moments

We have a class of probability distributions (parameterized by $\alpha =\frac{1}{2},1,\frac{3}{2},2,\ldots$) over the interval $[-2^{-12} \cdot 3^{-3},2^{-16}]$ having as their $n$-th moments \begin{equation} \frac{2^{-12 n} (2 n)! (\alpha +1)_{2…
-1
votes
2 answers

How to for loop in Math like C?

In C, we can for loop easily. But I don't know how we can loop in Math like C. For example, I want to loop in Math like this C code: int i; int a = 10; for (i = 1; i < 100; i++) { a -= 2; }
sbh
  • 43
-1
votes
1 answer

Max value of bitwise AND over a given range

Given a number X and integer N, give the max value for (X&i) 0<=i<=N. Example: X = 103, N = 50 ans = 44
-2
votes
2 answers

How do I get fraction of x?

let fraction:CGFloat = 1.0 // This is fraction let minValue:CGFloat = 60.0 // This is minimum value where slider starts let maxValue:CGFloat = 240.0 // This is maximum value where slider end let formula = (((maxValue)-(minValue)) * fraction) +…
O-mkar
  • 107
1 2
3