Algorithms

An algorithm is a self-contained step-by-step set of operations to be performed. Algorithms exist that perform calculation, data processing, and automated reasoning. Starting from an initial state and initial input (perhaps empty), the instructions describe a computation that, when executed, proceeds through a finite number of well-defined successive states, eventually producing "output" and terminating at a final ending state. The transition from one state to the next is not necessarily deterministic; some algorithms, known as randomized algorithms, incorporate random input.

Share tech news, updates, or what's on your mind.

Sign up to Post

I need to prove that certain patterns were engineered and not random events and have been told that Neural Networks can be used to help make this determination.

What kinds of tools and algorithms should I be looking at?

Any sample projects that have done something similar?
0
[Webinar] Improve your customer journey
LVL 12
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

If we consider the included image, namely that the structure of the binary data obtained after treatment seems to be completely regular and more repeated in similar parts until the end of the file, can we consider being able to definitively free ourselves from identical elements within each slice and thus no longer need to store them?
Re-Scheduling the Binary Structure of a File to Reduce its Final Volume

Thank in advance for your opinion .. ... .....

Best regards,
0
C++03 using VS 2010. (Assume no boost available.)

I would like to find the missing points in the below diagram using C++03 std lib. The x's represent a set of given points, and the o's are the missing points.

x----o--x----x---o
|    |  |    |   |
o----o--x----o---x
|    |  |    |   |
o----x--x----o---x
|    |  |    |   |
x----o--x----o---o
|    |  |    |   |
x----x--o----o---o
|    |  |    |   |
o----o--x----o---o

Open in new window

I am given a set of points Pi = (Xi, Yi). The coordinates are of type double. If I were to draw a grid (consisting of horizontal and vertical lines) going though every point, I may have some missing points as shown above.

The result should be a std container having the (X, Y) points that are missing.

I suspect that http://www.cplusplus.com/reference/algorithm/set_difference/ or some variation might be useful. So getting the entire list of potential points somehow is probably also useful. Although speed is always a plus, it is not essential.

Any code suggestions?

BTW - there are NOT going to be any tricky points - like a point very far away from the main set of points.
BTW - I've been using axis indices to represent the actual axis coordinate values (but don't worry about that if it complicates the code).

I can probably do this using brute force using a 2D array; so the purpose of this question is to use std lib algorithm functions to simplify the code and hopefully improve performance.
0
I am learning the BigO notation and I have a question which is related to homework:

def __str__(self):
return str(self.list)

Open in new window


If I cast an object, does Python iterate over it?
That is, would I have a O(n) here or is it just O(1)?

Thanks for your help
0
Consider algos/softwares that take keywords in one document and match them (possibly a kind of set intersection) with keywords in N other documents, possibly producing a match ranking.

a. Is there a specific name for this?
b. Are there implementations in Java and PHP?

Example use cases would be
  • patients submitting a list of symptoms and then software looking for matches against known conditions
  • applicants submitting skillsets and looking for potential job matches
  • dating websites
0
Hello,

       I am running through the securing TCP/IP of the N10-06 certification and having difficulty understanding the use of Hash. I get the process of using the algorithm to change the data, but what I don't understand is how that is applied and how it is decrypted on the receiving side to get the data. I have read that it is a One-Way system and cannot be decrypted, but if that is the case how does the recipient decrypt it? Is there a public key sent with the hash and what portion of my computer actually does the decryption. I've been Googling on this a while and reading Mike Myers book as well as Professor Messers video on it, but I am only getting vague descriptions on the intent and concept but not how its staged and executed. Does anyone have any sage advice on this?

Thanks!
0
Dear Experts,

Actually trying to analyze the machine learning logics behind in algorithms, for example the KNeighborsClassifier():

import pandas
from sklearn.neighbors import KNeighborsClassifier
model = KNeighborsClassifier()
print(model)

Open in new window


Could you please advise would it be possible to list the content of an algorithm in Python and with which syntax concretely? The above print(model) of course just provides some overall information about the algorithm, but not the content

