## real analysis – Maximum or minimum point of a vetor valued function.

We know that a a point of maximum or minimum of a real-valued function can be defined. Is there some notion of maximum or minimum of a vector-valued function? For example, if $$f:(0,1)tomathbb{R}^n$$ defined by $$f(t)=(f_1(t),f_2(t))$$ where $$f_i:(0,1)tomathbb{R}$$ are given functions for $$i=1,2$$.

Thanks.

## Is the maximum and minimum values in the application of derivatives chapter the same as the extreme value theorem

I just ordered Stewart calculus and its on the way.I’m comparing it to george F simmons calculus with analytic geometry he mentions the extreme value theorem and i didn’t quite understand it so I was wondering if its the same thing as in stewarts book on the chapter on applications of derivatives maximum and minimum values and also if anyone has a copy does he explain the extreme value theorem itself

## Minimum of two floating-point numbers

I’m learning C and I just had the exercise to write a function that checks for the lower one of two floating-points.
So I thought, I either could use pointer and also return the pointer of the lower value – otherwise, I simply could use the values and return the lower value.

``````double* pointer_min_value(double* first, double* second){
return *first > *second ? second : first;
}

double calc_min_value(double first, double second){
return first > second ? second : first;
}

int main() {
printf("Enter two numbers to define the minimum!n");

double first, second;
scanf("%lf%lf", &first, &second);

printf("The lower value is %lf", *pointer_min_value(&first, &second));
printf("The lower value is %lf", calc_min_value(first, second));

return 0;
}
``````

they both work, but what would make more sense? should I use pointer only if I want to change the value (I mean, I should not change any of the parameters in a "get me the lowest number"-funtion), or would it be better in any other view (resources, performance,…).

## linear algebra – minimum number of moves required to convert a given into a lucky number

You are given a number, at a time either you can increase a number by 1 or decrease by 1 it is considered as one move find the minimum number of moves required to convert a given into a lucky number. A number is called lucky if all the digits in it are even.

I tried writting the code but it is not working. When number is 100. Can anyone help me out in this?

``````#include<bits/stdc++.h>
using namespace std;

int count(int n)
{
int count = 0;
while (n != 0)
{
n = n / 10;
++count;
}
return count;
}

int firstDigit(int n)
{
// Remove last digit from number
// till only one digit is left
while (n >= 10)
n /= 10;

// return the first digit
return n;
}

int main()
{
int n;
cin >> n;

int i,j,ans=0;

int x = count(n);

while(x--)
{
if(firstDigit(n)%2 != 0)
{
if(firstDigit(n) == 9)
{
ans = ans + pow(10,x);
n = n-pow(10,x);
}

else
{
ans = ans + pow(10,x);
n = n + pow(10,x);
}
}

else
n = n - pow(10,x);

}

cout << ans << endl;

}
``````

## nt.number theory – Minimum number of generators for quotints of congruence subgroups of SL(2, Z)

For a given positive integer $$N$$ let $$L(N)$$ denote the principal congruence subgroup of $$SL(2, mathbb{Z})$$ of level $$N$$. It is known that $$L(N)$$ is a finitely generated free group. Let $$T(N)$$ denote the minimum number of generators. Let $$r$$ be a number strictly less than $$T(N)$$.

Question: Is there a CONGRUENCE subgroup $$L$$ of $$L(N)$$ such that the minimum number of generators of $$L(N)/L$$ is at least $$r$$?

## Web Standard for minimum size of touch icons

Microsoft put together some UI guidelines for designing their Windows 8 store apps. These could apply to any touch based UI.

Take a look at the section Touch, Commanding, and Controls beginning on page 65

Windows 8 User Experience Guidelines:
http://msdn.microsoft.com/en-us/library/windows/apps/hh465424.aspx

In particular relating to minimum sizes for touch see page 74-75

People often blame themselves for having “fat fingers.” But even baby
fingers are wider than most touch targets. The image on the left shows
that the width of the average adult finger is about 11 millimeters
(mm) wide, while a baby’s is 8 mm, and some basketball players have
fingers wider than 19 mm!

.

7×7 mm: Recommended minimum size 7×7 mm is a good minimum size if
touching the wrong target can be corrected in one or two gestures or
within five seconds. Padding between targets is just as important as
target size.

When accuracy matters Close, delete, and other actions
with severe consequences can’t afford accidental taps. Use 9×9 mm
targets if touching the wrong target requires more than two gestures,
five seconds, or a major context change to correct.

When it just
doesn’t fit
If you find yourself cramming things to fit, it’s okay to
use 5×5 mm targets as long as touching the wrong target can be
corrected with one gesture. Using 2 mm of padding between targets is
extremely important in this case.

## healing – Minimum Difficulty for Mother’s Touch?

Mother’s touch has a sliding difficulty, which uses the current rage, as shown here:

The player spends one Gnosis point and rolls
Intelligence + Empathy (difficulty is the target’s current
Rage, or 5 for those with no Rage). Each success heals one
level of lethal, bashing, or aggravated damage. 1

