Number of Growing Functions in [1,n] -> [1,n]: n^2-1

  • Thread starter kezman
  • Start date
for n=2f1: f1(1)=1 f1(2)=1f2: f2(1)=1 f2(2)=2f3: f3(1)=1 f3(2)=3f4: f4(1)=2 f4(2)=2f5: f5(1)=2 f5(2)=3f6: f6(1)=3 f6(2)=3for n=3f1: f1(1)=1 f1(2)=1 f1(3)=1f2: f2(1)=1 f2(2)=1 f2(3)=2
  • #1
kezman
37
0
How many x < y => f(x) < f(y) or f(x) = f(y) functions ("growing functions")are in [1,n] -> [1,n]?

my result was (n-1)n^2 but I am not sure if its correct.
 
Physics news on Phys.org
  • #2
No, that's way off. How did you come up with that, because it doesn't work for n = 1, 2, 3, i.e. small values of n that you could have checked for yourself? In fact, it doesn't work for any n. The way I found the answer was to find a correspondence between the set of functions in question, and the a special set of paths on the grid where each step in the path is either a move some whole number of spaces to the right or some whole number of spaces up.

For example, when n = 2, there are 3 such functions:

f1: 1 -> 1; 2 -> 1
f2: 1 -> 1; 2 -> 2
f3: 1 -> 2; 2 -> 2

I related f1 to the path that starts at the origin (0,0), and then moves right, up, up. I related f2 to the path that goes right, up, right, up. I related f3 to the path that goes right, right, up, up. If you want to solve it my way, then:

1) figure out how I'm relating these functions to these paths, and see generalize it for n > 2 (note that each function should correspond to a unique path, i.e. no two functions should correspond to the same path)
2) figure out some common trait that all of these paths have, that no other paths have
3) given some n, count the number of paths that have this trait
 
Last edited:
  • #3
you are right I tested that formula for with 2 results after n>2

until now i have

3 with n=2
18 with n=3
48 with n=4

but I still can't find a correct answer.
 
  • #4
kezman said:
you are right I tested that formula for with 2 results after n>2

until now i have

3 with n=2
18 with n=3
48 with n=4

but I still can't find a correct answer.
I don't know but how can you come up with those numbers? Here's what I get:
3, n = 2
10, n = 3
35, n = 4
126, n = 5
...
For n = 3, I have a total of 10 functions:
1 -> 1, 2 -> 1, 3 -> 1
1 -> 1, 2 -> 1, 3 -> 2
1 -> 1, 2 -> 1, 3 -> 3
1 -> 1, 2 -> 2, 3 -> 2
1 -> 1, 2 -> 2, 3 -> 3
1 -> 1, 2 -> 3, 3 -> 3
1 -> 2, 2 -> 2, 3 -> 2
1 -> 2, 2 -> 2, 3 -> 3
1 -> 2, 2 -> 3, 3 -> 3
1 -> 3, 2 -> 3, 3 -> 3
That's 10, how can you come up with 18?
Am I missing something? :confused:
 
Last edited:
  • #5
maybe I am missing something...
I thought it was all the functions in the intervals [1,n] -> [1,n]
with n=2
(1,1) -> (2,1)
(1,1) -> (2,2)
(1,2) -> (2,2)
with n=3
(1,1) -> (2,1)
(1,1) -> (3,1)
(1,1) -> (2,2)
(1,1) -> (2,3)
(1,1) -> (3,2)
(1,1) -> (3,3)
(1,2) -> (2,2)
(1,2) -> (3,2)
(2,1) -> (3,1)
(2,1) -> (3,2)
(2,1) -> (3,3)
etc
 
  • #6
Hmm, I don't get what you wrote, what do you mean by:
(1,1) -> (2,1)
(1,1) -> (2,2)
(1,2) -> (2,2)
and:
(1,1) -> (2,1)
(1,1) -> (3,1)
(1,1) -> (2,2)
(1,1) -> (2,3)
(1,1) -> (3,2)
(1,1) -> (3,3)
(1,2) -> (2,2)
(1,2) -> (3,2)
(2,1) -> (3,1)
(2,1) -> (3,2)
(2,1) -> (3,3)?
--------------
Growing functions are the ones such that for every x < y, we have: f(x) <= f(y).
For n = 2, we have 3 such functions:
f1 : f1(1) = 1, f1(2) = 1
(that's what AKG meant when he wrote: f1: 1 -> 1; 2 -> 1).
f2 : f2(1) = 1, f2(2) = 2
f3 : f3(1) = 2, f3(2) = 2
Let's first look at f1, we have 1 < 2, so f1(1) = 1 <= f1(2) = 1, right? And that's a growing function.
Look at AKG's hints again and see if you can finish the problem.
Is it clearer? :)
 
  • #7
I mean as a growing function that goes from point (x,y) to point (x,y) in the interval [a,b]
(2,1) -> (3,3) is a growing function in the interval [1,3] -> [1,3].Is like having a 3x3 square and joining all the points that make a growing function.

This is my (maybe wrong) interpretation of the problem.
 
Last edited:
  • #8
Yes, you're interpreting the problem incorrectly. You need count the number of functions f : {1, 2, ..., n} -> {1, 2, ..., n} such that x < y implies f(x) < f(y) or f(x) = f(y). This is almost identical to what your original post says, because your original post is unambiguous, so I don't see how you're misinterpreting it. In fact, I have no clue as to what you are interpreting the question to even mean.

