Algorithms – How to generate a deterministic finite state machine for a given language

Problem: Write a program that generates a deterministic finite automaton that accepts the given language. The language is defined with the alphabet and the start / end substrings.

For example: alphabet = {a, b, c}; start sub string = "down"; end sub string = "cb"

I need to construct DFA that accepts strings of the type: {abcb, abaacb, abcabcb …}.

Question: What algorithm should I use to write functions that create DFAs for this series of problems?

Algorithms – Trigonometry and possibilities for implementation by arithmetic

$$ If you're trying to hand in a response in trigonometry based on an input $ f (n) $ and $ n $ is your input, then you will want to find $ n ^ 2 $ first. because

$$ n = sqrt {t} $$

$$ And it will correlate directly with the outputs of the trigonometric functions

$$ tan ^ {- 1} (n) = f ( frac {n} {t} – frac {t} {n} – frac {t} {n}) $$
$$ sin ^ {- 1} (n) = g ( frac {n} {t} – frac {t} {n}) $$
$$ cos ^ {- 1} (n) = h ( frac {t} {n} – frac {n} {t}) $$, Below is the relationship of the input $ n $ while it cuts with $ tan ^ {- 1} (n) $, How is it directly under the function, how I created it?

$$ With much praise it seems that the functions $ sin $ & $ cos $ also train with your counterpart. The consistency usually over $ n $ & $ t $ still valid.

$$ How to find the trigonometric functions by simply calculating by hand.

Algorithms – How to solve this equation step by step

I have to solve this equation for a job that I do. I try to answer based on an input. If I can, I will be very happy. Could someone show me how to do that step by step? It would be very rewarding for me to do this.

$ frac {n} {t} – frac {t} {n} – frac {t} {n} $

This is the calculation for the tangent that I created. It works very well. The answer $ n $ tangential is always that $ sqrt {t} $ unless you implicitly do it $ n & # 39; = t $ and $ t & # 39; = n $

For your information:
$ frac {n} {t} – frac {t} {n} $ is sinus and $ frac {t} {n} – frac {n} {t} $ is cosine.

If you apply the tangent, you can find the sine and cosine of these formulas.

Lastly, it may have negative answers for $ t $ This seems to be common, but so far it has been biased to have a regular function to equate the why. (Millennium Prize?)

Algorithms – Create a priority search tree to determine the number of points in the range [-inf, qx] X [qy, qy’] from a series of points sorted by y-coordinates

A priority search tree can be created for a set of points P in time O (n log (n)). However, if the points are sorted by the y-coordinates, it takes O (n). I find algorithms for constructing the tree if the points are not sorted.

I found a way to do this as follows:

  1. Construct a BST on the points.
    Since the points are sorted, it will take O (n) time

  2. Min-heap the BST on the x-coordinates
    This will take theta (n) time

The total time complexity will be O (n).

Is this a valid approach to creating a priority search tree in O (n) time?

Algorithms – Image processing system (encryption / decryption) with Residue Number System

I am preparing for my final project at school and plan to work on the implementation of the Residue Number System in image processing.
I found this work online from Pallab Maji Here:

http://ethesis.nitrkl.ac.in/2831/1/Thesis_Final_App_of_RNS_in_Comm__SP.pdf

and I looked on pages 29 – 41, he explained the algorithm with which I do not know some concepts:

  • I: input image and block size m and n.
  • II: Divide the image into mxn blocks and scan the intermediate blocks in zigzag.
  • III: Z = m × n × 8 bits. Create a module set P, where P = {p1, p2 … pk} and equals Z bits.
  • IV: zigzag the scanned intermediate block into a word and scale it to avoid this
    Overflow.
  • V: Use the set P to convert the word to RNA.
  • VI: Re-group the RNA number to form a word and further subdivide it into mxn
    Blocks.
  • VII: Match the encrypted block to the picture.

I would be very grateful if someone could help me enforce it.

Algorithms – Find N best subset of quotes

I face the following problem:

We receive quotes from different forwarding companies for the shipping costs per parcel. Let's call these quotes Q1 … Qk.
Each offer is an M x N matrix with weight categories of packets along one axis and size categories along the other axis.
We get a list of packages with the appropriate weights and sizes, so we can also convert the packages to be sent based on the categorization of each package into a 2D matrix of size M x N and each cell must contain the appropriate number of packets in this weight + size category. Let's call this matrix P.