Now, let’s assume the pack’s healer picks up the totally de-raged Ahroun after the battle (or in the battle) for a heal. The current rage of the Ahroun is 0, but he has a Rage-stat. So it is not against a difficulty of 5, which is for healing a Coyote or Kinfolk or anything else without Rage. But there can’t be a 0 difficulty… what is the difficulty now?!

A similar problem would be 1 Rage left because 1 is still the automatic failure/cancel a success number on a d10 under the system.

1. W20 Core, p. 164

## algorithms – HackerRank August 2021 Coding Challenge – Minimum Time Needed to Finish All Tasks

I was doing the HackerRank Coding Challenge and ran into this problem. I thought through it a bit but wasn’t able to come up with a concrete solution, and going through the solution was not very helpful as I don’t understand the reasoning behind it. Here is the prompt:

The computing cluster has multiple processors, each with 4 cores. The number of tasks to handle is equal to the total number of cores in the cluster. Each task has a predicted execution time and each processor has a specified time when its core becomes available. Assuming that exactly 4 tasks are assigned to each processor and those tasks run independently(asynchronously) on the cores of the chosen processor, what is the earliest time that all tasks can be processed.

Example

n = 2

processorTime = (8, 10)

taskTime = (2, 2, 3, 1, 8, 7, 4, 5)

One optimal solution is as follows:

Assign the tasks with the execution times 2, 3, 7, and 8 to processor 0 that start at time 8.

Assign the tasks with the execution times 4, 2, 5, and 1 to processor 1 that start at time 10.

The first processor’s cores finish at times (8+2), (8+3), (8+7), and (8+8), which are 10, 11, 15, and 16 respectively.

The second processor’s cores finish at times (10+4), (10+2), (10+5), and (10+1), which are 14, 12, 15, and 11 respectively.

The maximum among those finishing times is 16. This is the earliest possible finish time.

Function Description

Complete the function minTime in the editor below.

minTime has the following parameter(s):

int processorTime(n): each processorTime(i) denotes the time at which all 4 cores of the ith processor become available

Returns

int: the earliest time at which all the tasks can be finished

``````public static int minTime(List<Integer> processorTime, List<Integer> taskTime) {

Collections.sort(processorTime);
int result = 0;
for(int proctime : processorTime){
for(int i=0; i<4 ; ++i){
result = result > completionTime ? result : completionTime;
}
}
return result;
``````

My initial thought was to group the tasks for each processor in a way so that their sums would be as close to each other as possible. This way, they all finish at around the same time, and this way, it prevents the scenario of a processor finishing all it’s tasks super early and then having to wait for another processor to finish all the tasks.

Clearly, that is not what the solution entails. Can someone explain the logic behind the solution?

## algorithms – Need help with a Minimum Window problem using the python language. Only the min_window function needs fixing

The “contains”function is used to determine if a string contains all of the letters a, b, and c. This function works fine.

``````def contains(string):
sub = ("abc")
result = ()
var = "F"
for i in range(len(sub)):
if sub(i) not in string:
result.append("F")
else:
result.append("T")
if var not in result:
return True
else:
return False

def min_window(arr):
start = 0
curr_size = 0
min_size = 1000
final = ""

for end in range(len(arr)):
curr_string = arr(start:end)

while contains(curr_string):
curr_size = end - start + 1
if curr_size < min_size:
min_size = min(curr_size, min_size)
final = curr_string
start += 1
curr_string = arr(start:end)

print(final)

min_window(arr)
```
#the min_window function is used to find the smallest substring within a string that contains the three letters provided. This function seems to have some logical issue.
``````

## java – Print largest odd integer & minimum from user input

Assignment I have asks for user input of integers until ‘0’ is entered. Then these user inputs are used for 4 questions, I’ve correctly answered 2 and the other 2 I’m not getting it correct.
Q1 asks to print the minimum integer the user inputted. My code works for 3/4 test cases, the test case that doesn’t work is when only ‘0’ is entered.
Q2 asks to find the largest odd integer, my code only works for 1 of the test cases and I’m kind of lost by this one.

Test case input 1: 0
Test case input 2: -1 7 5 -9 0
Test case input 3: 6 8 10 20 0 -1 13

``````Scanner scan = new Scanner(System.in);

// initializing
int negNum = 0;
int sum = 0;
int minNum = Integer.MAX_VALUE;
int maxNum = Integer.MIN_VALUE;
int num = 10000;

// while loop asking for user input not equal to 0
while (num != 0) {
num = scan.nextInt();

// finding minimum integer
if (num == 0)
break;
if (minNum > num) {
minNum = num;
}

// finding largest odd integer
if (num %2 != 0) {
if (num > maxNum) {
maxNum = num;
}
else maxNum = 0;
}

// counting negative integers
if (num < 0) {
negNum++;
}

// finding sum of even integers
if (num % 2 == 0) {
sum = sum + num;
}
}
// printing out calculations
System.out.println("The minimum integer is " + minNum );
System.out.println("The largest odd integer in the sequence is " + maxNum );
System.out.println("The count of negative integers in the sequence is " + negNum);
System.out.println("The sum of even integers is " + sum );
``````