Answer to a) is n? and b) is n-1?How many functions are there from the set {1,2,...,n}, where n is a positive integer, to the set {0,1}
a) that assign 0 to both 1 and n?
b) that assign 1 to exactly one of the positive integers less than n?
Answer to a) is n? and b) is n-1?How many functions are there from the set {1,2,...,n}, where n is a positive integer, to the set {0,1}
a) that assign 0 to both 1 and n?
b) that assign 1 to exactly one of the positive integers less than n?
In the first one, you have a sequence $\displaystyle \{a_k\}_{k=1}^{n}$ such that $\displaystyle a_i \in \{0,1\} \ \forall 1 \leq i \leq n$ and such that $\displaystyle a_1=a_n = 0$. So you have $\displaystyle n-2$ more spots to fill in the sequence, where each of them can be either 0 or 1, ie. 2 options for each spot, n-2 spots, gives $\displaystyle 2^{n-2}$.
b is correct, though.
a) There are no functions that assign 0 to both 1 and n.How many functions are there from the set {1,2,...,n}, where n is a positive integer, to the set {0,1}
a) that assign 0 to both 1 and n?
b) that assign 1 to exactly one of the positive integers less than n?
No function can have two pairs with the same first term: $\displaystyle (0,1)~\&~(0,n)$.
b) Notice that the range is $\displaystyle \{0,1\}$
If $\displaystyle n=1$ the answer is $\displaystyle 0$
If $\displaystyle n>1$ the answer is $\displaystyle 2^{n-1}$
Since $\displaystyle f:\{1,2,...,n\} \to \{0,1\}$, I think what we are to assume is that $\displaystyle f(1) = f(n) = 0$, which is of course possible, we just lose f being injective.
As for b, let $\displaystyle f(m) = 1$ for some $\displaystyle 1\leq m < n$. Then, f has assign 0 to every other element of $\displaystyle \{1,...,n\}$, therefore there is only one such sequence, and there are n-1 choices of m.
The wording is misleading. A function assigns 0 to 1 & n if the pairs (0,1) and (0,n) are in the function.
That is the reason for my comment.
So the statement of the question is incorrect.
As for your objection about the b) part, do you know that 0 is not a positive integer?
Of course I know that! But I solved it using the same "definition" as part (a). That is, $\displaystyle f(m) = 1$ for some $\displaystyle 1\leq m < n$. It can't be that $\displaystyle f(0) = 1$ since 0 is not in the domain of f!
I agree that the wording is ambiguous/incorrect... however this way it makes much more sense, more so because 0 is not in the domain.
I think that we must answer the question as asked.
If the statement says: $\displaystyle f$ assigns 2 to 3 then that means $\displaystyle f(2)=3$.
Otherwise, we have no common language for communication at this site.
If we try to second guess what is actually meant, that will lead to a huge waste of time.
I agree that a common terminology for communication is needed, however there are always exceptions... In my opinion, it is fairly obvious, (I really don't see any teacher giving such a question, in the way that you meant it) in this context, that f assigns 0 to both n and 1 means $\displaystyle f(1)=f(n)=0$.
Yes, I agree that on a usual context it would not be correct to state it this way, however I see no point at all in asking this question if 0 is not even in the domain of f.
I guess we should just wait for zpwnchen to clarify the question.
I checked the question word by word from the textbook and it was correct as it was.
The solution manual said...How many functions are there from the set {1,2,....,n}, where n is a positive integer, to the set {0,1}
a) that assign 0 to both 1 and n?
b) that assign 1 to exactly one of the positive integers less than n?
a) is $\displaystyle 2^{n-2}$ if n>1; 1 if n=1;
b) is 2(n-1)
But no idea of b answer...
My first question must be “Is the textbook written in English?”
If not then I have no basis for my objections.
But if it is written in English, then the author is abusing standard mathematical usage.
It should read:
a) assign or map both 1 and n to 0.
b) assigns or maps exactly one of the positive integer less than n to 1.
In standard mathematical usage saying $\displaystyle F$ assigns x to y means $\displaystyle F(x)=y$.
To answer the question correctly stated,
“How many functions $\displaystyle \{1,2,\cdots,n\}\mapsto \{0,1\}$ assign exactly one of the positive integer less than n to 1”?
Answer
If $\displaystyle n=1$ there are none.
If $\displaystyle n>1$, we can chose $\displaystyle n-1$ integers to map to 1.
The other $\displaystyle n-2$ must map to $\displaystyle 0$ while $\displaystyle n$ itself may be assigned to either $\displaystyle 0\text{ or }1$.
Therefore the answer is $\displaystyle 2(n-1)$.