## Is it possible to guess cvv code from ccn and ccexp?

If i am not wrong, visa is easy to guess cvv right?

Let’s say if I have 100,000 credit card numbers and expiration dates, it is possible to make daily 5 guesses.

All cards with 5 the same gateway/Api of payment and cards will not get blocked due to multiple attempts?

If yes, then it’s possible to create like 10 APIs and check them with 50 cvv attempts daily.

So, in the end, we get all 100,000 cards’ cvv codes in 20 days (50 guesses 000-001-002 daily)?

## Using Expand, Guess, Verify to solve the following recurrence relation

Hello and thanks to those who bothered reading! I am trying to solve the following recurrence relation, $$S(n) = S(n-1) + (2n-1)$$, with the following base case: $$S(1) = 1$$.

I already used the Solution Formula and got the closed form solution $$1^n + n^2 – 1$$, but for the expansion part I am having trouble with the $$g(n)$$ term. Perhaps even my solution formula answer is wrong. Any help is appreciated and I am more than willing to further explain the problem! The Solution Formula is $$S(n) = c^{n-1} S(1) + \sum_{i=2}^n (c^{n-i} g(i))$$ and $$g(n) = 2n-1$$. $$c$$ is the constant in front of the $$S(n)$$ term, which in this case is $$1$$.

Posted on Categories proxies

## FindRoot returns the initial guess (Having large magnitude)

In my program (Big Enough, no need to see, pasted here : https://pastebin.com/HqnskRdn), I am trying to find the root of equation by FindRoot in range of order of $$10^{12}$$ or so. but FindRoot returns the initial guess,

Now if I change the coefficients of equation slightly then also, It returns the initial guess.

Ex- Initial Guess: $$1.06154*10^{12}$$, Answer: $$1.06154*10^{12}$$

Any way out please ?

## Finding square root without division and initial guess

I am trying to look for a division-free algorithms which finds square-root using only addition and multiplication operations, with the initial guess as the number itself. Is there any such algorithms ?

Posted on Categories proxies

## Complexity guess and induction proof

I was trying to prove by induction that
$$T(n) = \begin{cases} 1 &\quad\text{if } n\leq 1\ T\left(\lfloor\frac{n}{2}\rfloor\right) + n &\quad\text{if } n\gt1 \ \end{cases}$$ is $$\Omega(n)$$ implying that $$\exists c>0, \exists m\geq 0\,\,|\,\,T(n) \geq cn \,\,\forall n\geq m$$

Base case : $$T(1) \geq c1 \implies c \leq 1$$

Now we shall assume that $$T(k) = \Omega(k) \implies T(k) \geq ck \,\,\forall k < n$$ and prove that $$T(n) = \Omega(n)$$.
$$T(n) = T(\lfloor{\frac{n}{2}}\rfloor) + n \geq c\lfloor{\frac{n}{2}}\rfloor + n \geq c \frac{n}{2} -1 + n \geq n\left(\frac{c}{2} – \frac{1}{n} + 1\right) \geq^{?} cn\ c \leq 2 – \frac{2}{n}$$
So we have proved that $$T(n) \geq c n$$ in :

1) The base case for $$c \leq 1$$

2) The inductive step for $$c \leq 2 – \frac{2}{n}$$

Yet we have to find a value that satisfies them both for all $$n\geq 1$$, the book suggest such value is $$c = 1$$ which to me is not true since :

$$1 \leq 1\1\leq2 – \frac{2}{n}\implies 1 \leq 0 \text{ for n = 1}$$
My guess would be $$0$$ but is not an acceptable value; So we just say its $$\Omega(n)$$ but for $$n \gt 1$$?Or how can we deal with it?

Posted on Categories proxies

## Any rule to guess CR in-game?

is there any rule for a character to guess the CR of an enemy?

A general sense of challenge may be enough, for example “that guy in full plate looks dangerous to me” (metagame: his CR is beyond what I can deal with) or “that elf in robes looks like a pity apprentice” (metagame: his CR is lower than mine).

