1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Zinaida [17]
3 years ago
3

If x is a string, then xR is the reverse of the string. For example, if x = 1011, then xR = 1101. A string is a palindrome if th

e string is the same backwards and forwards (i.e., if x = xR). Let B = {0, 1}. The set Bn is the set of all n-bit strings. Let Pn be the set of all strings in Bn that are palindromes.
(c) Determine the cardinality of P7 by showing a bijection between P7 and Bn for some n.
Computers and Technology
1 answer:
Arada [10]3 years ago
4 0

Answer:

Answer explained below

Explanation:

Credit to Jordan Johnson,

The set Bn contains all binary strings of size n. The number of strings in the set is equal to 2n since there are n positions to fill and each position can be filled with either 0 or 1.

Therefore, total number of strings = 2 * 2 * … * 2 = 2n

The set Pn that contains all the n-bit strings that are palindrome is a subset of the set Bn.

(c)

The set P7 contains 7-bit binary strings that are a palindrome. Each bit can either be 0 or 1 and hence there are 2 ways to fill each position of the binary string. The number of strings in P7can be computed as follows:

The first bit should be equal to the seventh bit. Number of ways to fill the first bit = 2 ways

The second bit should be equal to the sixth bit. Number of ways to fill the second bit = 2 ways

The third bit should be equal to the fifth bit. Number of ways to fill the third bit = 2 ways

The fourth bit could either be 0 or 1. Number of ways to fill the fourth bit = 2 ways

Therefore, the cardinality of P7 is equal to the total number of ways to fill the first 4 bits of the 7-bit strings = 2*2*2*2 = 16

To create a bijection function between P7 and Bn, compute the value of n as shown below:

Number of strings in P7 = Number of strings in Bn

16 = 2n

24 = 2n

Therefore, the value of n = 4.

The string in the set B4 are as follows:

{0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111}

Proof for bijection:

1. The above function P7 to B4 is one-one or injective, that is, if f(x) = f(y), then x = y where x, y belongs to the set P7.

For all x and y belonging to set P7, there are no two strings x and y for which f(x) = f (y), where x is not equal to y.

Hence, the function is one-one or injective.

2. The above function is onto or surjective, that is, for all y belonging to B4, there exist f(x) such that f(x) = y.

In other words, there is no y that belongs to B4 which is not mapped to an element of the set P7. None of the element in the set B4 is left un-mapped.

Hence, the function is onto or surjective.

Since the function is injective and surjective, the function P7 to B4 is bijective.

Hence, proved.

You might be interested in
Program C++ I need help!
nikitadnepr [17]

Answer:#include <iostream>

using namespace std;

int main()

{

   int factorial = 1;

   for (int i = 5; i > 0; i--) {

       factorial = factorial * i;

   }

   cout<<factorial;

   return 0;

}

Explanation:

3 0
3 years ago
Howard’s In The Process Of Creating A Google Display Campaign And Decides To Use Custom Intent Audiences As A Targeting Option.
Vladimir79 [104]

Answer:

Option 3 and Option 4 i.e., URLs and Keywords are correct.

Explanation:

Howard through the Phase for developing the following display project as well as determines to still use specific Purpose Viewers As just the targeting tool. He would prefer to affect consumer attention, however his limited demographic is not served by such an in-market client group.  

  • Thus, URLs, as well as keywords, are data inputs that Howard sends to better serve his viewer.
  • So, the following are the reason that describe the other options are not appropriate according to the scenario.
6 0
3 years ago
A programmer wrote the program below. The program uses a list of numbers called numList. The program is intended to display the
Nezavi [6.7K]

Answer:

The conclusion is incorrect; using the test case [0, 1, 4, 5] is not sufficient to conclude the program is correct.

Explanation:

From the code snippet given, we cannot conclude that the test case is sufficient.

One of the reasons is because the test case contains only integer variables.

Tests need to be carried out for other large and floating points numerical data types such as decimal, double, float, etc. except that when it's known that the inputs will be of type integer only else, we can't rush into any conclusion about the code snippet

Another reason is that input are not gotten at runtime. Input gotten from runtime environment makes the program flexible enough.

Lastly, the array length of the array in the code segment is limited to 4. Flexible length needs to be tested before we can arrive at a reasonable conclusion.

8 0
4 years ago
What does the hard drive do
Gnoma [55]

The most important characteristic of a hard drive is how much data the hard drive can store, referred to as the storage capacity. A typical internal hard drive for a new desktop computer or laptop has a storage capacity of several hundred gigabytes

8 0
4 years ago
Read 2 more answers
_________ involves encouraging employees to engage in behaviors directly related to goal accomplishment.
lianna [129]
Planning involves encouraging employees to engage in behaviors directly related to a goal accomplishment. It is the best way to have excellent performance because it motivates the employees to work harder. Planning involves goal setting, objectives, and determining the course of action to achieve the goal.
5 0
4 years ago
Other questions:
  • Does a soda vending machine Give reciepts?<br><br>need for computer science hw
    7·2 answers
  • A range of cells can be converted into an Excel ________ so that the data can be analyzed
    7·1 answer
  • 1. ________ is often defined as using illicit (illegal) drugs, or when the drug is alcohol, tobacco, or a legitimate drug (presc
    13·1 answer
  • What is a expansion card for computer?
    5·1 answer
  • Short Answer: Computer models and simulations are used to formulate, refine, and test hypotheses. Describe a scenario that could
    8·1 answer
  • Apollo Couriers, a company providing international express mail services, has a proactive customer communications team. The prim
    8·1 answer
  • Which of the following statements is not true? Group of answer choices
    9·1 answer
  • Explain with a few sentences and using the terms sequencing, selections and loops how they
    9·1 answer
  • Ten output devices you know
    10·1 answer
  • What microphone is this
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!