Draw an FA over {0, 1}which represent binaries of Integers only divisible by 3. Allleading 0’s are permissible. [10]

Answers

Answer 1

Answer:

As we need to design the FA for the numbers divisible by 3, so we have to take the states as the remainders when we divide the numbers by 3.

Any number when divided by 3, gives remainder either 0 or 1 or 2. And the number gives remainder 0 is divisible by 3.

Let’s take

state 0 for remainder 0. state 1 for remainder 1. state 2 for remainder 2.

So now lets count from 0:

Binary 0 = decimal 0 %3 = 0, so goes to state 0.

Binary 1 =decimal 1 %3 = 1, goes to state 1.

Binary 10 = decimal 2 %3 =2, goes to state 2.

Bianary 11 = decimal 3 %3 =0, goes to state 0.

Bianary 100 = decimal 4 %3 =1, goes to state 1.

Bianary 101 = decimal 5 %3 =2, goes to state 2.

And so on.  

So here the state 0 will be the start state and also the final state.

Explanation:

So the FA is {{0,1,2}, {0,1}, δ, 0, {0}}

where δ(0, 0) = 0

           δ(0, 1) = 1

           δ(1, 0) = 2

           δ(1, 1) = 0

           δ(2, 0) = 1

           δ(2, 1) = 2

 Draw An FA Over {0, 1}which Represent Binaries Of Integers Only Divisible By 3. Allleading 0s Are Permissible.

Related Questions

As it is a good practice that C# broughtback the concept of GOTO statement and Pointer? If your answer isyes then how C# control the worst effect of those features. Pleasebe brief?

Answers

Answer:

No for GOTO

Yes for Pointer

Explanation:

GOTO statement

This declaration is used to pass control to the program's marked declaration. The label is the valid identifier and is positioned just before the declaration from which the control is transmitted.

It becomes hard to trace a program's control flow, making it hard to comprehend the program logic. Any program in C language can be written without using a GOTO statement.

Pointers

A C # pointer is nothing but a variable holding another type of memory address. However, in C # pointer only the memory address of the value types and arrays can be declared.

C # supports pointers to a restricted extent. Unlike reference kinds, the default trash collection system does not track pointer kinds. Pointers are not allowed to point  to a type of structure containing a type of reference or a type of reference.

During the garbage collection process, the C #garbage collector can move objects in memory as they wish. The C #offers a unique fixed keyword for telling Garbage Collector not to move an item. This implies that the place of the value kinds referred to is fixed in memory. This is called pinning in C #.

The GOTO statement and pointers in C# can simplify some coding tasks but can also make the code harder to read and C# controls these downsides by offering structured programming constructs and by restricting pointer usage to unsafe contexts.

The introduction of the GOTO statement and pointers in C# can be seen both positively and negatively. While the GOTO statement allows for easier navigation and breaking out of control structures, it often results in code that is hard to read and maintain. To mitigate such issues, C# provides structured programming constructs like loops, conditional statements, and methods to manage control flow more effectively.

C# also manages the risks of pointers by requiring explicit permissions and special contexts for their usage, thus limiting their misuse.

Control Mechanisms in C#

Instead of GOTO, use loops (for, while) and conditionals (if, switch) for better readability.Pointers are only allowed in unsafe contexts to highlight potential risks.

When a method returns an array reference, you include ____ with the return type in the method header.

a.
( )

b.
[ ]

c.
< >

d.
{ }

Answers

Answer:

b. []

Explanation:

Arrays are represented using [] . When a method returns an array reference, the method header contains an entry of the type <data-type>[].

For example, a method test which returns a reference to integer array and takes no parameters is of the form:

int[] test();

Similarly a method list_chars which takes a String as an argument and returns an array of chars has the form:

char[] list_chars(String s);

In java, Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each number by a space. Example output for userNum = 20:

Answers

Answer:

while(userNum > 1){

        userNum = userNum /2;

        System.out.print(userNum+" ");

     }

Explanation:

Probably don't need the print statement, but it doesn't cause an error.

This solution uses a while loop in Java to repeatedly divide a number by 2 and print the result until the number is less than 1. The example code and explanation illustrate the process clearly.

