1. ## functions question N/A

Recall that N is the set of natural numbers, i.e., N = {0, 1, 2, . . .}.
1. Consider the set W of words over the alphabet {a, b, c}, i.e., the set ofall finite non-empty sequences of letters chosen among a, b and c – forexample, aa, babb and bbc are all elements of W.
Let counta be the function from W to N that counts the number oftimes the letter a occurs, i.e., given w ∈ W, counta(w) is the numberof times a occurs in w.

(a) Calculate counta(aa) and counta(bbc).

ANY HELP WOULD BE GREATLY APPRECIATED, I'M STRUGGLING.

2. ## Re: functions question N/A

Originally Posted by Libya
Recall that N is the set of natural numbers, i.e., N = {0, 1, 2, . . .}.
1. Consider the set W of words over the alphabet {a, b, c}, i.e., the set ofall finite non-empty sequences of letters chosen among a, b and c – forexample, aa, babb and bbc are all elements of W.
Let counta be the function from W to N that counts the number oftimes the letter a occurs, i.e., given w ∈ W, counta(w) is the numberof times a occurs in w.

(a) Calculate counta(aa) and counta(bbc).

ANY HELP WOULD BE GREATLY APPRECIATED, I'M STRUGGLING.
surely you can do (a)

(b) injective means one to one. $counta(aaa)=3$, $counta(baaa)=3$, so clearly $counta()$ is not injective

(c) surjective here would mean that every $n \in \mathbb{N}$ has some word $w \in W$ such that $counta(w)= n$

For any given $n$ the word $w$ consisting of $n$ $a$'s is such that $counta(w)=n$ so $counta()$ is surjective

3. ## Re: functions question N/A

Originally Posted by romsek
surely you can do (a)

(b) injective means one to one. $counta(aaa)=3$, $counta(baaa)=3$, so clearly $counta()$ is not injective

(c) surjective here would mean that every $n \in \mathbb{N}$ has some word $w \in W$ such that $counta(w)= n$

For any given $n$ the word $w$ consisting of $n$ $a$'s is such that $counta(w)=n$ so $counta()$ is surjective
If that is a correct reading, then as I said this is a childish trivial question.

4. ## Re: functions question N/A

Originally Posted by Plato
If that is a correct reading, then as I said this is a childish trivial question.
as you said where?

5. ## Re: functions question N/A

Originally Posted by romsek
as you said where?
Originally Posted by Plato
I confess that I am also confused. Either this is a totally trivial question or the worst worded.

Is this the way anyone else understands how the function works?
$\text{counta}(bbb)=0$
$\text{counta}(babcc)= 1$
$\text{counta}(abcab)=2~?????$

6. ## Re: functions question N/A

Originally Posted by Plato
odd, I'm not seeing that post.

7. ## Re: functions question N/A

Originally Posted by romsek
odd, I'm not seeing that post.
Thank you, I will tell Ted. We are having real trouble with a spam filter.
Do you agree that it is trivial under that reading?

8. ## Re: functions question N/A

Originally Posted by Plato
Thank you, I will tell Ted. We are having real trouble with a spam filter.
Do you agree that it is trivial under that reading?
I suppose it's a pretty remedial intro to injection and surjection so not entirely trivial but the function itself is pretty trivial

9. ## Re: functions question N/A

lmao you guys are saying this question is trivial this question represents my life, i suck at discrete maths. how are you guys so smart?

10. ## Re: functions question N/A

Originally Posted by Libya
lmao you guys are saying this question is trivial this question represents my life, i suck at discrete maths. how are you guys so smart?
being able to count the number of a's in a word does not make one so smart.

11. ## Re: functions question N/A

Originally Posted by Libya
lmao you guys are saying this question is trivial this question represents my life, i suck at discrete maths. how are you guys so smart?
Do you understand that this problem is asking you to count?

My experience is that people who are "not good at maths" simply do not grasp the definitions- often trying to read more into the definitions than they should.

"Calculate counta(aa)". Can you count to 2?