Thanks in advance,
0
A question about making puzzles for bridges (also known as Hashiwokakero or Hashi).  https://en.wikipedia.org/wiki/Hashiwokakero

Is there an algorithm to generate a puzzle given the size of grid?  Please provide algorithm or link to one if it exists.
0
Issue :SSL Certificate Signed Using Weak Hashing Algorithm      

An SSL certificate in the certificate chain has been signed using a
weak hash algorithm.      The remote service uses an SSL certificate chain that has been signed
using a cryptographically weak hashing algorithm (e.g. MD2, MD4, MD5,
or SHA1). These signature algorithms are known to be vulnerable to
collision attacks. An attacker can exploit this to generate another
certificate with the same digital signature, allowing an attacker to
masquerade as the affected service.

Note that this plugin reports all SSL certificate chains signed with
SHA-1 that expire after January 1, 2017 as vulnerable. This is in
accordance with Google's gradual sunsetting of the SHA-1 cryptographic
hash algorithm.

Note that certificates in the chain that are contained in the Nessus
CA database (known_CA.inc) have been ignored.      

Contact the Certificate Authority to have the certificate reissued.      

http://tools.ietf.org/html/rfc3279
http://www.nessus.org/u?e120eea1
http://technet.microsoft.com/en-us/security/advisory/961509

      
Plugin output:The following certificates were part of the certificate chain sent by
the remote host, but contain hashes that are considered to be weak.

|-Subject             : CN=XXX
|-Signature Algorithm : SHA-1 With RSA Encryption
|-Valid From          : Sep 30 12:06:43 2016 GMT
|-Valid To            : Sep 28 12:06:43 2026 GMT
0
The Original Data Sheet in the attached spreadsheet shows x, y coordinates and the corresponding true z values.
The Interpolation Sheet shows a different set of x, y coordinates (some overlapping), and the interpolated values imported from two different algorithms - bilinear and bicubic interpolation. There is also a column called z_truth.

My goal is to determine whether bilinear or bicubic interpolation is better.
It may be that for this initial data set that one sometimes does better than the other and vice versa.

To get a sense of how the interpolated data matched against the original data, I started copying rows from the Original Data Sheet to the Interpolation Sheet placing x, y coordinates from one near the other. If the coordinates match exactly, then there is only one copy. Otherwise, there are two copies where the original x, y coordinate falls between two x,y coordinates in interpolated sheet.

Currently, I am just going one row at a time from the Original Data Sheet and copying it to one or two locations in the Interpolation Sheet. This is taking too much time. I was wondering whether this copying could be automated.

If you could also help me with some metric to identify whether bilinear or bicubic interpolation is closer to the true values, I would appreciate that.

(I am now aware that my choice of original true value coordinates may not be so great; but this is a (good?) first start.

Thanks,
Paul
Compare_2d_Interpolations.xlsx
0
Free Tool: Subnet Calculator
LVL 12
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

I will be given a set of X/Y points and their corresponding Z values. Z = f(X, Y), but I do not know the function f. The points will be clustered together and I don't expect pathological conditions. The local maximums and minimums will have extra sample points to help make the interpolation better. The goal is to come up with a smooth surface that represents the function f as close as possible.

The analyst providing me with the set of points of known XYZ points will also give me an XY rectangular grid; and at all the intersection points of horizontal and vertical lines, I need to provide a z-value.

One thought I had was to consider a point and look at 4 quadrants, and take the closest point in each quadrant, and using those 4 points or more to try to interpolate. Prefer to be able to use a curved surface to get the results rather than linear planes. One rule is that the final results will match the given XYZ points . The given points are known as anchor points or knots.

I am just looking for something functional. I am not interested in speed.

 I am not allowed to use binaries, so I will have to build from source code in Linux or Windows.

Thanks in advance.
Paul
0
I have here what I think is a classical O.R. (operations research) problem. I'm looking to formulate it mathematically and look at the options available to solve it.

We have a list of say 100 recipes.

These recipes combined use 400 ingredients.

The quantity of ingredients required for all the recipes could be defined by a matrix dimension 100 x 400.

We can combine recipes into meal plans, so that the ingredients required for a meal plan is the total of the ingredients required for each recipe in the meal plan.

Each ingredient has an associated cost, that varies depending on the quantity bought.

Say the cost variations can be expressed with no more than 5 cost buckets per ingredient. Eg.

Bucket, Cost / kg
< 1kg, £4.00
1-5kg, £3.50
5-20kg, £3.00
20-100kg, £2.80
> 100kg, £2.50

The ingredient costs can be expressed in two matrices each of dimension 400 x 5:
a) One matrix 400 x 5 giving the buckets for each ingredient
b) Another matrix 400 x 5 giving the unit costs per ingredient and bucket number (1 to 5)