To solve this problem, you need to write a while loop in Java. This loop will continue dividing the given number by 2 until it reaches 1. Here's the step-by-step solution:

Example Code:

import java.util.Scanner;
public class Main {
   public static void main(String[] args) {
       Scanner scanner = new Scanner(System.in);
       int userNum = 20; // You can change this to any number.
       while (userNum >= 1) {
           System.out.print(userNum + " ");
           userNum = userNum / 2;
       }
   }
}

In this code:

We initialize userNum with a value (20 in this example).The while loop continues as long as userNum is greater than or equal to 1.In each iteration, we print userNum followed by a space and then divide it by 2 using integer division.

The output for userNum = 20 will be: 20 10 5 2 1 .

Do you think there are some disadvantages to "For Loop"? Or when using it is not good for its program?

Answers

Answer:

I think there are no disadvantages of for loop as far as i know.

Since for loop is entry controlled loop (i.e , the condition is checked for entering in the loop body).So when you want to execute the body first in the program for loops are not good fit for this type of conditions.You can use do while loop in these cases which is an exit controlled loop(body is executed first after the condition is checked) .

for example:-Iterating over and printing the circular linked list.

Why we need each section of prologprogram?

Answers

Answer:

Prolog program are used in the artificial intelligence and the web development in a systematic manner process. As, it is also sometimes known as declarative language which basically consist of some facts and list. Prolog program are divided into the sections that are:

Domain sectionsClauses sectionsPredicates sectionsGoal sections

We need each section of the prolog program because all the sections introduced the systematic program and performed there particular functions so by using all these processing steps an efficient function are formed.

A class diagram _____.
Answer

provides an overview of a class's data and methods

provides method implementation details

is never used by nonprogrammers because it is too technical

all of the above

Answers

Answer:

provides an overview of class's data and methods

Explanation:

Class Diagram is used in software engineering to represent:

- classes

- attributes

- methods

- relationship between classes

It provides a representation of the static layout of the application in object oriented design. It does not provide method implementation details. In fact code skeleton can be automatically generated from class diagram using appropriate UML tools.

What is the

stored program concept?

Answers

Answer:

 The stored program concept is defined as, in the architecture of computer where computer acts as internal store instruction and it is important because has high flexibility and user does not required to execute the instruction again and again. It is basically works on the principle of Von neumann architecture, as in which the instruction and the data are both same logically and can be used to store in the memory.

The minimum spanning tree of an undirected graph G exists if and only if G is connected. True or False?

Answers

Answer: True

Explanation:

The definition of minimum spanning tree(MST) says that the graph must be connected and undirected to be considered for MST. It has (V-1) edges where V is the number of vertices. The minimum spanning tree is implemented using Kruskal's algorithm whereby it starts by considering the minimum weighted edge and covers all the edges upto (V-1) edges. So for MST it has to be connected

C++ programming true or false questions

1. We have a class called animalType. Answer the following questions about clas animalType.

a. Its constructors will be named animalType. (True or False)

b. Return type of its constructors will be void. (True or False)

Answers

Answer:

a. True

b. False

Explanation:

Constructor is used to initialize the object of the class.

Rules of constructor:

1. Constructor name must same as the class name. it means, if the class name is animalType, then constructor name must be animalType.

2. Constructor does not have any return type. it means, it does not return anythings.

Therefore, part (a) is true,  Constructor name must same as the class name.

and part (b) is false, because constructor does not have any return type.

When mathematicians use a two-dimensional array, they often call it a ____.

a.
matrix

b.
grid

c.
net

d.
mesh

Answers

Answer:

matrix

Explanation:

The two dimensional array store the value similar to matrix.

Two dimensional array contain row and column similar to matrix.

For example:

int arr[3][3], it means 3 rows and 3 column

and [tex][A]_{3*3}=\left[\begin{array}{ccc}1&2&3\\4&5&6\\7&8&9\end{array}\right][/tex]

and if we want to retrieve the data from array arr[1][2], it means first row and second column.

so, 2 dimensional array is basically a matrix.

Which of the following is the new linecharacter?\r\n\l\b

Answers

Answer:

\n

Explanation:

