answer.
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]
2 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]2 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
"the ____ criteria filter requires the records displayed to have the specified text string anywhere."
Debora [2.8K]

The contains criteria filter requires the records displayed to have the specified text string anywhere. Thecontains operator is used to perform case-sensitive matching regardless of location in strings.

The begins with criteria filter on the other hand requires the records displayed to start with the specified text string

3 0
2 years ago
B2B partners often connect to each other on the Internet through special __________ designed to facilitate information exchanges
Alenkasestr [34]

Answer:

web portals

Explanation:

B2B (business-to-business) is a marketing strategy that deals with meeting the needs of other businesses, by selling products or services to the organizations for resale to other consumers, used in production of goods or for the operation of an organisation.

B2B (business-to-business) model focuses on facilitating sales transactions between businesses.

Under the B2B, the producer sells its products directly to other businesses such as wholesalers or retailers and not the end consumers.

B2B partners often connect to each other on the Internet through special web portals that are designed to facilitate exchange of information and simplified business transactions.

Additionally, a popular application of the seller-side marketplace model, which is a major business-to-business (B2B) e-commerce model, is e-procurement of goods through the use of web portals over the internet and as such eliminating the option of physical buying or procurement.

3 0
1 year ago
Edhesive unit 2 lesson 5 coding activity 1 Write code which creates three regular polygons with 11, 14 and 19 sides respectively
SVEN [57.7K]

Answer:

public class Polygon {

   private String name;

   private int sides;

   private double sideLength;

   public Polygon(String name, int sides, double sideLength) {

       if (sideLength <= 0) throw new IllegalArgumentException("Length cannot be zero or negative.");

       if (sides <= 0) throw new IllegalArgumentException("Sides cannot be zero or negative.");

       this.name = name;

       this.sides = sides;

       this.sideLength = sideLength;

   }

   public String getName() {

       return name;

   }

   public void setName(String name) {

       this.name = name;

   }

   public double getSideLength() {

       return sideLength;

   }

   public void setSideLength(double sideLength) {

       if (sideLength <= 0) throw new IllegalArgumentException("Length cannot be zero or negative.");

       this.sideLength = sideLength;

   }

   public int getSides() {

       return sides;

   }

   public void setSides(int sides) {

       this.sides = sides;

   }

   (use the at sign here)Override

   public String toString() {

       return "regular " + name + " with side length " + String.format("%.1f", sideLength);

   }

}

public class TestPolygon {

   public static void main(String[] args) {

       Polygon sides11 = new Polygon("hendecagon", 11, 1);

       Polygon sides14 = new Polygon("tetrakaidecagon", 14, 1);

       Polygon sides19 = new Polygon("enneadecagon", 19, 1);

       System. out. println(sides11);

       System. out. println(sides14);

       System. out. println(sides19);

   }

}

Explanation:

This java source code defines a class that creates a regular polygon based on the number of sides given to it.

Below is a screenshot of the program code and output.

4 0
1 year ago
Describe how the process of sampling, RGB pixels, and binary sequences work together to display a digital color image
Rina8888 [55]

Explanation:

Sampling and RBG (red blue green) pixels and also the binary sequences working together such that it display any digitally colored image by allowing the computer system know where the Red Blue Green pixel is going to be placed and also what the opacity would be for that pixel. The combination of these components is what gives you a digital color image.

5 0
2 years ago
Anna bought a box of blueberries for £7. She used 700 grams for a cheesecake and she has 450 grams left. How much did the bluebe
xxTIMURxx [149]

0.61 (rounded up)

Explanation:

You add both 700 and 450 which will give you 1150g

You then divide 1150 by 100 which gives you 11.5

Then divide 7 by 11.5 which will give you 0.61 as cost of every 100 grams

8 0
2 years ago
Other questions:
  • Mary is writing an article about the animal kingdom. She wants to place image below the text. Which menu should Mary choose for
    15·2 answers
  • What are common names for some primary discrete components used on circuit boards?
    13·1 answer
  • Write a program that asks the user to input an integer that is a perfect square. A perfect square is an integer that is equal to
    14·1 answer
  • Select the correct answer. James is a sales analyst of a departmental store chain. He checked the sale records for the past 12 m
    6·2 answers
  • A user calls the help desk and reports that the workstation, when powering up, displays error messages about an invalid system d
    8·1 answer
  • A device has an IP address of 10.1.10.186 and a subnet mask of 255.255.255.0. What is true about the network on which this devic
    9·1 answer
  • Martha has been appointed as the Data Security Manager of her organization. The company wants her to develop a customized app to
    13·1 answer
  • If productCost and productPrice are numeric variables, and productName is a string variable, which of the following statements a
    11·1 answer
  • Which of the following statements best describes the relative amount of content held by digital libraries vs. the amount held by
    12·1 answer
  • Laura is the first person in her SDLC team to detect and predict security vulnerabilities in the software. In which phase is Lau
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!