For example, many computer rpg-like games draw characters with a circle which is coloured red/yellow/green when the enemy is clearly superior/equal/inferior to you.

Or must it just be roleplayed?

## How do we guess the recurrence relation from the given equation

In clrs , i have been reading about a method named substitution method to solve the recurrence, here the author guessed the solution is T(n) = O(n log n), but i am confused why not O(n^2)? is there any method to properly guess the solution? is there any thing i have missed in this method? Posted on Categories proxies

## Java guess the number

I have just returned to college to finish my associate’s in programming. The language my school uses for all of the programming classes is java, so I’ve been trying to get used to the language.

The code I’ve posted below works as far as I can tell, I am hoping some of you can give some constructive criticism to my code as far as the style and general improvements I could have made.

I am very new to the OOP concept, so I am also wondering if I declared everything right, I know global variables are normally bad practice, but since the global variables I used are in a class I wasn’t sure if that was really the same thing since they are all local variables anyway.

Also, the main function isn’t included here because all it does is call the public function playGame(), but if you really need it I can add it later.

import java.util.Random; import java.util.Scanner;  /**  * Title: GameFunctions  * Author: Dev  * Date: 6/1/2019  * Purpose: This class contains -  * -all the functions for the game  * */  public class GameFunctions {     private static int attempts;     private static int randomNumber;     private static int guessRange;     private static int userGuess;      private static boolean gameRunning = true;      /*      *  Takes care of the setup aspects of the game like      *  Generating a new random number and finding how      *  Many attemps the player will have      */     private static void gameInit()     {         setRandomNumber();         setAttemptsAndRange();     }      /* Sets randomNumber to a value between 1 and 100 */     private static void setRandomNumber()     {         Random random = new Random();         int low = 0;         int high = 100;         randomNumber = random.nextInt(high - low) + low;     }      /* Sets the attempts value based on how large the randomNumber is */     private static void setAttemptsAndRange()     {         if (randomNumber <= 10) {attempts = 2; guessRange = 10; }         else if (randomNumber <= 25) { attempts = 4; guessRange = 25; }         else if (randomNumber <= 50) { attempts = 5; guessRange = 50; }         else if (randomNumber <= 75) { attempts = 7; guessRange = 75; }         else { attempts = 10; guessRange = 100; }     }      /* Displays the number of attempts the user has left */     private static void getAttempts()     {         System.out.println("Attempts remaining: " + attempts);     }      /* Displays the random number, used at the end of the game */     private static void getRandomNumber()     {         System.out.println("The random number is " + randomNumber);     }      /* Gets input from the user */     private static void getInput()     {         Scanner scanner = new Scanner(System.in);          while (true)         {             try             {                 getAttempts();                 System.out.println("Enter a number between 0 and " + guessRange);                 userGuess = scanner.nextInt();                  if ( userGuess <= 100 && userGuess > 0) { break; }                 else { System.out.println("Number is out of guess range"); }             }             catch (java.util.InputMismatchException e)             {                 System.out.println("Invalid input");                 scanner.nextLine();             }         }     }      /*      * Checks to see if the guess is correct      * If it is not correct it will decrement the attempts value      */     private static void checkGuess()     {         if (userGuess != randomNumber)         {             if (userGuess < randomNumber) { System.out.println("Too Low!"); }             else { System.out.println("Too High!"); }             attempts--;         }     }      /* Tells the user their win/loss status and asks them to play again */     private static void playAgain()     {         String userInput;         Scanner scanner = new Scanner(System.in);          if (attempts > 0) { System.out.println("You won!"); }         else { System.out.println("You Lost!"); };          getRandomNumber();          while (true)         {             try             {                 System.out.println("Play Again? yes/no");                 userInput = scanner.next();                 if (userInput.equals("yes") || userInput.equals("no"))                 {                     if (userInput.equals("yes")) { break; }                     else { gameRunning = false; break; }                 }                 else { System.out.println("Invalid Input"); }             }             catch (java.util.InputMismatchException e)             {                 System.out.println("Invalid input, try again");             }         }      }      /* Main game loop */     public static void playGame()     {         while (gameRunning)         {             gameInit();             while (attempts > 0 && userGuess != randomNumber)             {                 getInput();                 checkGuess();             }             playAgain();         }     } } 

