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

Con

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

Image

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);