A given meal plan will have a given ingredient requirement, with associated total cost determined via the above matrices.

Suppose we constrain the number of meals in the meal plan to say 4 meals, and these 4 meals must be different recipes. For simplicity (!) we have no other constraints for now.

Our objective is to choose our meal plan (4 meals) such that the total cost is minimised.

Questions:
1. How do we formulate this problem?
0
There are huge amount of different slot machines available online, like in the given list here bettingcasinoslots.com. All of them powered by own random generated algorithm. So I would like to know if there some strategies to play slots? I mean when you are playing for money and you want to make even a little profit and it would be great it the strategy does not include loosing money. Researches and publications are appreciated too.
0
Watching this 6 minute video, I leaned HAARP shoots 72,000 times the maximum amount of energy for an AM station in the United States.

https://www.youtube.com/watch?v=ZUIiRHrUbpE

My question is what's a better analogy?

For example, how much energy is that compared to the output of a small nuclear plant?

I am just having a hard time sensing the scope of the comparison they created and hope someone can come up with a better description.

Thanks.
0
I have heard that Blockchain Database are secure because of their use of "Byzantine fault tolerance."

I am told, Blockchain algorithms use encryption techniques to intertwine new data with existing data using this type of cryptography.

Please verify this and explain in more detail where the term "Byzantine fault tolerance" comes from and what it is exactly?

Thanks
0
I would like to know how to compute the x-intercepts of a cubic graph based in a given equation. If there is a formula that does this, then i would like to know this formula, if not then i would like to know the steps required to compute said values.
0
What options are there to protect a web service from a DOS attack?

IF the web service were accessed only by my Objective-C iPhone application, and nowhere else, is this web service protected by the "security through obscurity" model? Or, can hackers crack open the source code of the iPhone app, like Apple can?

What about if I put the URL to the web service into the SQLite database and encrypted the Path?

So, when my app needs to request information from the web service, it does a DB lookup in the SQLite database for the path to the web service. When it gets it, it decrypts it. Then, using a variable (in memory) only, it makes the web service call.

Does this protect from a DOS attack to that web service call?

Are there easier ways?

Will this work on Java for the Android?

What about on my website?

Thanks.
0
What technologies are best suited for the highest performance web services to handle the heaviest loads? Thousands (even millions) of transactions per second?

I know that Node.js can handle thousand(s) sessions on a single thread. And I do not know of any other technology which handle more than one session per thread. Am I right about that? Are there others that can do this also?

What about real-time programming as it relates to web-services. Is there such a thing?

And how about a few general words about hardware deployment? Having a central API call which distributes calls to hundreds of more specialized web servers? What about Caching for successive related calls?

And what about Machine Learning? Can algorithms be optimized by existing Machine Learning algorithms that reduce the average response times of the most heavily load web service?

Thanks.
0
What should I expect by forking the BitCoin open source code? What kinds of things can one do in customizing the code?

What language(s) is it in? What platform does it run on?

What about the code run by Bookkeepers? And the generation of the BlockChain database updates?

And lastly, what "engine" determines which algorithms need to be mined and what is managing the connections to this peer-to-peer network?

Thanks
0
Free Tool: IP Lookup
LVL 12
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

X = 1   2
       3   4

y = 3   1
       4   2
how can i convert x to y????
0
I need to create a language agnostic hashing algorithm for a custom PHP-based application that I'm developing.  