## Number guess game

I’m learning python and created a number guessing game on which I would like to get your feedback on the structure and style of the program.

I tried a small optimization on the program but this does not seem to work. On the validate the input area, I tried to remove the another_game = play_again() line an have within the if a check directly on the function. Like: if play_again() == ‘y’

This works for when a user enters y on the question if he wants to play again, but for some reason when I enter ‘n’, I get again the question if I would like to play again and only when I enter a second time, the program is exited.

So am I doing something wrong here?

import random   LOWER_NUMBER = 1 HIGHEST_NUMBER = 10   def print_header():     print("-" * 40)     print("Welcome to the number guessing game")     print("-" * 40)   def user_input():     """Collect and validate the entries made by the users      Returns     -------     int         Gives back the validated number entered by the user.     """     while True:         try:             guess = int(                 input(f'Enter your Guess of a number between '                       f'{LOWER_NUMBER} - {HIGHEST_NUMBER}: '))             if guess < LOWER_NUMBER or guess > HIGHEST_NUMBER:                 print("The entered number is out of range, try again.")                 continue         except ValueError:             print('you did not enter a number, please try again.')             continue         else:             break     return guess   def generate_number_to_guess(lower_number, higher_number):     """Generates a random number between the given lowest and highest number      Parameters     ----------     lower_number : int         Lowest number for the generator      higher_number : int         highest number for the generator      Returns     -------     int         returns the generated random number that is in the given range.     """     return random.randint(lower_number, higher_number)   def play_again():     """Perform and validate entry for a next game      Returns     -------     string         returns the validated user entry for a next game.     """     while True:         new_game = input(             "Would you like to play again? [y]es/[n]o: ")         if new_game.lower() not in ["n", "y"]:             print('Wrong entry please use y or n')             continue         else:             break      return new_game.lower()   def start_game():     """This is the main loop that runs the app.     """     highscore = 0      while True:         print_header()         number_to_guess = generate_number_to_guess(LOWER_NUMBER,                                                    HIGHEST_NUMBER)         guess = 0         count = 0          while guess != number_to_guess:             guess = user_input()             count += 1             if guess < number_to_guess:                 print("It's higher")             elif guess > number_to_guess:                 print("It's lower")         else:             print(                 f'\nYou geussed the right number and needed {count} tries')             if count < highscore or highscore == 0:                 highscore = count              # validate the input for a new game             another_game = play_again()             if another_game == 'y':                 print(f"\n\nThe HIGHSCORE is {highscore}")                 continue             elif another_game == 'n':                 print("\n Thanks for playing, see you next time!")                 break   if __name__ == "__main__":     start_game() 

## Guess the Number(Python)

I know this is kind of stuff is somewhat done to death but please still try to review it fairly.

My code will only go within the interval of [1,9]

def guessing_game():     no_of_guess = 0     c = "y"     import random     a = random.randint(1,9)     while c == "y":         b = input("Enter a guess: ")         if b.isdigit():             if int(b) == a:                 c = input("You got it! Play again? Enter \"Y\" if yes, and anything else to exit. ").lower()                 no_of_guess +=1                 a = random.randint(1,9)             elif int(b) > a:                 c = input("Too high. Try again? Enter \"Y\" if yes, and anything else to exit. ").lower()                 no_of_guess +=1             else:                 c = input("Too small. Try again? Enter \"Y\" if yes, and anything else to exit. ").lower()                 no_of_guess +=1          else:             c = input("Haha. Try again? Enter \"Y\" if yes, and anything else to exit. ").lower()     if c != "y":         print("How unfortunate. Well, you made %s guess(es)."%no_of_guess)   guessing_game()