The total shipping cost for all packages, should we choose a shipping company, & # 39; i & # 39; is the sum of (Qi x P), where & # 39; x & # 39; is the elementwise multiplication of the two matrices.

We need to find a subset of shipping companies (or quotes) so that the total shipping cost is minimal.

I understand that a brute-force algorithm that tries all combinations will not work because the number of combinations explodes when & # 39; w & # 39; begins to increase. In addition, I've also convinced myself that I can not iteratively build a solution by first picking two best quotes, grouping them together, and then adding one more, until I & # 39; w & # 39; reach.

Can someone help me to find the appropriate problem class and propose a solution?

Time complexity – Multiset variant of the subset problem of known algorithms

I have been working in the time analysis for a solver that I have designed for the subset sum problem (multiset variant) and whose time complexity depends on the number of repeated elements in the input.

The temporal complexity is $ O (2 ^ {n / 2} cdot 0,75 ^ { frac {d / 2} {n}}) $ Where $ d = $ Number of duplicates in the input instance (both required) $ n $ and $ d $ are equal)

For example when $ d = n / 2 $ then:

$ O (2 ^ {n / 2} cdot 0,75 ^ { frac {n / 4} {n}}) approx. O (1,4142 cdot 0,93) approx. O (1,316 ^ n) $

In addition to the question of comments, I'm also looking for other well-known algorithms with similar behavior to compare approaches (looking for them, but so far found nothing …)

Algorithms – Distinct Binary Heaps

I have $ n $ Elements off $ n-1 $ are different. The repeated element is either the minimum or the maximum element. I have to find out how many different clusters can be made from it.

My analysis : I started with $ n $ different elements. Since the root is solid (maximum or minimum element), we can choose $ l $(Determined by subtracting the total number of elements from the elements on the penultimate level.) $ n-1 $ Elements and select recursively for the left subtree and the right subtree.

Repeat Relationship:

$ T (n) = {n-1 choose l} * T (l) * T (r) $

Now for $ n-1 $ different elements (given), for root we have $ 2 $ Options, d. H. maximum elements, and we can proceed recursively as above for the left and right subtree. But since the repeated element is there as well, I can not figure out exactly how to do it.

e.g: $ A = (2,6,6) $ =>
There are 2 different heaps.

I can not imagine how I can determine the number of heaps in this case. Can anyone think of algorithm / repetition relation to find something like that?

Algorithms – Non-Boolean SAT – Computer Science Stack Exchange

I was wondering how complex SAT tests are with variables $ x_i = 0 lor 1 lor 2 dots lor n $, where clauses are of the form $ x_i = a implies x_j neq b $, When $ n = 2 $We have 2SAT with linear time algorithms. Meanwhile, if $ n> 2 $If we can then almost convert it to 2SAT by having Boolean variables $ x_ {i, a} $ according to the statement $ x_i = a $However, this allows $ x_ {i, 1} = x_ {i, 2} = dots = x_ {i, n} = 0 $that would leave $ x_i $ unallocated.

Algorithms – Truss Tree Collection Knot Combinations

Summary: I have a tree that contains car parts, from which I have to put together all valid combinations of these parts.

Parts may be required – each build must contain them.

Parts can be optional.

Parts may conflict with other parts.

Parts may include optional parts.

Example tree:

Car
| - Motor (required)
| - - V8
| - - V12
| - - - Colour (optional)
| - - - - Black
| - - - - Chrome
| - Transmission (required)
| - - Mechanical
| - - Automatic
| - Wheels (optional)
| - - Basic
| - - Fancy
| - - - Colour (optional)
| - - - - Red
| - - - - Blue
| - BodyStyle (optional)
| - - Hatchback (conflicts with Motor.V12)
| - - Buggy (conflicts with Motor.V8)

Valid builds for this tree:

Car | Motor.V8 | Transmission.Automatic
Car | Motor.V8 | Transmission.Automatic | Wheels.Basic
Car | Motor.V12.Colour.Black | Transmission.Automatic | Wheels.Basic
Car | Motor.V8 | Transmission.Automatic | BodyStyle.Hatchback
Car | Motor.V12 | Transmission.Mechanical | Wheels.Fancy | BodyStyle.Buggy
Car | Motor.V12 | Transmission.Mechanical | Wheels.Fancy.Colour.Red | BodyStyle.Buggy

What algorithm should I look for to solve this task?