Do you know what a function is?
 
  • #9
Yes that's the problem if its defined as two sets A={1,...,n} and B= {1,...,n} and the function as f:A -> B
But the problem says all the growing functions of the closed intervals [1,n] -> [1,n](As far as I know as set is defined by {} and closed intervals by [] and open intervals by ().)
 
  • #10
As a subset of the naturals, the closed interval [1, n] IS EXACTLY the set {1, ..., n}. But even if you thought they were talking about, [1,n] as a subset of the reals, your answer still wouldn't make sense. Nothing you wrote looks anything like a function from [1,n] to [1,n], no matter how you interpret [1,n]. So, again, do you know what a function is?

Note that it's implied by the context that [1,n] is regarded as a subset of the naturals. As a subset of the reals, there are an infinite number of increasing functions form [1,n] to [1,n].
 
  • #11
if you want all growing functions that goes from an interval [1,n] to [1,n]
Graphically you have a square nXn where (joining all the points) all the constant lines and growing lines are all the growing functions.

f(2,1)-> (3,3) with f(x,y) -> (x,y) is a growing function?
 
  • #12
None of this makes any sense whatsoever. Forget growing functions for now, do you even know what a function is? What is an example of a function f : [1,n] -> [1,n]?
 
  • #13
Im sorry I had the wrong numbers in my paper. With n = 3 is 10
My numbers and the graphical interpretation were wrong indeed.

I was counting the number of functions with the graphical interpretation not by definition.
 
Last edited:
  • #14
kezman said:
Im sorry I had the wrong numbers in my paper. With n = 3 is 10
My numbers and the graphical interpretation were wrong indeed.

I was counting the number of functions with the graphical interpretation not by definition.
kezman, from the previous posts, I still don't think that you've understood the problem. Just be sure you understand it thoroughly before trying to solve it.
What you wrote like this:
(2,1) -> (3,3) is a growing function in the interval [1,3] -> [1,3].Is like having a 3x3 square and joining all the points that make a growing function.
is meaningless. And may I know what you really meant by graphical interpretation?
Please answer AKG's questions:
AKG said:
None of this makes any sense whatsoever. Forget growing functions for now, do you even know what a function is? What is an example of a function f : [1,n] -> [1,n]?
 
  • #15
what you wrote in n = 2
f1: 1 -> 1; 2 -> 1
f2: 1 -> 1; 2 -> 2
f3: 1 -> 2; 2 -> 2

I write it (x,y) -> (x,y) As the firsts and lasts "points" of the function(Graphically)
f1:(1,1) -> (2,1)
f2:(1,1) -> (2,2)
f3:(1,2) -> (2,2)

I did had my numbers wrong before with n = 3(plus I should have mentioned the middle point). There were 10 functions.

The graphical interpretation is just a "cartesian diagram" where I "draw" all the posible growing functions(According to n).
With n = 2 are 3 (two constants and one "growing")
and with n = 3 are 10
Unfortunately I don't have a program to draw it.

Sorry I wasnt clear.
 
Last edited:
  • #16
For n=3, what are the 10?
 
  • #17
for n=3 with the first, middle and last point (Before I didnt mention the middle point, my mistake)
(1,1)-> (2,1)-> (3,1) (constant)
(1,1)-> (2,1)-> (3,2)
(1,1)-> (2,2)-> (3,2)
(1,1)-> (2,1)-> (3,3)
(1,1)-> (2,3)-> (3,3)
(1,2)-> (2,2)-> (3,2) (Constant)
(1,2)-> (2,2)-> (3,3)
(1,2)-> (2,3)-> (3,3)
(1,1)-> (2,2)-> (3,3) (Strict growing function)
(1,3)-> (2,3)-> (3,3) (constant)
 
  • #18
Yes, that's correct. Now to the problem of actually counting the number of functions that do this. Do you have any ideas of your own? Now that you understand the problem, you can go back to the hints I gave, or if anyone else gave hints, you can look at those.
 

FAQ: Number of Growing Functions in [1,n] -> [1,n]: n^2-1

What does "Number of Growing Functions in [1,n] -> [1,n]: n^2-1" mean?

This refers to the number of functions that have a growing trend when mapping the input values from 1 to n to output values from 1 to n, with a formula of n^2-1.

How is the number of growing functions calculated?

The number of growing functions can be calculated by plugging in different values for n in the formula n^2-1 and counting the number of unique outputs. For example, when n=2, the number of growing functions is 3: f(1)=1, f(2)=2, and f(1)=2, f(2)=1 are both considered growing functions.

What is the significance of n^2-1 in this context?

The formula n^2-1 represents the maximum number of unique outputs that can be obtained when mapping the input values from 1 to n to output values from 1 to n. This is because there are n^2 possible combinations of input and output values, but 1 output (the constant function) is not considered as a growing function.

Can you provide an example of a growing function in [1,n] -> [1,n] with n^2-1 outputs?

Yes, one example is the function f(x) = x, where x is the input value from 1 to n. This function has n^2-1 unique outputs: f(1)=1, f(2)=2, f(3)=3, and so on up to f(n-1)=n-1. This function has a growing trend as the input value increases from 1 to n.

What is the practical application of studying the number of growing functions in [1,n] -> [1,n]: n^2-1?

Studying the number of growing functions in this context can help in understanding the relationship between input and output values, and how different functions can have different growth rates. This can be useful in data analysis, optimization problems, and other areas of mathematics and science.

Back
Top