\n is called the new line character.It is used to go to the next line or the start of the new line.\n is used in Linux while in windows uses \r\n called carriage return.But generally \n is used in most of the programming languages also.

An ____ is an object that produces each element of a container, such as a linked list, one element at a time.

A.
initiator

B.
iterator

C.
interpreter

Answers

Answer:

B. iterator

Explanation:

An iterator is an object that produces each element of a container, such as a linked list, one element at a time.

An iterator is an object that produces each element of a container, such as a linked list, one element at a time. Thus, the correct option for this question is B.

What is an element?

An element may be characterized as the constituent parts of a work of computer that is an essential characteristic of all works of programming and spoken narrative fiction. These elements include plot, theme, character, and tone.

According to the context of this question, an iterator is an object that significantly enables a programmer in order to transverse a container, particularly lists. The various types of iterators considerably provide numerous interfaces to the programmer in order to develop program.

Therefore, an iterator is an object that produces each element of a container, such as a linked list, one element at a time. Thus, the correct option for this question is B.

To learn more about Iterator, refer to the link:

https://brainly.com/question/29313296

#SPJ5

with open source operating systems,both the executable code and source code are available:

true or false?

Answers

Answer:v True

Explanation: Open source operating system is the system that has source code that can be modified and enhance them . It can also be shared between the public as it is available in the open form . There are many examples of the open source operating system like Linux, Ubuntu etc. which has both executable code and source code as well. so therefore the given statement is true.

Why do cellular telephone systems only need seven sets of frequencies in metropolitan areas?

Answers

Answer: For frequency reuse, telephone systems use 7 sets of frequencies in metropolitan areas.

Explanation:

As the population is high in metropolitan cities it requires faster reuse of frequencies so that everyone within the network region is being able to use their cellular devices. It can be imagined in the form of a hexagon with 6 points and one at the center enabling faster reuse of free frequencies.

In a circular linked list the last node points to the____ node.

a. first

b. last

c. middle

d. new

Answers

Answer: option A) First

In a circular linked list the last node points to the first node.

Explanation: As in a circular linked list, the node will point to its next node. Since the node next to last node is the first node hence last node will point to first node in a circular way. The elements points to each other in a circular path which forms a circular chain.

What to do: please remember to comment each line.
1 Initialize x to be zero

2 Prompt the user for the next operation (Addition or Subtraction)

3 Prompt the user for the next operand (y).

4 Perform the operation (x + y or x – y depends on the operation selected by
the user), and store back the result to x.

5 Output x in decimal.

6 Go back to step 2 until user input “q” as the next operation, then exit.

Answers

Answer:

#include <iostream>

using namespace std;

int main()

{

   //initialization

  float x=0.0;

  float y;

  char operation;

  //print the message

   cout<<"Please enter the operation (Addition or Subtraction): ";

   cin>>operation;

   //loop for enter th operand again until enter 'q'

  while(operation != 'q'){

       //print the message for operand x

      cout<<"\nPlease enter the operand x: ";

      cin>>x;

       //print the message for operand y

      cout<<"\nPlease enter the operand y: ";

      cin>>y;

   //check for condition for '+' and if true then add the operands

      if(operation == '+'){

          x=x+y;

      }else if(operation == '-'){  //if user enter '-' then subtract the operands

          x=x-y;

      }

      //print the output

      cout<<"\nThe output is: "<<x<<endl;

      cout<<"\nPlease enter the operation (Addition or Subtraction): ";

      cin>>operation;

  }

  return 0;

}

Explanation:

Create the main function and define the variable x equals zero and declare the variables y and operation.

print the message for the user to enter the operation ('+' or '-') by using the instruction cout.

Store the value in the variable by using the instruction cin.

Then, take the loop to repeat the statement again and again until the condition is true.

print the message inside the loop for asking about the operands from the user.

then, use condition statement for checking the operation and if condition match, then execute the particular operation.

The above operation executes until the user enters not enter the character 'q'.

when the user enters the 'q', the loop terminates and print the output.

Which statement will call this module and pass 12 as the argument?

Module showValue (Integer quantity)

Answer
a) Call showValue( Integer)

b) Call showValue (12)



c) Call showValue( Integer 12)