The reason it needs to be language agnostic is because the PHP application that I'm developing needs to be able to communicate with another 3rd party application (hosted on Heroku) .. and both applications need to be able to apply the same exact algorithm.

I understand that its considered bad practice to use a hardcoded SALT value when applying hashing algorithms, but in this particular scenario, I suspect that it may be unavoidable.  I'm all ears, however.  Still .. let me explain what it is that I need to do first.

Here's what I currently have set up in my PHP application:

$param1= 'beta';
$param2= 'noodle';
$param3= '1502719494';
$hashstring = $param1. $param2. '-' . $param3;  
$options = [
  'cost' => 10,
  'salt' => 'Dk2jdfPIJFddf32948jdfg809fiejf',
];      
echo password_hash($hashstring, PASSWORD_BCRYPT, $options);

Open in new window


What I'd like to do is to somehow re-write this in a way where it could be interpreted universally in pretty much any programming language, .. but where they can both use the same hardcoded SALT value, and both return the exact same result.  The Heroku application is apparently a Node.js powered application (written in Google V8 JavaScript) .. if that information helps any.  

Anyways, .. I'd be interested to hear anyone's thoughts regarding what I'm trying to accomplish here.

Thanks,
- Yvan
0
I have the Excel file below with 3 columns.
On one row I have a pair of q, k corresponding to a certain x.
In the sheet are different values for x.
I need to find what pairs of q, k are common for all values of x.
How do you do that fast and easy?
Pairs.xlsx
0
What is the best and easiest approach, method, software to solve a system like the one below?

1=1*(3.14*2^p-1*1*[(23.14-5)*2^q-1*1*(3.14-3)/2^k]/2^r)/2^s
3=8*(3.14*2^p-8*8*[(23.14-5)*2^q-8*8*(3.14-3)/2^k]/2^r)/2^s
50=128*(3.14*2^p-128*128*[(23.14-5)*2^q-128*128*(3.14-3)/2^k]/2^r)/2^s
2896=8192*(3.14*2^p-8192*8192*[(23.14-5)*2^q-8192*8192*(3.14-3)/2^k]/2^r)/2^s
4096=16384*(3.14*2^p-16384*16384*[(23.14-5)*2^q-16384*16384*(3.14-3)/2^k]/2^r)/2^s

Could you help to find a set of solutions? I guess are more than one.
This is not homework, but rather one of that engineering approximation problem that ended up in a set of unknown variables.

Basically the function is.
S5(x)=x*(PI*2^p-x*x*[(2PI-5)*2^q-x*x*(PI-3)/2^k]/2^r)/2^s
with p, q, k, r, s unknown.
And next known set of solutions with 1 digit approximation allowed for S5x:
x - S5x
1 - 0
2 - 1
4 - 2
8 - 3
16 - 6
32 - 13
64 - 25
128 - 50
256 - 101
512 - 201
1024 - 401
2048 - 799
4096 - 1567
8192 - 2896
16384 - 4096
0
Hey,

I have an audio file, many actually, that are an interview between the interviewer and interviewee.  The same person is asking questions in each file, while the people answering are different.

I need to separate the answers out by generating silence over the interview questions. I'm currently doing this by hand with audacity, but it is extremely time consuming.

Any help would be greatly appreciated.  I am a software developer, but audio is not my area, so code is am option if there isn't a program available.

Thanks
0
If I am comparing my algorithm to another algorithm. My algorithm has a complexity f O(n) whereas the other algorithm is O(n2).

I then measured the running time by implementing the algorithms.

Should the running time of the other algorithm be the square of the running time of my algorithm?

For example of my algorithm running time is 3 ms should the other algorithm running time be 9?
0

Algorithms

An algorithm is a self-contained step-by-step set of operations to be performed. Algorithms exist that perform calculation, data processing, and automated reasoning. Starting from an initial state and initial input (perhaps empty), the instructions describe a computation that, when executed, proceeds through a finite number of well-defined successive states, eventually producing "output" and terminating at a final ending state. The transition from one state to the next is not necessarily deterministic; some algorithms, known as randomized algorithms, incorporate random input.