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
5
votes
1 answer

how to get the smallest ocamlopt compiled native binary?

I was quite surprised to see that even a simple program like: print_string "Hello world !\n"; when statically compiled to native code through ocamlopt with some quite aggressive options (using musl), would still be around ~190KB on my system. $…
vaab
  • 9,685
  • 7
  • 55
  • 60
5
votes
1 answer

Computing the minimum value for each row in a Pandas DataFrame

I have this DataFrame df: A B C D 1 3 2 1 3 4 1 2 4 6 3 2 5 4 5 6 I would like to add a column that calculates the minimum values, by slicing columns A to D (the actual df is larger, so I need to slice it)…
zaydar
  • 161
  • 1
  • 3
  • 7
5
votes
1 answer

create a data frame based on the minimum value of two data frames pandas python

I have two data frames with different sizes. I want to replace the values of the first data frame by the values of the second data frame only if the values of the second data frame are less than the values of the first data frame. In other words I…
Mary
  • 163
  • 10
5
votes
3 answers

Minimum in non-empty, finite set

With the following definitions I want to prove lemma without_P Variable n : nat. Definition mnnat := {m : nat | m < n}. Variable f : mnnat -> nat. Lemma without_P : (exists x : mnnat, True) -> (exists x, forall y, f x <= f y). Lemma without_P…
Alexander Boll
  • 228
  • 1
  • 7
5
votes
3 answers

Finding minimum values of (properties of ) collections in C#

Given the following code from a Microsoft example: public class EngineMeasurementCollection : Collection { public EngineMeasurementCollection() { Add(new EngineMeasurement { Speed = 1000, Torque = 100, Power = 20…
Dave
  • 8,095
  • 14
  • 56
  • 99
5
votes
2 answers

How do I implement minimum with foldr (or foldMap)?

I want to implement minimum with foldr or foldMap. According to the exercise, it should have this definition: mini :: (Foldable t, Ord a) => t a -> Maybe a -- named "mini" to avoid name clash It sounded pretty straightforward, but I do not know…
The Unfun Cat
  • 29,987
  • 31
  • 114
  • 156
5
votes
2 answers

Minimum contiguous sum that can be obtained by performing at most K swaps

I have this homework: Given an array consisting of N integers, you are required to print the minimum contiguous sum that can be obtained by performing at most K swaps. During a swap any 2 elements of the given array could be swapped. I tried…
Sneha Reddy
  • 61
  • 1
  • 3
5
votes
1 answer

Gnuplot: how to plot max and /or min value

How can I show the max. and/or the min. value(s) of of a graph in a plot at their appropriate position automatically?
Genschman
  • 177
  • 1
  • 1
  • 11
5
votes
2 answers

Finding the minimum value of a 2-3-4 tree

First off, this question isn't homework. I'm currently reading the book "Data Structures and Algorithms 2nd Edition" by Robert Lafore. In chapter 10, we learned about 2-3-4 trees and are then asked to write a method to find the minimum value in said…
Alex
  • 2,145
  • 6
  • 36
  • 72
5
votes
7 answers

C Macro for minimum of two numbers

I want to make a simple macro with #define for returning the smaller of two numbers. How can i do this in C ? Suggest some ideas, and see if you can make it more obfuscated too.
VaioIsBorn
  • 7,683
  • 9
  • 31
  • 28
5
votes
2 answers

Java8: select min value from specific field of the objects in a list

Suppose to have a class Obj class Obj{ int field; } and that you have a list of Obj instances, i.e. List lst. Now, how can I find in Java8 the minimum value of the int fields field from the objects in list lst?
mat_boy
  • 12,998
  • 22
  • 72
  • 116
5
votes
3 answers

generate 3-d random points with minimum distance between each of them?

there. I am going to generate 10^6 random points in matlab with this particular characters. the points should be inside a sphere with radious 25, the are 3-D so we have x, y, z or r, theta, phi. there is a minimum distance between each…
Sahar P.H.Z
  • 53
  • 1
  • 4
5
votes
5 answers

How to get lowest 3 elements in an int array

Hi I want to get the lowest 3 elements of an array. By lowest I mean the minimum value. I cannot use the collections.Sort method as I need to know the index of the elements. Therefore I am using the following code to get the lowest, but I need to…
M9A
  • 3,168
  • 14
  • 51
  • 79
5
votes
1 answer

Minimum set of vertices that allow reaching all other vertices in max. one edge

this is probably a stupid question, but what is the canonical problem that asks for the minimum set of vertices out of a graph, so that from these vertices, all other vertices can be reached by "traveling" no more than one edge? The real-life…
user1769925
  • 588
  • 1
  • 6
  • 15
5
votes
5 answers

Creating number pattern with minimum for loops

How to create the following number pattern with minimum for loops. Is there any names given mathematically for the pattern of numbers as like Fibonacci, pascal's triangle, any-other interesting patterns which are complicated but possible using…
Rand Mate
  • 453
  • 3
  • 8
  • 14