d) Call showValue( Real)

Answers

Answer:

Call showValue (12)

Explanation:

The function is a block of the statement which performs the special task.

if you define the function, then you have to call that function.

Then, program control moves to the function and start to execute otherwise not execute the function.

the syntax for calling the function:

name(argument_1, argument_2,....);

we can put any number of arguments in the calling.

check the options one by one for finding the answer:

Call showValue( Integer): this is valid calling but it passes the variable, not the 12. this is not correct.

Call showValue( Integer 12): This is not valid calling, because it passes the data type as well which is incorrect.

Call showValue( Real): this is valid calling but it passes the variable, not the 12. this is not correct.

Call showValue (12): this valid calling and also pass the value 12.

Therefore, the correct answer is option b.

write an algorithm that gets the price for item A plus the quantity purchased. The algorithm prints the total cost, including a 6% sales tax.

Answers

Answer:

Algorithm()

1. p = Enter the price of item A.

2. c = Enter the number of A’s purchased.

3. Now the price per item with tax is:

              t= p+(p*6/100)

4. The total cost of c items:  

             ct= t * c.

5. Print ct.

In this algorithm, we are taking the price per item and counting it’s cost including tax. Then we are multiplying the price per item with tax with the number of items we purchase, to find the overall cost with tax.

You may calculate the overall cost without tax as (p*c). Then you can find the overall cost with tax as ((p*c)+(p*c*6/100)), as in both way, we will get the same result.

Final answer:

To calculate the total cost of an item including a 6% sales tax, multiply the price of item A by the quantity purchased to get the total price before tax. Then calculate the sales tax by multiplying the total price by 0.06 and add this to the total price to get the total cost.

Explanation:

To write an algorithm that calculates the total cost of an item including sales tax, you need to first find the price of the item A and the quantity purchased. Then, to calculate the sales tax, you will convert the percent to a decimal and multiply it by the total price (price multiplied by quantity). Lastly, you will add this sales tax to the total price to get the total cost.

Algorithm:

Get the price of item A.Get the quantity of item A purchased.Calculate total price without tax: total_price = price_of_item_A * quantity_purchased.Calculate sales tax: sales_tax = total_price * 0.06.Calculate total cost including sales tax: total_cost = total_price + sales_tax.Print the total_cost.

For example, if the price of item A is $50 and the quantity purchased is 2, then the total cost before tax is $100. The sales tax at 6% would be $6. Therefore, the total cost including sales tax would be $106.

The simplest statement you can use to make a decision is the ____ statement.

a.
Boolean

b.
true false

c.
if

d.
this

Answers

A is the answer to the question

The simplest statement you can use to make a decision is the if statement. Thus, option C is correct.

What is a statement?

A statement within a programming language is just a syntactic construct of an arbitrary programming language that also expresses a course of action. A series of one or more statements make up a program built in this language. There could be internal parts to a proposition.

The simplest illustration of a decision framework in Java seems to be the if statement. A conceptual test that can result in a positive or negative outcome is expressed in an if statement.

The if statements inside the if the branch were carried out if the test's outcome is true. In this case, the statement can either be true or the statement can either be false depending upon the condition.

Therefore, option C is the correct option.

Learn more about statement, here:

https://brainly.com/question/20837448

#SPJ6

Methods used with object instantiations are called ____ methods.

a.
accessor

b.
instance

c.
internal

d.
static

Answers

Answer:

b. instance

Explanation:

Methods used with object instantiations are the instance methods. When a class is instantiated we get a reference to the object. Invoking a method on the object , executes the corresponding instance method.

For example:

String s = new String("test");

int len = s.length();

Here length() is an instance method of String object s.

.The process of capturing the requirements includes all ofthe following with the exception of:
A.verification B.elicitation C.analysis D.validation

Answers

Answer: A) Verification

Explanation: Capturing of the requirements is the process of which the project is taken up to test the scope that project. The capturing of requirement process is divided into certain parts to conduct the procedure as

ElicitationAnalysisValidationSpecification

Therefore there is no part of verification in the process so capturing of requirements process has a exception of verification.

The methods of the Character class that begin with ____ return a character that has been converted to the stated format.

