Induction Proof for all strings: Can't understand the Question

In summary: That is what you are being asked to prove.The reason that this problem went on for so long is that you had not provided a definition for |t^n|. That is what we were trying to get you to do.
  • #1
zak100
462
11
Homework Statement
Use induction on 'n' to show that |t^n| = n |t| for all strings 't' and for all 'n'.
Relevant Equations
No equation
Hi,
Can some body please explain me the following question:
Use induction on ##n## to show that ##|t^n| = n |t| ## for all strings ##t## and all ##n## .

Any idea how to that. I know we have a base case and an induction case but what would be the base case and what would be the induction case?

Zulfi.
 
Physics news on Phys.org
  • #2
As you're asked to do a proof by induction, you have to think about some property / ies of strings having to do with numbers. Also, what does ##|t^n|## mean? A potential hint might be towards concatenation. Then, you'll be ready to construct the base case and proceed further.
 
  • #3
Hi,
Base case : Let n=0
##t^0= \text {empty string}##

##\text {Now suppose} ## ## n= k ##

##t^n = t^k##

##= k |t|##

##\text{Induction Step: Let } n = k+1##

##t^n = t^{(k+1)}##

##= k|t|. 1|t|##

##= t^n. 1|t|##

Some body please correct me.
Zulfi
 
  • #4
What property / properties of strings do you consider?Also, what does ##|t^n|## mean?
 
  • #5
Hi,
Length of t^n

Zulfi.
 
  • #6
zak100 said:
Hi,
Length of t^n

Let's just start from a string ##t##. What property of this would you consider?
 
  • #7
I think : |t| = length of string t

Zulfi.
 
  • #8
zak100 said:
I think : |t| = length of string t

So, in general, the number of characters (i.e. the cardinality) of the string. Then, what is ##|t^n|##?
 
  • #9
Hi,
I think ##|t^n|## means a string of size 'n'.

Zulfi.
 
  • #10
zak100 said:
I think ##|t^n|## means a string of size 'n'.
I don't think so. ##t^n## probably represents a string with n characters, and ##|t^n|## might mean the length of such a string. Since you aren't sure, you better make sure that's the case.
zak100 said:
Base case : Let n=0
##t^0= \text {empty string}##
I would start with a base case of n = 1, a string that contains one character.
zak100 said:
##\text {Now suppose} ## ## n= k ##
##t^n = t^k##
##= k |t|##
This is the Induction Hypothesis; i.e., if n = k, then ##t^k = k|t|##
Here I'm also assuming that ##|t| = |t^1|##; i.e., that |t| is shorthand for the length of a string with one character.
zak100 said:
##\text{Induction Step: Let } n = k+1##

##t^n = t^{(k+1)}##

##= k|t|. 1|t|##

##= t^n. 1|t|##
This isn't right. Wouldn't ##|t| \cdot |t|## be equal to ##|t|^2##? (Which may or may not be equal to 1.)
In any case, you need to use the Induction hypothesis to show that ##|t^{k + 1}| = (k + 1)|t|##.

This is probably a lot simpler problem than you are making it. With regard to strings, what do the expressions ##|t^k|## and ##|t^{k+1}|## represent?
 
  • #11
Hi,

Thanks for the steps.

From the proposition, it seems that :
##|t^n|= n|t| ##

##\text {but I don't think we can use the proposition:} ##

##\text & ##

##|t^{(k + 1)} | = |t^k . t^1| ##

Zulfi.
 
  • #12
zak100 said:
Hi,

Thanks for the steps.

From the proposition, it seems that :
##|t^n|= n|t| ##
Well, this is exactly what you need to prove.
zak100 said:
##\text {but I don't think we can use the proposition:} ##

##\text & ##

##|t^{(k + 1)} | = |t^k . t^1| ##
Of course you can't -- you can't use something that you're supposed to prove.
Take a look again at what I wrote in post #10:
With regard to strings, what do the expressions ##|t^k|## and ##|t^{k+1}|## represent?
 
  • #13
@zak100, you will never be able to do this problem if you can't answer the question @QuantumQuest asked way back in post #2.
QuantumQuest said:
Also, what does ##|t^n|## mean? A potential hint might be towards concatenation.
His hint that ##t^n## represents the concatenation of a string t with itself some number of times seems to be the best interpretation of this notation.
 
  • #14
Hi,
If a person is not able to understand please use simple words. If you had used multiplication (instead of concatenation) even in brackets followed by concatenation, my life could have become more easier at that time.

Zulfi.
 
  • #15
