Questions tagged [minimum]

Minimum refers to the value in a collection of values that is the least or smallest.

In mathematics, the minimum of a function is the smallest value that the function takes at a point either within a given neighborhood (local or relative minimum) or on the function domain in its entirety (absolute minimum).

Examples

Python

>> import numpy as np
>> np.min([0, 1, 2])
0

See also

1056 questions
6
votes
2 answers

Scala: How to find the minimum of more than 2 elements?

Since the Math.min() function only allows for the use of 2 elements, I was wondering if there is maybe another function which can calculate the minimum of more than 2 elements. Thanks in advance!
6
votes
4 answers

Do floats, doubles, and long doubles have a guaranteed minimum precision?

From my previous question "Is floating point precision mutable or invariant?" I received a response which said, C provides DBL_DIG, DBL_DECIMAL_DIG, and their float and long double counterparts. DBL_DIG indicates the minimum relative decimal …
6
votes
3 answers

Find minimum sum that cannot be formed

Given positive integers from 1 to N where N can go upto 10^9. Some K integers from these given integers are missing. K can be at max 10^5 elements. I need to find the minimum sum that can't be formed from remaining N-K elements in an efficient…
user
  • 91
  • 4
6
votes
5 answers

Get minimum unused value in MySQL column

I have a table with integer ID column. I would like to get the minimum unused value for this column. The query should find the first hole in table IDs and get the minimum value inside it. I'll try to explain it with some examples. Example 1:…
Giorgio
  • 1,940
  • 5
  • 39
  • 64
6
votes
3 answers

Minimum of numbers that are not None in Python

This question is close to mine, but not quite: List minimum in Python with None?. I need to allow for the possibility of all values in the list being None. I have a situation where I have to look up some numbers in a database, and they may either…
user2994322
6
votes
4 answers

Lowest value in range

I would like to find the lowest value in some range. Do I have to iterate array each time or is there any dynamic method? Lets say I have input array: index: 0 1 2 3 4 5 6 7 value: 1 4 6 1 6 7 2 3 and then I have to choose smallest in range < a,b >…
noisy cat
  • 2,865
  • 5
  • 33
  • 51
6
votes
3 answers

Javascript: How can I get a browser's minimum font size?

What is the best way to get a browser's minimum font size? I whipped up the following code, which does a binary search. It works, but I would like to know if there is a standard or more efficient method. function getMinimumFontSize() { var el =…
Robert Bruce
  • 681
  • 1
  • 5
  • 10
6
votes
3 answers

Find n minimum values in an array

I am using Matlab 2012a. I have an array of k cells (say 1000). I need to find the 5 lowest values of this array and need to do an average of those values in X and Y. Anyone has an idea how to do that?
Vissenbot
  • 227
  • 2
  • 5
  • 15
6
votes
2 answers

find all minimum elements of 2 dimensional array in Matlab

Having 2-dimensional array,A, I want to find minimum number in the array. However I can have more than one of that number. How can I find the [row col] of all minimum value? Example: 2 3 4 2 1 6 7 1 9 8 3 1 It should return [2,1] [2,4] [3,4]
Sara
  • 2,308
  • 11
  • 50
  • 76
6
votes
1 answer

NumericUpDown allows user to type a number greater than maximum

I have a NumericUpDown variable in my class. The minimum and maximum values are set as follows: myNumericUpDown.Maximum = 9999; myNumericUpDown.Minimum = 0; This prevents the spin box from exceeding 9999 or going below 0. The problem I am having is…
Jan Tacci
  • 3,131
  • 16
  • 63
  • 83
6
votes
2 answers

Minimum over a sliding window

Is there specific algorithm that allows me to maintain a min/max over a small/medium sized sliding window (typical size is 600, with all elements being integers)? The window is really the last N observations in a stream. So, I add a new observation…
KS1
  • 165
  • 1
  • 10
6
votes
3 answers

How to select the smallest value from a bunch of variables?

Assume I have variables $a, $b, $c and $d which all hold numbers. I would like to get the smallest (largest) value. My typical XSLT 1.0 approach to this is
bitmask
  • 32,434
  • 14
  • 99
  • 159
5
votes
5 answers

GMail forcing TD containing spacer.gif to be 16px high

So I've just lost several hours of my life trying to win this battle, with no luck. In summary, I'm trying to fill a table with three 10px images, but GMail is forcing each cell to be 16px. Here's what I am working with:
Anthony
  • 5,275
  • 11
  • 50
  • 86
5
votes
2 answers

Algorithm to find the global minimal distance between item pairs

The items a-d are to be paired with items 0-3 in such a way that the total distance between all item pairs are minimized. For example, this matrix could describe the distance between each item in the first group and an item in its counterpart…
Björn Lindqvist
  • 19,221
  • 20
  • 87
  • 122
5
votes
2 answers

Select rows of a DataFrame containing minimum of grouping variable in Julia

I'm wondering if there is an efficient way to do the following in Julia: I have a DataFrame of the following form: julia> df1 = DataFrame(var1=["a","a","a","b","b","b","c","c","c"], var2=["p","q","r","p","p","r","q","p","p"], …