a.
in

b.
to

c.
is

d.
for

Answers

Answer:

most probably the answer is 'to'

ETL & ELT are thesame.? True? False

Answers

Answer:

False.

Explanation:

ETL & ELT are NOT the same.

Given the IP address and subnet mask 192.168.10.0 and255.255.255.224

a) What is the maximum number of subnets in the network?

b) What is the number of hosts?

c) What are the valid subnets?
It is requested pls.give details how u have calculated?

Answers

Answer:

a) Maximum subnets=8

b) if there is no subnet , no. of hosts will be 32-2 = 30. If there are 8 subnets as above, then no. of hosts will b 4-2=2.

c)  Valid subnets are  6

                         192.168.10.32          

                         192.168.10.64                    

                         192.168.10.96

                         192.168.10.128

                         192.168.10.160

                         192.168.10.192

Explanation:

a) Maximum number of sub nets in the network

    For number of sub nets in a network , which class this ip address belongs to

         IP address  192.168.10.0

         subnet mask 255.255.255.224

192 in ip address means it is a class C address.

In class C address -

Network address-24 bits

Host address-8bits

For number of subnets we check last block of subnet mask.

224 -covert this into binary

                11100000

From binary form ,we can conclude that 3 bits are used for sub network as only 3 are 1.

  =2^n

  = 2^3 =8  

b)  Number of hosts

In a network,

     Number of hosts is (2^host no -2)

We have subtracted 2 because out of these hosts two are used in broadcasting and other purposes.  

Host number is equal to the 0's in the Subnet mask

                     255.255.255.224

convert this into binary number i.e

   11111111.11111111.11111111.11100000

So,5 0's are there

           Number of valid hosts= 2^5 -2

                                                = 32-2

                                                =  30

c) The Valid subnets are

For valid we have to perform Logical AND with IP Address and subnet    mask.

       IP address  192.168.10.0

       subnet mask 255.255.255.224

    Convert these in binary -

IP address  11000000.10101000.00001010.00000000

Subnet mask  11111111.11111111.11111111.11100000

after performing And operation- 11000000.10101000.00001010.00000000

                192.168.10.0

           this is the host address

                 192.168.10.224 this is the broadcast address

    These are the valid sub nets

                         192.168.10.32          

                         192.168.10.64                    

                         192.168.10.96

                         192.168.10.128

                         192.168.10.160

                         192.168.10.192

Write a program that gets a list of integers from input, and outputs the integers in ascending order (lowest to highest). The first integer indicates how many numbers are in the list. Assume that the list will always contain less than 20 integers. Ex: If the input is:

Answers

Answer:

integers=[]

while True:

      number=int(input())

      if number<0:

       break

      integers.append(number)  

print("",min(integers))

print("",max(integers))

Explanation:

What happens when an exception is thrown, but the try statement does not have a catch clause that is capable of catching it?

Answers

Answer:

A checked exception indicates something beyond your control has gone wrong. ... If an exception does not have a matching catch clause, the current method terminates and throws the exception to the next higher level. If there is no matching catch clause at any higher level, then the program terminates with an error.

What are different types of inner classes ?

Answers

Answer:

Inner class in Java is basically a class in a class, i.e. a member of another class.

There are 4 types of inner classes in Java.

a)  Nested Inner class

b)  Method local Inner class

c)  Anonymous Inner class

d)  Static nested class

. What is an RFC?How it's produced?

Answers

Answer: Request for Comments(RFC)is an official document containing methods, behaviors, research, internet specifications, protocols in systems connected to the internet.

RFC are produced by computer scientist , experts in the field of networking, protocols who author them and then send for approval from Internet Engineering Task Force(IETF). After there approval it is then assigned a serial number after which it cannot be modified.

Explanation:

RFC is an official document to propose and bring out new changes in the field of engineering and communication.

Once RFC has been produces it can also bring out modifications in the form of amendments.

Give at least 5 indicators which help to identify systems andtables as potential de-normalizationcandidates.

Answers

Answer and Explanation:

The five indicators are