zak100 said:
If a person is not able to understand please use simple words. If you had used multiplication (instead of concatenation) even in brackets followed by concatenation, my life could have become more easier at that time.
Our life, and yours, would have become easier if you had explained what ##t^n## means right at the beginning of this thread.

I realize that English is not your first language. To concatenate two strings means that the two strings are joined together to form a single string. For example, the concatenation of "bad" and "dog" results in the string "baddog".

I believe that @QuantumQuest is on the right track regarding the meaning of ##t^n##. If t = "abc", then it is likely that ##t^2## represents a string formed from two copies of t; that is, the string "abcabc". From this it is reasonable to assume that ##|t| = 3## and ##|t^2| = 6##, but we don't know this for a fact, since you haven't told us what the notation ##t^n## means, despite being asked for it several times in this thread. The reason you're struggling with this problem is that you aren't clear about what ##t^n## means.
 
  • Like
Likes QuantumQuest
  • #17
Hi, Thanks for your concern. I complete this problem.
|t^n| = |t.t.t.t...|
= n.|t|
= n . 1

Actually concatenation is a technical term. We use for appending strings. But here concatenation was used for multiplication. Multiplication is common in English but concatenation is not common when it is used for multiplication.
This was my concern.
Also after 17 post we did not get a solution. All is well that ends well but this post did not complete despite the fact that I followed what I was told based upon my understanding.
Zulfi.
 
  • #18
zak100 said:
Actually concatenation is a technical term. We use for appending strings.
It is a technical term, but it is very commonly used in computer science as well as in most programming languages.
zak100 said:
But here concatenation was used for multiplication. Multiplication is common in English but concatenation is not common when it is used for multiplication.
No, concatenation was not used for multiplication. You are confusing concatenation (denoted in your problem as ##t^n##), with the magnitude, or length, of a string, which is denoted |t|.

In concatenation, you are "adding" or joining a string onto the end of another. If you "add" (append) a string onto itself, you get a string that is twice as long. That is, using the notation of your problem, if t = "abc", then ##t^2 = "abcabc"##, so ##|t^2| = 6, twice the number of characters in string t.
 
  • Like
Likes QuantumQuest
  • #19
zak100 said:
Also after 17 post we did not get a solution.
You mean that you did not get a solution, even though you were given many hints along the way.
zak100 said:
All is well that ends well but this post did not complete despite the fact that I followed what I was told based upon my understanding.
You were asked several times throughout the thread what the notation ##t^n## meant, and it was not until post #17 that you finally answered that question. We can't give you good advice on how to solve a problem until 1) you understand what the problem is asking, and 2) you provide us with that information.
 
  • Like
Likes QuantumQuest

1. What is induction proof for all strings?

Induction proof for all strings is a method used in mathematics and computer science to prove that a statement holds true for all possible strings of a certain length or format. It involves using a base case and an inductive step to show that the statement is true for the first string and any subsequent string based on the previous one.

2. How is induction proof for all strings different from other types of proofs?

Induction proof for all strings is different from other types of proofs, such as direct proof or proof by contradiction, because it focuses on proving a statement for all possible strings rather than a specific number or range of values. It also relies on the concept of recursion, where the proof for a longer string is based on the proof for a shorter string.

3. What is the importance of induction proof for all strings in computer science?

Induction proof for all strings is important in computer science because it allows us to prove the correctness of algorithms that involve manipulating strings, such as searching, sorting, and pattern matching. It also plays a crucial role in formal language theory, which is the study of the properties of formal languages used in computer programming and linguistics.

4. Can you give an example of an induction proof for all strings?

Sure, one example of an induction proof for all strings is proving that the length of a string is always greater than or equal to 0. The base case would be a string of length 0, which clearly has a length of 0. The inductive step would be to show that if a string of length n has a length of n, then a string of length n+1 must have a length of n+1. This can be shown by adding one more character to the end of the string, resulting in a string of length n+1.

5. What are some common mistakes to avoid when using induction proof for all strings?

Some common mistakes to avoid when using induction proof for all strings include not properly defining the base case or not proving the inductive step for all possible strings. It is also important to be careful when assuming that a statement is true for a string of length n+1 just because it is true for a string of length n, as this may not always be the case. It is important to carefully consider all possible strings and ensure that the proof holds true for each one.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
2K
  • Topology and Analysis
Replies
6
Views
1K
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
1K
  • Calculus and Beyond Homework Help
Replies
15
Views
1K
  • Electromagnetism
Replies
16
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Back
Top