What would be the language generated by Σ*-x? [closed] - formal-languages

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Say, for example, Σ={x,y}.
And you carried out the operation Σ*-x. What would be the resulting language? Would it essentially be y* or would it just minus one occurrence of x in all strings generated in Σ*?
i.e xxyyxx to xyyxx.

It would be the language of all strings generated by Σ* minus the string x. (so: xx, epsilon, xyx, y, etc... but not x)

Related

A pseudocode for any positive integer (decimal ) and will display it as binary output [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 days ago.
Improve this question
Want a appropriate pseudocode
Write a pseudocode for any positive integer(decimal ) and display it as binary output .

Calculate % of number in Scala programming [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 11 months ago.
Improve this question
How to do 50% of 120 in scala code..need proper syntax ,& runnable code for same.
Eg :
int k = (int)(120*(50.0f/100.0f));
This is in java need scala code for same.
The answer would be:
(120*(50.0f/100.0f)).toInt

How to remove the first element of sub-list in prolog [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
List like this:[1,[2,3,4]]
Remove the first element of sub-list which is 2,
Result like this:[1,[3,4]]
This should get you an idea of how to do it:
rem_sublist_first([], []).
rem_sublist_first([X|Y], [X|Y2]):-
\+ X = [_|_],
rem_sublist_first(Y, Y2).
rem_sublist_first([[_|Y1]|Y2], [Y1|Y3]):-
rem_sublist_first(Y2, Y3).
test:-
rem_sublist_first([1,[2,3,4]], [1,[3,4]]),
rem_sublist_first([1,2,3,[4,5,6]], [1,2,3,[5,6]]).
I advise you to study prolog lists, they are essential for any type of prolog program so it is a worth investment if you are goind to write prolog code.

How to extract multiple numbers from a string and assign to individual variables [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
Lets say I have the string "first=53 second=65 third=82". How do I assign each value to variables x, y, z?
Edit: The words must match as well. With the + signs and exact number of spaces.
str = "first=53 second=65 third=82"
x, y, z = str.scan(/\d+/).map(&:to_i)

Ruby: Finding duplicate array elements in two dimentional array [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have this array:
a= [[1,2],[3,4],[1,2],[2,3],[2,3]]
How can I make user to enter an array element ex:[1,2] and it should take that element and return the number of times it is found in the array.
You have your array a and the user input (i1 and i2), all you have to do is:
a.count([i1, i2])

Resources