Question

In: Physics

1b) Suppose z is any positive even integer. Write a formula in terms of z that...

1b) Suppose z is any positive even integer. Write a formula in terms of z that gives the total number of palindromes of length z using characters from a set that contains 40 different symbols. A palindrome is a string of characters that are the same from left to right and right to left.

1c) Suppose z is any positive odd integer. Write a formula in terms of z that gives the total number of palindromes of length z using characters from a set that contains 40 different symbols. A palindrome is a string of characters that are the same from left to right and right to left.

If you show your work and explain, I will like your answer!

Solutions

Expert Solution


Related Solutions

Determine the number of permutations of {1,2,3,...,n-1,n} where n is any positive integer and no even...
Determine the number of permutations of {1,2,3,...,n-1,n} where n is any positive integer and no even integer is in its natural position.
A formula with a positive integer (less than 32 bits) and a positive decimal (number with...
A formula with a positive integer (less than 32 bits) and a positive decimal (number with decimal points) is expressed in the median formula. Change the given median to postfix and write a program that outputs the results of the calculation. operand ::= positive integer or positive error Positive integer ::= A number expressed as less than 32 bits consisting of 0 to 9. Positive integer representation of 0, 0100, 00934, 1056, 65535 is allowed Positive decimal ::= Positive integer...
Create a program that will calculate the factorial of any user entered integer. For any positive integer, the factorial is given as
Create a program that will calculate the factorial of any user entered integer. For any positive integer, the factorial is given as: n! = n·(n-1)·(n-2)·.……·3·2·1. The factorial of 0 is 1. If a number is negative, factorial does not exist and this program should display error message. Sample output dialogues should look like these:  Enter an integer: -5 ERROR!!! Tactorial of a negative number doesn't exist  Enter an integer: 10  Factorial = 3628800
For any Gaussian Integer z ∈ ℤ[i] with z = a+bi , define N(z) =a2 +...
For any Gaussian Integer z ∈ ℤ[i] with z = a+bi , define N(z) =a2 + b2. Using the division algorithm for the Gaussian Integers, we have show that there is at least one pair of Gaussian integers q and r such that w = qz + r with N(r) < N(z). (a) Assuming z does not divide w, show that there are always two such pairs. (b) Fine Gaussian integers z and w such that there are four pairs...
Suppose a is a positive integer and p is a prime/ Prove that p|a if and...
Suppose a is a positive integer and p is a prime/ Prove that p|a if and only if the prime factorization of a contains p. Can someone please show a full proof to this, thank you.
Mystery(y, z: positive integer) 1 x=0 2 while z > 0 3       if z mod 2...
Mystery(y, z: positive integer) 1 x=0 2 while z > 0 3       if z mod 2 ==1 then 4                x = x + y 5       y = 2y 6       z = floor(z/2)           //floor is the rounding down operation 7 return x Simulate this algorithm for y=4 and z=7 and answer the following questions: (3 points) At the end of the first execution of the while loop, x=_____, y=______ and z=_______. (3 points) At the end of the second execution of...
Write a program that prompts the user to enter a positive integer and then computes the...
Write a program that prompts the user to enter a positive integer and then computes the equivalent binary number and outputs it. The program should consist of 3 files. dec2bin.c that has function dec2bin() implementation to return char array corresponding to binary number. dec2bin.h header file that has function prototype for dec2bin() function dec2binconv.c file with main function that calls dec2bin and print results. This is what i have so far. Im doing this in unix. All the files compiled...
Write a program that takes in a positive integer as input, and outputs a string of...
Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is: As long as x is greater than 0 Output x % 2 (remainder is either 0 or 1) x = x / 2 Note: The above algorithm outputs the 0's and 1's in reverse order. Ex: If the input is: 6 the output is: 011 6 in binary is...
IN PYTHON Write a program that takes in a positive integer as input, and outputs a...
IN PYTHON Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is: As long as x is greater than 0 Output x % 2 (remainder is either 0 or 1) x = x // 2 Note: The above algorithm outputs the 0's and 1's in reverse order. You will need to write a second function to reverse the string....
In c++ Write a program that reads a string consisting of a positive integer or a...
In c++ Write a program that reads a string consisting of a positive integer or a positive decimal number and converts the number to the numeric format. If the string consists of a decimal number, the program must use a stack to convert the decimal number to the numeric format. Use the STL stack
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT