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

Calculating the minimum element in an array

I've written a little program to determine the minimum element in an array a[]. When I debug, the program seems to be working fine initially but then the for loop in the min() function stops execution after two steps, despite the array being of size…
Luke Collins
  • 1,433
  • 3
  • 18
  • 36
-2
votes
2 answers

How can I return the index of the minimum integer in an array?

I'm returning the index of the smallest integer in an array. I found a solution from this forum. Here is what I did: require 'amatch' include Amatch ingredients_arr = [ "All purpose", "Ammoniaco", "Assorted sprinkles", "Baking Powder", "Baking…
Jo Den
  • 23
  • 6
-2
votes
4 answers

finding the minimum of an array

I'm trying to find the minimum of an array with ten inputted points, but I somehow have managed to create something that will only find the maximum. Help? import java.util.Scanner; public class Ex7_9Smallestt { public static void main(String[]…
-2
votes
2 answers

How to find the smallest number in each line of numbers? Without using min()

So I need to find the smallest number for each row in this file which contains these numbers: 6,3,5 4,4,8 3,7,2 1,8,9 9,0,6 How would I be able to sort through each row to find the smallest number without using the built in min() or importing…
HEY
  • 23
  • 6
-2
votes
3 answers

Finding the 5 smallest numbers from a list in Python

I have a list of names,x, and a list of scores,y, that correspond to the names. x = {a,b,c,d,e,f,g,h,i,j,k} y= {8,8,15,13,12,17,18,12,14,14} So, a has score 8, b has scores 8, c has score 15, ..., k has score 14 I want to find the 5 smallest…
Mike El Jackson
  • 771
  • 3
  • 14
  • 23
-2
votes
1 answer

minimum of all rows maximum in matrix

I have to find the minimum of every row's maximum in matrix. And then print the row which contains that element. Why it cannot be done like this ? for(i=0; imax) …
-2
votes
2 answers

R: Get the row and column name of the minimum element of a matrix but with minimum != 0

I've got a matrix with a lot of zeros and with positive numerical values. I want to get the row and column number for which the element is the minimal NONZERO value of the matrix. I don't find that min() has extra options to exclude zero, so how…
Silke
  • 177
  • 1
  • 11
-2
votes
1 answer

Min/max of arbitrary type T in C++11

Is there a way to assign a variable of arbitrary type T it's minimum or maximum value? template void setMax(T& var){ var=MAXIMUM_OF_TYPE_T; //can this be done? } T toBeMaxed; setMax(toBeMaxed); In case that T was int, I could as well…
Slazer
  • 4,750
  • 7
  • 33
  • 60
-3
votes
1 answer

Using forEach to find the minimum number

How do I find the lowest number in array using the forEach function in javascript? Here is an example: let arr = [10, 122, 673, 37, 85, 119, 10]; How would I use forEach to find the minimum number (in this case 10) in arr?
-3
votes
1 answer

Minimum Path method but indoor

I have a question. I would like to calculate the minimum path from a point. These points are inside a building. The problem is that the place where these points are present is indoors, so I don't know how to do it. I have attached a photo. The…
-3
votes
1 answer

How to find minimum value in std::map?

I am trying to get the minimum value in a std::map. I have a function which is from Finding minimum value in a map #import tool.mm std::map direction; std::pair min; direction["up"] = 50.0; direction["down"]…
Cristian
  • 495
  • 2
  • 9
  • 35
-3
votes
2 answers

Minimum steps to one Python

I've tried this code but it does not work and results with 0. I've known the recursive one, but I'm trying to do it using for loop. def minsteps(n): memo =[0]*(n+1) memo[0] = 0 memo[1] = 0 for i in range(2,n,1): r =…
J.Doe
  • 71
  • 2
  • 9
-3
votes
1 answer

Minimum value of group of numbers in variable

I am trying to find the minimum pressure by a specific storm id and assign that a value of one. I tried using a nested for loop with an if statement, but this is not working. Below is my code, and if you could help out, that would be great!…
runnere127
  • 21
  • 3
-3
votes
2 answers

Finding min in a stack- Won't print out any result

Trying to find the min for this stack; however, whenever I run this in JSFiddle nothing prints out... anyone explain to me why? here's the code: function min_stack() { var min = 0; this.elements = []; this.push = function(element) { …
girlrockingguna
  • 291
  • 1
  • 3
  • 13
-4
votes
1 answer

Minimum of an array using recursion. How does this work?

Please can someone explain how does the code below work? int minElement(int arr[], int n) { if(n == 1) return arr[0]; else { int m = minElement(arr, n-1); if(m < arr[n-1]) return m; else …
Alex Csillag
  • 111
  • 1
  • 1
  • 6
1 2 3
70
71