## Why is the following grammar not LL(1)

Consider the following grammar:

S → bAb   | bBa A → aS   | CB B → b   | Bc C → c   | cC 

I have to provide the reasons as to why this grammar is not LL(1). So far all I can think of is that the grammar is not left factored given the productions:

S → bAb   | bBa 

But I am also wondering if the grammar is left recursive due to the productions:

B → b   | Bc 

Options provided are:

• This grammar has left recursion. (Unsure)
• This grammar has right recursion. (Would not make grammar not LL(1))
• This grammar is ambiguous. (Unsure)
• This grammar is not left factored. (Correct)
• This grammar can produce infinitely many distinct strings. (This shouldn’t affect a grammar right?)

As far as I can tell, the grammar is not ambiguous, I have tried 3 different inputs and all have resulted in a single parse tree. So is this grammar not LL(1) just because of the lack of left factoring? or also because the grammar is left recursive?

## Consider the following ckt. given in figure The present state Q2,Q1,Q0 of the counter before applying the clock pulse was (101). If the input Clock frequency to the circuit is 100KHz, then the output frequency of the circuit will be ?

My Approach: I have build the table from 101 it goes to 010 and from 010 to 101 again so it acts like mod-2 counter But I don’t understand the part in which we’re applying frequency. Can someone help me to visualize it.

## How to program a situation like the following in mathematics and generalize the process to other configurations?

Distribute the numbers from 1 to 10(view image) so that the sum of each row and each column is the same and a) the maximum possible b) the minimum possible (I put it from 1 to 10 for ease)

I know it is a problem that could work with matrices or lists but I can’t think how to start Posted on Categories cheapest proxies

## Determine if the following problem is decidable or not : Does the read–write head of a TM with the input w leave the word w?

Determine if the following problem is decidable or not : Does the read–write head of a TM with the given input w leave the word w on the tape?

Posted on Categories proxies

## What is the output of the following SQL query?

Consider a relation book(title,price). What is the output of the following SQL query?

select title from book as b where (select count(*) from book as t where t.price > b.price) < 7

Options:-

a) Titles of the six most expensive books

b) Titles of the sixth most expensive book

c) Titles of the seven most expensive books

d) Titles of the seventh most expensive book

How the inner Query works?

## How did this Example.name came and hows its used in the following program

class Example {

//static variable salary public static int age;

public static String name = “Gautam”; }

public class Person

{ public static void main(String args[]){

//acess variable without object Example.age=45;

System.out.println(” Name of a person:”+Example.name);

System.out.println(“Age of a person:”+Example.age);

Posted on Categories proxies

## closed form for the following recurrence relation

$$t(k,m,n) = \frac{m}{k}t(k-1,m-1,n-1)+ \frac{k-m}{k} t(k-2,m-1,n-1) + \frac{k-m}{k}$$ , where $$k \geq m \geq n$$

Posted on Categories proxies

## Construct a grammar for the expression of each of the following language [closed]

Construct a grammar for the expression of each of the following language: E = The set of all strings of 0’s and 1’s not containing 101 as a substring. a. C Language b. Java Language

Posted on Categories proxies

## Would the in-order traversal of the following elements in a binary tree look like this?

The elements are inserted in the following order : 50,45,12,15,60,55,70,65,80.

Following the left-root-right pattern: 70,60,80,45,15,50,55,12,65

Im not sure I got it right from the tree I just drew, would appreciate any help

Posted on Categories proxies

## Need help with the following SQL query

I need help with the following output. Tried case, Distinct, Group By, failed. Join might help, but still couldn’t write a query with join. 