There is existence of repeating groups which needs to be processed in a single group not individuallymany reports exist which need to be processed onlinetables need to processed in different way by different users at the same time certain columns need very large time for the de normalization take 60% as the alarming numbermany calculations needs to be applied to columns  before queries can be answered

Suppose a vector of ints initially has these 8 elements:
6 7 5 9 1 3 2 4
(a) How many swaps will be performed during a selection sort of the elements?

Answers

Answer:

Using the Selection Sort algorithm there will be 5 swaps in total within the vector of ints.

Explanation:

A Selection Sort algorithm compares the first value in the vector with the rest of the values and swaps it for the lowest value. It then moves on to the next value in the vector and repeats the process until the whole vector is sorted.

Initial Vector : 6 7 5 9 1 3 2 4

1st Swap :   1 7 5 9 6 3 2 4

2nd Swap:  1 2 5 9 6 3 7 4

3rd Swap :  1 2 3 9 6 5 7 4

4rth Swap:  1 2 3 4 6 5 7 9

5th Swap:   1 2 3 4 5 6 7 9

After the 5th Swap the Vector is completely Sorted.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

Other Questions
Please help, I'm stuck on this question _____What is matrix in tungsten carbide cutting tool? a)- Chromium b)- Manganese c)- Cobalt d)- Aluminum Find the equation of the line between the points (8,-4),(7-6) How is the history of colonialism in Africa related to the currently failed statesof Africa?DA. Colonialism created a manufacturing-based economy.B. Colonialism created artificially stable countries.OC. Colonialism reduced the importance of natural resources.OD. Colonialism increased the price of raw materials. What are some ways to minimize vitamin losses when cooking and storing food? Question 10 Multiple Choice Worth 1 points)(02.04 LC)Jewels has $6.75 to ride the ferry around Connecticut. It will cost her $0.45 every time she rides. Identify the dependent variable and independent variablein this scenario Find the distance between the points (-3, -2) and (-1, -2). What is the difference of the rational expressions below?3x/x-5 -4/x A 13.7 N force is applied to a cord wrapped around a disk of radius 0.43 m. The disk accelerates uniformly from rest to an angular speed of 30.3 rad/s in 3.43 s. Determine the angular acceleration of the disk. Hint: the average acceleration is the change in angular speed over time. If a sentence has two subjects but only one verb, that means itA.is a complex sentence.B.is a compound sentence.C.is a compound-complex sentence.D.has a compound subject, but it is not a compound sentence. 2. Which of the following is unique for any given element?A its mass numberB the number of its neutronsC its atomic number At age 42, Obediah is realizing that he may not reach all the goals he set when he was a younger man. He probably will never be rich or famous, and his relationships with his children and wife are not always as smooth as he would like them to be. In an effort to deny that he will have to let some dreams go and accept the life he has built for himself, he begins spending time with men who are half his age and squandering money as if he does not have a family to help support. Annoyed, his wife tells their friends that Obediah is going through aA) growth stage.B) decline stage.C) midlife crisis.D) postconventional crisis. Joyce Meadow pays her three workers $160, $470, and $800, respectively, per week. Calculate what Joyce will pay at the end of the first quarter for (A) state unemployment and (B) federal unemployment. Assume a state rate of 5.6% and a federal rate of .6%. Base is $7,000. A. $950.64; $67.14 B. $655.64; $97.14 C. $755.64; $81.14 D. $850.64; $91.14 By the end of the Civil War, two major parties had emerged, with the Republicans generally representing the ______________________. What is the domain of y=4sin(x)? Point Q is on line segment PR. Given QR=11 and PQ=3, determine the length PR. . An entrepreneur mayfinance fixed assets by:a. Inventoryloansb. Installmentloansc. Short-termdebtd. Long-termdebt Gram is planning a party he for his younger sister he has 36 prizes and 24 Blynn's how many children can he have at the party's of each child gets an equal number of prizes and and an equal number of balloons The slightly movable articulation between the sacrum and posterior portion of the ilium is called Which statement is true of body mass index? (a) It correlates with disease risks. (b) It decreases by 1 unit for every 10 years of life. (c) It provides an estimate of the fat level of the body. (d) It is defined as the person's height divided by the square of the weight. (e) Its absolute value is less important than the rate at which it changes.